[v2,00/17] net/sfc: factor out common driver library
mbox series

Message ID 1600324483-23153-1-git-send-email-arybchenko@solarflare.com
Headers show
Series
  • net/sfc: factor out common driver library
Related show

Message

Andrew Rybchenko Sept. 17, 2020, 6:34 a.m. UTC
Network and vDPA drivers share libefx. So, libefx should be moved
to common drivers.

DPDK adaptation of the MCDI interface may be shared as well.

The new common driver name is sfc_efx since it a new home of
libefx base driver. sfc_ prefix is used to make it clear that
it is related to net/sfc (and vdpa/sfc in the future).

Cc: Thomas Monjalon <thomas@monjalon.net>
Cc: David Marchand <david.marchand@redhat.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>

v2:
 - add patches to introduce LIBEFX_API and LIBEFX_INTERNAL
   global functions decorators
 - use LIBEFX_API for __rte_internal markup

Andrew Rybchenko (17):
  net/sfc/base: add missing extern storage-class specifiers
  net/sfc/base: decorate libefx API functions
  net/sfc/base: decorate libefx internal extern functions
  net/sfc: include header with debug helpers directly
  net/sfc: introduce common driver library
  net/sfc: add dedicated header file with MCDI interface
  net/sfc: move MCDI helper interface to dedicated namespace
  net/sfc: make MCDI logging helper macros local
  net/sfc: start to make MCDI helpers interface shareable
  net/sfc: use own logging helper macros
  net/sfc: avoid usage of NIC pointer from adapter context
  net/sfc: avoid panic in the case of MCDI timeout
  net/sfc: add MCDI callbacks to allocate/free DMA memory
  net/sfc: add MCDI callback to schedule restart
  net/sfc: add MCDI callback to poll management event queue
  net/sfc: use MCDI control structure as libefx ops context
  net/sfc: move MCDI helpers to common driver

 MAINTAINERS                                   |   1 +
 drivers/common/meson.build                    |   2 +-
 .../{net/sfc => common/sfc_efx}/base/README   |   0
 .../sfc => common/sfc_efx}/base/ef10_ev.c     |   0
 .../sfc => common/sfc_efx}/base/ef10_evb.c    |   0
 .../sfc => common/sfc_efx}/base/ef10_filter.c |   0
 .../sfc_efx}/base/ef10_firmware_ids.h         |   0
 .../sfc => common/sfc_efx}/base/ef10_image.c  |   0
 .../sfc => common/sfc_efx}/base/ef10_impl.h   | 250 +++++++++++--
 .../sfc => common/sfc_efx}/base/ef10_intr.c   |   0
 .../sfc => common/sfc_efx}/base/ef10_mac.c    |   0
 .../sfc => common/sfc_efx}/base/ef10_mcdi.c   |   0
 .../sfc => common/sfc_efx}/base/ef10_nic.c    |   0
 .../sfc => common/sfc_efx}/base/ef10_nvram.c  |   0
 .../sfc => common/sfc_efx}/base/ef10_phy.c    |   0
 .../sfc => common/sfc_efx}/base/ef10_proxy.c  |   0
 .../sfc => common/sfc_efx}/base/ef10_rx.c     |   0
 .../sfc_efx}/base/ef10_signed_image_layout.h  |   0
 .../sfc_efx}/base/ef10_tlv_layout.h           |   0
 .../sfc => common/sfc_efx}/base/ef10_tx.c     |   0
 .../sfc => common/sfc_efx}/base/ef10_vpd.c    |   0
 .../{net/sfc => common/sfc_efx}/base/efx.h    | 269 +++++++++++++-
 .../sfc => common/sfc_efx}/base/efx_annote.h  |   0
 .../sfc => common/sfc_efx}/base/efx_bootcfg.c |   0
 .../sfc => common/sfc_efx}/base/efx_check.h   |  13 +
 .../sfc => common/sfc_efx}/base/efx_crc32.c   |   0
 .../{net/sfc => common/sfc_efx}/base/efx_ev.c |   0
 .../sfc => common/sfc_efx}/base/efx_evb.c     |   0
 .../sfc => common/sfc_efx}/base/efx_filter.c  |   0
 .../sfc => common/sfc_efx}/base/efx_hash.c    |   0
 .../sfc => common/sfc_efx}/base/efx_impl.h    |  44 ++-
 .../sfc => common/sfc_efx}/base/efx_intr.c    |   0
 .../sfc => common/sfc_efx}/base/efx_lic.c     |   0
 .../sfc => common/sfc_efx}/base/efx_mac.c     |   0
 .../sfc => common/sfc_efx}/base/efx_mcdi.c    |   0
 .../sfc => common/sfc_efx}/base/efx_mcdi.h    |  29 ++
 .../sfc => common/sfc_efx}/base/efx_mon.c     |   0
 .../sfc => common/sfc_efx}/base/efx_nic.c     |   0
 .../sfc => common/sfc_efx}/base/efx_nvram.c   |   0
 .../sfc => common/sfc_efx}/base/efx_phy.c     |   0
 .../sfc => common/sfc_efx}/base/efx_phy_ids.h |   0
 .../sfc => common/sfc_efx}/base/efx_port.c    |   0
 .../sfc => common/sfc_efx}/base/efx_proxy.c   |   0
 .../sfc => common/sfc_efx}/base/efx_regs.h    |   0
 .../sfc_efx}/base/efx_regs_ef10.h             |   0
 .../sfc_efx}/base/efx_regs_mcdi.h             |   0
 .../sfc_efx}/base/efx_regs_mcdi_aoe.h         |   0
 .../sfc_efx}/base/efx_regs_mcdi_strs.h        |   0
 .../sfc_efx}/base/efx_regs_pci.h              |   0
 .../{net/sfc => common/sfc_efx}/base/efx_rx.c |   0
 .../sfc => common/sfc_efx}/base/efx_sram.c    |   0
 .../sfc => common/sfc_efx}/base/efx_tunnel.c  |   0
 .../{net/sfc => common/sfc_efx}/base/efx_tx.c |   0
 .../sfc => common/sfc_efx}/base/efx_types.h   |   0
 .../sfc => common/sfc_efx}/base/efx_vpd.c     |   0
 .../sfc => common/sfc_efx}/base/hunt_impl.h   |   1 +
 .../sfc => common/sfc_efx}/base/hunt_nic.c    |   0
 .../sfc => common/sfc_efx}/base/mcdi_mon.c    |   0
 .../sfc => common/sfc_efx}/base/mcdi_mon.h    |   9 +-
 .../sfc_efx}/base/medford2_impl.h             |   1 +
 .../sfc_efx}/base/medford2_nic.c              |   0
 .../sfc_efx}/base/medford_impl.h              |   1 +
 .../sfc => common/sfc_efx}/base/medford_nic.c |   0
 .../sfc => common/sfc_efx}/base/meson.build   |   0
 .../sfc => common/sfc_efx}/base/siena_flash.h |   0
 .../sfc => common/sfc_efx}/base/siena_impl.h  |  60 +++
 .../sfc => common/sfc_efx}/base/siena_mac.c   |   0
 .../sfc => common/sfc_efx}/base/siena_mcdi.c  |   0
 .../sfc => common/sfc_efx}/base/siena_nic.c   |   0
 .../sfc => common/sfc_efx}/base/siena_nvram.c |   0
 .../sfc => common/sfc_efx}/base/siena_phy.c   |   0
 .../sfc => common/sfc_efx}/base/siena_sram.c  |   0
 .../sfc => common/sfc_efx}/base/siena_vpd.c   |   0
 drivers/{net/sfc => common/sfc_efx}/efsys.h   |  63 ++--
 drivers/common/sfc_efx/meson.build            |  40 ++
 .../sfc_efx/rte_common_sfc_efx_version.map    | 185 ++++++++++
 drivers/common/sfc_efx/sfc_efx.c              |  23 ++
 drivers/common/sfc_efx/sfc_efx_debug.h        |  29 ++
 drivers/common/sfc_efx/sfc_efx_log.h          |  22 ++
 drivers/common/sfc_efx/sfc_efx_mcdi.c         | 343 ++++++++++++++++++
 drivers/common/sfc_efx/sfc_efx_mcdi.h         |  77 ++++
 drivers/net/sfc/meson.build                   |   6 +-
 drivers/net/sfc/sfc.c                         |   1 +
 drivers/net/sfc/sfc.h                         |  26 +-
 drivers/net/sfc/sfc_dp_tx.h                   |   1 +
 drivers/net/sfc/sfc_ef10.h                    |   2 +
 drivers/net/sfc/sfc_ef10_essb_rx.c            |   1 +
 drivers/net/sfc/sfc_ef10_rx.c                 |   1 +
 drivers/net/sfc/sfc_ef10_rx_ev.h              |   2 +
 drivers/net/sfc/sfc_ef10_tx.c                 |   1 +
 drivers/net/sfc/sfc_ethdev.c                  |  13 +
 drivers/net/sfc/sfc_filter.c                  |   1 +
 drivers/net/sfc/sfc_flow.c                    |   1 +
 drivers/net/sfc/sfc_log.h                     |  21 +-
 drivers/net/sfc/sfc_mcdi.c                    | 295 ++-------------
 drivers/net/sfc/sfc_port.c                    |   1 +
 96 files changed, 1452 insertions(+), 383 deletions(-)
 rename drivers/{net/sfc => common/sfc_efx}/base/README (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_ev.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_evb.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_filter.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_firmware_ids.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_image.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_impl.h (89%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_intr.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_mac.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_mcdi.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_nic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_nvram.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_phy.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_proxy.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_rx.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_signed_image_layout.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_tlv_layout.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_tx.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/ef10_vpd.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx.h (96%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_annote.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_bootcfg.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_check.h (97%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_crc32.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_ev.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_evb.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_filter.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_hash.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_impl.h (98%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_intr.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_lic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_mac.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_mcdi.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_mcdi.h (96%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_mon.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_nic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_nvram.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_phy.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_phy_ids.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_port.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_proxy.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_regs.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_regs_ef10.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_regs_mcdi.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_regs_mcdi_aoe.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_regs_mcdi_strs.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_regs_pci.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_rx.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_sram.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_tunnel.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_tx.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_types.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/efx_vpd.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/hunt_impl.h (98%)
 rename drivers/{net/sfc => common/sfc_efx}/base/hunt_nic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/mcdi_mon.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/mcdi_mon.h (89%)
 rename drivers/{net/sfc => common/sfc_efx}/base/medford2_impl.h (97%)
 rename drivers/{net/sfc => common/sfc_efx}/base/medford2_nic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/medford_impl.h (97%)
 rename drivers/{net/sfc => common/sfc_efx}/base/medford_nic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/meson.build (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_flash.h (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_impl.h (90%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_mac.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_mcdi.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_nic.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_nvram.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_phy.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_sram.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/base/siena_vpd.c (100%)
 rename drivers/{net/sfc => common/sfc_efx}/efsys.h (93%)
 create mode 100644 drivers/common/sfc_efx/meson.build
 create mode 100644 drivers/common/sfc_efx/rte_common_sfc_efx_version.map
 create mode 100644 drivers/common/sfc_efx/sfc_efx.c
 create mode 100644 drivers/common/sfc_efx/sfc_efx_debug.h
 create mode 100644 drivers/common/sfc_efx/sfc_efx_log.h
 create mode 100644 drivers/common/sfc_efx/sfc_efx_mcdi.c
 create mode 100644 drivers/common/sfc_efx/sfc_efx_mcdi.h

Comments

Ferruh Yigit Sept. 21, 2020, 10:38 p.m. UTC | #1
On 9/17/2020 7:34 AM, Andrew Rybchenko wrote:
> Network and vDPA drivers share libefx. So, libefx should be moved
> to common drivers.
> 
> DPDK adaptation of the MCDI interface may be shared as well.
> 
> The new common driver name is sfc_efx since it a new home of
> libefx base driver. sfc_ prefix is used to make it clear that
> it is related to net/sfc (and vdpa/sfc in the future).
> 
> Cc: Thomas Monjalon <thomas@monjalon.net>
> Cc: David Marchand <david.marchand@redhat.com>
> Cc: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> v2:
>   - add patches to introduce LIBEFX_API and LIBEFX_INTERNAL
>     global functions decorators
>   - use LIBEFX_API for __rte_internal markup
> 
> Andrew Rybchenko (17):
>    net/sfc/base: add missing extern storage-class specifiers
>    net/sfc/base: decorate libefx API functions
>    net/sfc/base: decorate libefx internal extern functions
>    net/sfc: include header with debug helpers directly
>    net/sfc: introduce common driver library
>    net/sfc: add dedicated header file with MCDI interface
>    net/sfc: move MCDI helper interface to dedicated namespace
>    net/sfc: make MCDI logging helper macros local
>    net/sfc: start to make MCDI helpers interface shareable
>    net/sfc: use own logging helper macros
>    net/sfc: avoid usage of NIC pointer from adapter context
>    net/sfc: avoid panic in the case of MCDI timeout
>    net/sfc: add MCDI callbacks to allocate/free DMA memory
>    net/sfc: add MCDI callback to schedule restart
>    net/sfc: add MCDI callback to poll management event queue
>    net/sfc: use MCDI control structure as libefx ops context
>    net/sfc: move MCDI helpers to common driver
> 

Series applied to dpdk-next-net/main, thanks.