This series began while looking at -Wunreachable-code results for
the drivers in common/. There were multiple places where symbols
were exported for use outside their library but had no users.

The process was:
  - drop unused internal symbols
  - localize symbols where possible. Make globals static etc.
  - remove unused code.

The result is:
  - RTE_EXPORT_INTERNAL_SYMBOL drops from 1753 to 1374.
  - 198 functions with no caller removed, plus 19 helpers that
    only existed to serve them.
  - 38 cases where global function could be static
  - 3 export entries for variables that no longer existed
  - 4 internal declarations gone from the installed headers
    rte_thash.h and rte_interrupts.h
  - about 7700 lines gone

Build tested with gcc and clang, shared and static, default and
minsize, plus the standalone tests. I don't have the dpaa, cnxk, mlx5
or sfc hardware, but there are no behaviour changes here: every patch
deletes an uncalled function, drops an export annotation, or adds a
static keyword. The one exception is a single line initializing an
output parameter that gcc -Os could no longer prove was set once its
function became static.

This may break users of out-of-tree drivers that are using
internal symbols. But that was never part of DPDK officially
supported policy.

Left alone deliberately: bus/cdx and raw/cnxk_rvu_lf, whose whole
driver-facing API looks unused only because neither has an in-tree
consumer. These drivers are really placeholders now. Only
rte_cdx_unregister() goes, with the other bus unregister functions.

Stephen Hemminger (45):
  bus/vmbus: do not export unused internal symbol
  bus/dpaa: remove exports for nonexistent symbols
  ethdev: do not export internal dummy ops
  hash: do not export internal toeplitz helper
  cryptodev: do not export internal device name helper
  mldev: do not export internal PMD device helpers
  gpudev: do not export unused internal functions
  eal/linux: do not export internal VFIO helpers
  eal/linux: remove unused VFIO device number helper
  eal: make per-thread epoll instance getter static
  bus: do not export unused driver unregister functions
  bus/fslmc: do not export internal symbols used only in the bus
  bus/dpaa: do not export internal symbols used only in the bus
  common/dpaax: do not export IOVA table dump helper
  net/nfb: do not export MDIO speed capability helper
  common/sxe2: do not export internal ioctl channel helpers
  common/mlx5: do not export internal symbols used only in common code
  net/idpf: do not export internal symbols used only in the driver
  net/iavf: do not export VF reset function
  eal: do not export unused Windows interrupt handle accessors
  common/cnxk: do not export internal symbols used only in roc
  common/sfc_efx: do not export internal symbols unused outside base
  crypto/cnxk: do not export internal Rx inject helpers
  net/cnxk: do not export inline inbound mode setter
  common/sfc_efx: remove unused libefx functions
  common/cnxk: remove unused roc functions
  common/mlx5: remove unused internal functions
  bus/fslmc: remove unused VFIO helpers
  bus/dpaa: remove unused FMan and netcfg helpers
  common/dpaax: remove unused IOVA table dump
  net/idpf: remove unused queue enable helper
  gpudev: remove unused attach function
  cryptodev: remove unused device name helper
  common/cnxk: remove unused MCS port recovery
  bus/dpaa: remove unused QMan and BMan functions
  bus/fslmc: remove unused MC object functions
  eal: remove unused Windows interrupt handle accessors
  common/sfc_efx: make efx_family static
  gpudev: make event notify helper static
  mldev: make device lookup helper static
  bus/fslmc: make internal helpers static
  net/cnxk: make inline inbound mode setter static
  common/sxe2: make memory event callback static
  net/idpf: make internal burst functions static
  common/cnxk: make internal roc functions static

 drivers/bus/cdx/bus_cdx_driver.h              |   1 -
 drivers/bus/cdx/cdx.c                         |   1 -
 drivers/bus/dpaa/base/fman/fman_hw.c          |  34 --
 drivers/bus/dpaa/base/fman/netcfg_layer.c     |  11 -
 drivers/bus/dpaa/base/qbman/bman.c            |  40 --
 drivers/bus/dpaa/base/qbman/bman_driver.c     |  11 -
 drivers/bus/dpaa/base/qbman/dpaa_alloc.c      |   5 -
 drivers/bus/dpaa/base/qbman/qman.c            | 110 ----
 drivers/bus/dpaa/bus_dpaa_driver.h            |   1 -
 drivers/bus/dpaa/dpaa_bus.c                   |   1 -
 drivers/bus/dpaa/dpaa_bus_base_symbols.c      |  16 -
 drivers/bus/dpaa/include/fsl_bman.h           |  10 +-
 drivers/bus/dpaa/include/fsl_fman.h           |   4 -
 drivers/bus/dpaa/include/fsl_qman.h           | 121 -----
 drivers/bus/dpaa/include/fsl_usd.h            |   4 -
 drivers/bus/dpaa/include/netcfg.h             |   3 -
 drivers/bus/fslmc/bus_fslmc_driver.h          |  16 -
 drivers/bus/fslmc/fslmc_bus.c                 |   1 -
 drivers/bus/fslmc/fslmc_vfio.c                |  42 +-
 drivers/bus/fslmc/mc/dpbp.c                   |  78 ---
 drivers/bus/fslmc/mc/dpci.c                   |  99 ----
 drivers/bus/fslmc/mc/dpcon.c                  |  50 --
 drivers/bus/fslmc/mc/dpio.c                   | 138 -----
 drivers/bus/fslmc/mc/dprc.c                   |   1 -
 drivers/bus/fslmc/mc/fsl_dpbp.h               |  12 -
 drivers/bus/fslmc/mc/fsl_dpci.h               |  16 -
 drivers/bus/fslmc/mc/fsl_dpcon.h              |  13 -
 drivers/bus/fslmc/mc/fsl_dpio.h               |  31 --
 drivers/bus/fslmc/mc/fsl_dprc.h               |   1 -
 drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c      |   8 -
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      |   4 +-
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h      |   3 -
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |   6 -
 .../fslmc/qbman/include/fsl_qbman_portal.h    |  25 -
 drivers/bus/fslmc/qbman/qbman_portal.c        |  22 -
 drivers/bus/ifpga/bus_ifpga_driver.h          |   1 -
 drivers/bus/ifpga/ifpga_bus.c                 |   1 -
 drivers/bus/platform/bus_platform_driver.h    |   1 -
 drivers/bus/platform/platform.c               |   1 -
 drivers/bus/uacce/bus_uacce_driver.h          |   1 -
 drivers/bus/uacce/uacce.c                     |   1 -
 drivers/bus/vdev/bus_vdev_driver.h            |   1 -
 drivers/bus/vdev/vdev.c                       |   1 -
 drivers/bus/vmbus/bus_vmbus_driver.h          |   1 -
 drivers/bus/vmbus/vmbus_common.c              |   1 -
 drivers/common/cnxk/cnxk_security.c           |  37 +-
 drivers/common/cnxk/cnxk_security.h           |  15 -
 drivers/common/cnxk/roc_aes.h                 |   2 +-
 drivers/common/cnxk/roc_bphy_irq.c            |   2 +-
 drivers/common/cnxk/roc_bphy_irq.h            |   2 -
 drivers/common/cnxk/roc_cpt.c                 |  50 --
 drivers/common/cnxk/roc_cpt.h                 |  10 +-
 drivers/common/cnxk/roc_cpt_debug.c           |  22 -
 drivers/common/cnxk/roc_dpi.c                 |  99 ----
 drivers/common/cnxk/roc_dpi.h                 |   5 -
 drivers/common/cnxk/roc_hash.h                |   8 +-
 drivers/common/cnxk/roc_idev.c                |  40 --
 drivers/common/cnxk/roc_idev.h                |  20 +-
 drivers/common/cnxk/roc_ie_ow.h               |   2 +-
 drivers/common/cnxk/roc_mcs.c                 | 511 ------------------
 drivers/common/cnxk/roc_mcs.h                 |  36 --
 drivers/common/cnxk/roc_mcs_sec_cfg.c         |  95 ----
 drivers/common/cnxk/roc_ml.c                  | 112 +---
 drivers/common/cnxk/roc_ml.h                  |  11 -
 drivers/common/cnxk/roc_nix.c                 |  12 +-
 drivers/common/cnxk/roc_nix.h                 | 124 +----
 drivers/common/cnxk/roc_nix_bpf.c             | 270 ---------
 drivers/common/cnxk/roc_nix_fc.c              | 231 +-------
 drivers/common/cnxk/roc_nix_inl.c             | 161 +-----
 drivers/common/cnxk/roc_nix_inl.h             |  17 +-
 drivers/common/cnxk/roc_nix_inl_dev.c         |  90 ---
 drivers/common/cnxk/roc_nix_mac.c             |  65 ---
 drivers/common/cnxk/roc_nix_mcast.c           | 117 ----
 drivers/common/cnxk/roc_nix_ops.c             |  45 +-
 drivers/common/cnxk/roc_nix_ptp.c             |   9 -
 drivers/common/cnxk/roc_nix_queue.c           | 364 -------------
 drivers/common/cnxk/roc_nix_rss.c             |   2 +-
 drivers/common/cnxk/roc_nix_stats.c           |   6 -
 drivers/common/cnxk/roc_nix_tm_ops.c          | 259 +--------
 drivers/common/cnxk/roc_nix_tm_utils.c        |  51 --
 drivers/common/cnxk/roc_nix_vlan.c            | 243 ---------
 drivers/common/cnxk/roc_npa.c                 | 252 +--------
 drivers/common/cnxk/roc_npa.h                 |  37 +-
 drivers/common/cnxk/roc_npa_debug.c           |  39 --
 drivers/common/cnxk/roc_npc.c                 | 119 +---
 drivers/common/cnxk/roc_npc.h                 |  19 +-
 drivers/common/cnxk/roc_platform.c            |   3 -
 drivers/common/cnxk/roc_platform.h            |   1 -
 .../common/cnxk/roc_platform_base_symbols.c   | 161 ------
 drivers/common/cnxk/roc_ree.c                 |  87 +--
 drivers/common/cnxk/roc_ree.h                 |   7 -
 drivers/common/cnxk/roc_rvu_lf.h              |   2 +-
 drivers/common/cnxk/roc_sso.c                 |  66 +--
 drivers/common/cnxk/roc_sso.h                 |   8 -
 drivers/common/dpaax/dpaax_iova_table.c       |  42 --
 drivers/common/dpaax/dpaax_iova_table.h       |   2 -
 drivers/common/mlx5/mlx5_common.c             |   1 -
 drivers/common/mlx5/mlx5_common_mp.c          |  24 -
 drivers/common/mlx5/mlx5_common_mp.h          |   6 -
 drivers/common/mlx5/mlx5_common_utils.c       |   7 -
 drivers/common/mlx5/mlx5_common_utils.h       |   3 -
 drivers/common/mlx5/mlx5_devx_cmds.c          | 142 -----
 drivers/common/mlx5/mlx5_devx_cmds.h          |  18 -
 drivers/common/mlx5/mlx5_malloc.c             |   1 -
 drivers/common/mlx5/mlx5_malloc.h             |   1 -
 drivers/common/sfc_efx/base/efx.h             | 400 --------------
 drivers/common/sfc_efx/base/efx_ev.c          |  78 ---
 drivers/common/sfc_efx/base/efx_evb.c         | 146 -----
 drivers/common/sfc_efx/base/efx_filter.c      | 189 -------
 drivers/common/sfc_efx/base/efx_hash.c        | 160 ------
 drivers/common/sfc_efx/base/efx_intr.c        |  27 -
 drivers/common/sfc_efx/base/efx_mac.c         |  43 --
 drivers/common/sfc_efx/base/efx_mae.c         |  30 -
 drivers/common/sfc_efx/base/efx_mcdi.c        | 307 -----------
 drivers/common/sfc_efx/base/efx_mcdi.h        |  28 -
 drivers/common/sfc_efx/base/efx_mon.c         |  81 ---
 drivers/common/sfc_efx/base/efx_nic.c         | 132 +----
 drivers/common/sfc_efx/base/efx_phy.c         |  89 ---
 drivers/common/sfc_efx/base/efx_port.c        |  15 -
 drivers/common/sfc_efx/base/efx_rx.c          |  35 --
 drivers/common/sfc_efx/base/efx_sram.c        | 164 ------
 drivers/common/sfc_efx/base/efx_tx.c          | 155 ------
 drivers/common/sfc_efx/base/efx_virtio.c      |  37 --
 drivers/common/sfc_efx/sfc_base_symbols.c     |  73 ---
 drivers/common/sxe2/sxe2_common.c             |   3 +-
 drivers/common/sxe2/sxe2_common.h             |   5 -
 drivers/common/sxe2/sxe2_ioctl_chnl.c         |   5 -
 drivers/common/sxe2/sxe2_ioctl_chnl_func.h    |   5 -
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c     |   3 -
 drivers/crypto/cnxk/cn10k_cryptodev_ops.h     |   2 -
 drivers/crypto/cnxk/cn20k_cryptodev_ops.c     |   3 -
 drivers/crypto/cnxk/cn20k_cryptodev_ops.h     |   2 -
 drivers/net/cnxk/cnxk_ethdev.c                |   3 +-
 drivers/net/cnxk/cnxk_ethdev.h                |   3 -
 drivers/net/intel/iavf/base/iavf_prototype.h  |   1 -
 drivers/net/intel/iavf/iavf_base_symbols.c    |   1 -
 drivers/net/intel/idpf/idpf_common_device.c   |   1 -
 drivers/net/intel/idpf/idpf_common_device.h   |   1 -
 drivers/net/intel/idpf/idpf_common_rxtx.c     |  21 +-
 drivers/net/intel/idpf/idpf_common_rxtx.h     |  28 -
 .../net/intel/idpf/idpf_common_rxtx_avx2.c    |   3 -
 .../net/intel/idpf/idpf_common_rxtx_avx512.c  |   4 -
 drivers/net/intel/idpf/idpf_common_virtchnl.c |  78 +--
 drivers/net/intel/idpf/idpf_common_virtchnl.h |  11 -
 drivers/net/nfb/nfb_mdio.c                    |   1 -
 drivers/net/nfb/nfb_mdio.h                    |   1 -
 lib/cryptodev/cryptodev_pmd.h                 |   3 -
 lib/cryptodev/rte_cryptodev.c                 |  25 -
 lib/eal/common/eal_common_bus.c               |   1 -
 lib/eal/common/eal_common_interrupts.c        |  23 -
 lib/eal/common/eal_interrupts.h               |   9 +-
 lib/eal/freebsd/eal_interrupts.c              |   7 -
 lib/eal/include/bus_driver.h                  |   1 -
 lib/eal/include/rte_interrupts.h              |  44 --
 lib/eal/linux/eal_interrupts.c                |   3 +-
 lib/eal/linux/eal_vfio.c                      |  37 --
 lib/eal/linux/include/dev_vfio.h              |  28 -
 lib/eal/windows/eal_interrupts.c              |   7 -
 lib/ethdev/ethdev_driver.c                    |   4 -
 lib/ethdev/ethdev_driver.h                    |   4 -
 lib/gpudev/gpudev.c                           |  54 +-
 lib/gpudev/gpudev_driver.h                    |   8 -
 lib/hash/rte_thash.c                          |   1 +
 lib/hash/rte_thash.h                          |  13 -
 lib/hash/rte_thash_gf2_poly_math.c            |   2 +-
 lib/hash/thash_private.h                      |  16 +
 lib/mldev/rte_mldev.c                         |   5 +-
 lib/mldev/rte_mldev_pmd.h                     |  17 -
 168 files changed, 129 insertions(+), 7699 deletions(-)
 create mode 100644 lib/hash/thash_private.h

-- 
2.53.0

Reply via email to