From 5e111ed87999b2df4084b4d9c95643c98df1ba48 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 17 Sep 2020 07:34:31 +0100 Subject: [PATCH] net/sfc: introduce common driver library Move libefx (base driver) into common driver. Prepare to add vDPA driver which will use the common driver as well. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- 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 | 0 .../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 | 0 .../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 | 0 .../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 | 0 .../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 | 0 .../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 | 0 .../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 | 0 .../sfc_efx}/base/medford2_impl.h | 0 .../sfc_efx}/base/medford2_nic.c | 0 .../sfc_efx}/base/medford_impl.h | 0 .../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 | 0 .../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 | 39 ++++ .../sfc_efx/rte_common_sfc_efx_version.map | 182 ++++++++++++++++++ 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/net/sfc/meson.build | 6 +- 80 files changed, 330 insertions(+), 37 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 (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) rename drivers/{net/sfc => common/sfc_efx}/base/medford2_impl.h (100%) rename drivers/{net/sfc => common/sfc_efx}/base/medford2_nic.c (100%) rename drivers/{net/sfc => common/sfc_efx}/base/medford_impl.h (100%) 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 (100%) 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 diff --git a/MAINTAINERS b/MAINTAINERS index df3033cdb9..a251340b52 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -853,6 +853,7 @@ F: doc/guides/nics/features/qede*.ini Solarflare sfc_efx M: Andrew Rybchenko +F: drivers/common/sfc_efx/ F: drivers/net/sfc/ F: doc/guides/nics/sfc_efx.rst F: doc/guides/nics/features/sfc_efx.ini diff --git a/drivers/common/meson.build b/drivers/common/meson.build index 9ed4c04ba5..7ac1ca73a2 100644 --- a/drivers/common/meson.build +++ b/drivers/common/meson.build @@ -6,6 +6,6 @@ if is_windows endif std_deps = ['eal'] -drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2', 'qat'] +drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2', 'qat', 'sfc_efx'] config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON' driver_name_fmt = 'rte_common_@0@' diff --git a/drivers/net/sfc/base/README b/drivers/common/sfc_efx/base/README similarity index 100% rename from drivers/net/sfc/base/README rename to drivers/common/sfc_efx/base/README diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/common/sfc_efx/base/ef10_ev.c similarity index 100% rename from drivers/net/sfc/base/ef10_ev.c rename to drivers/common/sfc_efx/base/ef10_ev.c diff --git a/drivers/net/sfc/base/ef10_evb.c b/drivers/common/sfc_efx/base/ef10_evb.c similarity index 100% rename from drivers/net/sfc/base/ef10_evb.c rename to drivers/common/sfc_efx/base/ef10_evb.c diff --git a/drivers/net/sfc/base/ef10_filter.c b/drivers/common/sfc_efx/base/ef10_filter.c similarity index 100% rename from drivers/net/sfc/base/ef10_filter.c rename to drivers/common/sfc_efx/base/ef10_filter.c diff --git a/drivers/net/sfc/base/ef10_firmware_ids.h b/drivers/common/sfc_efx/base/ef10_firmware_ids.h similarity index 100% rename from drivers/net/sfc/base/ef10_firmware_ids.h rename to drivers/common/sfc_efx/base/ef10_firmware_ids.h diff --git a/drivers/net/sfc/base/ef10_image.c b/drivers/common/sfc_efx/base/ef10_image.c similarity index 100% rename from drivers/net/sfc/base/ef10_image.c rename to drivers/common/sfc_efx/base/ef10_image.c diff --git a/drivers/net/sfc/base/ef10_impl.h b/drivers/common/sfc_efx/base/ef10_impl.h similarity index 100% rename from drivers/net/sfc/base/ef10_impl.h rename to drivers/common/sfc_efx/base/ef10_impl.h diff --git a/drivers/net/sfc/base/ef10_intr.c b/drivers/common/sfc_efx/base/ef10_intr.c similarity index 100% rename from drivers/net/sfc/base/ef10_intr.c rename to drivers/common/sfc_efx/base/ef10_intr.c diff --git a/drivers/net/sfc/base/ef10_mac.c b/drivers/common/sfc_efx/base/ef10_mac.c similarity index 100% rename from drivers/net/sfc/base/ef10_mac.c rename to drivers/common/sfc_efx/base/ef10_mac.c diff --git a/drivers/net/sfc/base/ef10_mcdi.c b/drivers/common/sfc_efx/base/ef10_mcdi.c similarity index 100% rename from drivers/net/sfc/base/ef10_mcdi.c rename to drivers/common/sfc_efx/base/ef10_mcdi.c diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c similarity index 100% rename from drivers/net/sfc/base/ef10_nic.c rename to drivers/common/sfc_efx/base/ef10_nic.c diff --git a/drivers/net/sfc/base/ef10_nvram.c b/drivers/common/sfc_efx/base/ef10_nvram.c similarity index 100% rename from drivers/net/sfc/base/ef10_nvram.c rename to drivers/common/sfc_efx/base/ef10_nvram.c diff --git a/drivers/net/sfc/base/ef10_phy.c b/drivers/common/sfc_efx/base/ef10_phy.c similarity index 100% rename from drivers/net/sfc/base/ef10_phy.c rename to drivers/common/sfc_efx/base/ef10_phy.c diff --git a/drivers/net/sfc/base/ef10_proxy.c b/drivers/common/sfc_efx/base/ef10_proxy.c similarity index 100% rename from drivers/net/sfc/base/ef10_proxy.c rename to drivers/common/sfc_efx/base/ef10_proxy.c diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c similarity index 100% rename from drivers/net/sfc/base/ef10_rx.c rename to drivers/common/sfc_efx/base/ef10_rx.c diff --git a/drivers/net/sfc/base/ef10_signed_image_layout.h b/drivers/common/sfc_efx/base/ef10_signed_image_layout.h similarity index 100% rename from drivers/net/sfc/base/ef10_signed_image_layout.h rename to drivers/common/sfc_efx/base/ef10_signed_image_layout.h diff --git a/drivers/net/sfc/base/ef10_tlv_layout.h b/drivers/common/sfc_efx/base/ef10_tlv_layout.h similarity index 100% rename from drivers/net/sfc/base/ef10_tlv_layout.h rename to drivers/common/sfc_efx/base/ef10_tlv_layout.h diff --git a/drivers/net/sfc/base/ef10_tx.c b/drivers/common/sfc_efx/base/ef10_tx.c similarity index 100% rename from drivers/net/sfc/base/ef10_tx.c rename to drivers/common/sfc_efx/base/ef10_tx.c diff --git a/drivers/net/sfc/base/ef10_vpd.c b/drivers/common/sfc_efx/base/ef10_vpd.c similarity index 100% rename from drivers/net/sfc/base/ef10_vpd.c rename to drivers/common/sfc_efx/base/ef10_vpd.c diff --git a/drivers/net/sfc/base/efx.h b/drivers/common/sfc_efx/base/efx.h similarity index 100% rename from drivers/net/sfc/base/efx.h rename to drivers/common/sfc_efx/base/efx.h diff --git a/drivers/net/sfc/base/efx_annote.h b/drivers/common/sfc_efx/base/efx_annote.h similarity index 100% rename from drivers/net/sfc/base/efx_annote.h rename to drivers/common/sfc_efx/base/efx_annote.h diff --git a/drivers/net/sfc/base/efx_bootcfg.c b/drivers/common/sfc_efx/base/efx_bootcfg.c similarity index 100% rename from drivers/net/sfc/base/efx_bootcfg.c rename to drivers/common/sfc_efx/base/efx_bootcfg.c diff --git a/drivers/net/sfc/base/efx_check.h b/drivers/common/sfc_efx/base/efx_check.h similarity index 100% rename from drivers/net/sfc/base/efx_check.h rename to drivers/common/sfc_efx/base/efx_check.h diff --git a/drivers/net/sfc/base/efx_crc32.c b/drivers/common/sfc_efx/base/efx_crc32.c similarity index 100% rename from drivers/net/sfc/base/efx_crc32.c rename to drivers/common/sfc_efx/base/efx_crc32.c diff --git a/drivers/net/sfc/base/efx_ev.c b/drivers/common/sfc_efx/base/efx_ev.c similarity index 100% rename from drivers/net/sfc/base/efx_ev.c rename to drivers/common/sfc_efx/base/efx_ev.c diff --git a/drivers/net/sfc/base/efx_evb.c b/drivers/common/sfc_efx/base/efx_evb.c similarity index 100% rename from drivers/net/sfc/base/efx_evb.c rename to drivers/common/sfc_efx/base/efx_evb.c diff --git a/drivers/net/sfc/base/efx_filter.c b/drivers/common/sfc_efx/base/efx_filter.c similarity index 100% rename from drivers/net/sfc/base/efx_filter.c rename to drivers/common/sfc_efx/base/efx_filter.c diff --git a/drivers/net/sfc/base/efx_hash.c b/drivers/common/sfc_efx/base/efx_hash.c similarity index 100% rename from drivers/net/sfc/base/efx_hash.c rename to drivers/common/sfc_efx/base/efx_hash.c diff --git a/drivers/net/sfc/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h similarity index 100% rename from drivers/net/sfc/base/efx_impl.h rename to drivers/common/sfc_efx/base/efx_impl.h diff --git a/drivers/net/sfc/base/efx_intr.c b/drivers/common/sfc_efx/base/efx_intr.c similarity index 100% rename from drivers/net/sfc/base/efx_intr.c rename to drivers/common/sfc_efx/base/efx_intr.c diff --git a/drivers/net/sfc/base/efx_lic.c b/drivers/common/sfc_efx/base/efx_lic.c similarity index 100% rename from drivers/net/sfc/base/efx_lic.c rename to drivers/common/sfc_efx/base/efx_lic.c diff --git a/drivers/net/sfc/base/efx_mac.c b/drivers/common/sfc_efx/base/efx_mac.c similarity index 100% rename from drivers/net/sfc/base/efx_mac.c rename to drivers/common/sfc_efx/base/efx_mac.c diff --git a/drivers/net/sfc/base/efx_mcdi.c b/drivers/common/sfc_efx/base/efx_mcdi.c similarity index 100% rename from drivers/net/sfc/base/efx_mcdi.c rename to drivers/common/sfc_efx/base/efx_mcdi.c diff --git a/drivers/net/sfc/base/efx_mcdi.h b/drivers/common/sfc_efx/base/efx_mcdi.h similarity index 100% rename from drivers/net/sfc/base/efx_mcdi.h rename to drivers/common/sfc_efx/base/efx_mcdi.h diff --git a/drivers/net/sfc/base/efx_mon.c b/drivers/common/sfc_efx/base/efx_mon.c similarity index 100% rename from drivers/net/sfc/base/efx_mon.c rename to drivers/common/sfc_efx/base/efx_mon.c diff --git a/drivers/net/sfc/base/efx_nic.c b/drivers/common/sfc_efx/base/efx_nic.c similarity index 100% rename from drivers/net/sfc/base/efx_nic.c rename to drivers/common/sfc_efx/base/efx_nic.c diff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/common/sfc_efx/base/efx_nvram.c similarity index 100% rename from drivers/net/sfc/base/efx_nvram.c rename to drivers/common/sfc_efx/base/efx_nvram.c diff --git a/drivers/net/sfc/base/efx_phy.c b/drivers/common/sfc_efx/base/efx_phy.c similarity index 100% rename from drivers/net/sfc/base/efx_phy.c rename to drivers/common/sfc_efx/base/efx_phy.c diff --git a/drivers/net/sfc/base/efx_phy_ids.h b/drivers/common/sfc_efx/base/efx_phy_ids.h similarity index 100% rename from drivers/net/sfc/base/efx_phy_ids.h rename to drivers/common/sfc_efx/base/efx_phy_ids.h diff --git a/drivers/net/sfc/base/efx_port.c b/drivers/common/sfc_efx/base/efx_port.c similarity index 100% rename from drivers/net/sfc/base/efx_port.c rename to drivers/common/sfc_efx/base/efx_port.c diff --git a/drivers/net/sfc/base/efx_proxy.c b/drivers/common/sfc_efx/base/efx_proxy.c similarity index 100% rename from drivers/net/sfc/base/efx_proxy.c rename to drivers/common/sfc_efx/base/efx_proxy.c diff --git a/drivers/net/sfc/base/efx_regs.h b/drivers/common/sfc_efx/base/efx_regs.h similarity index 100% rename from drivers/net/sfc/base/efx_regs.h rename to drivers/common/sfc_efx/base/efx_regs.h diff --git a/drivers/net/sfc/base/efx_regs_ef10.h b/drivers/common/sfc_efx/base/efx_regs_ef10.h similarity index 100% rename from drivers/net/sfc/base/efx_regs_ef10.h rename to drivers/common/sfc_efx/base/efx_regs_ef10.h diff --git a/drivers/net/sfc/base/efx_regs_mcdi.h b/drivers/common/sfc_efx/base/efx_regs_mcdi.h similarity index 100% rename from drivers/net/sfc/base/efx_regs_mcdi.h rename to drivers/common/sfc_efx/base/efx_regs_mcdi.h diff --git a/drivers/net/sfc/base/efx_regs_mcdi_aoe.h b/drivers/common/sfc_efx/base/efx_regs_mcdi_aoe.h similarity index 100% rename from drivers/net/sfc/base/efx_regs_mcdi_aoe.h rename to drivers/common/sfc_efx/base/efx_regs_mcdi_aoe.h diff --git a/drivers/net/sfc/base/efx_regs_mcdi_strs.h b/drivers/common/sfc_efx/base/efx_regs_mcdi_strs.h similarity index 100% rename from drivers/net/sfc/base/efx_regs_mcdi_strs.h rename to drivers/common/sfc_efx/base/efx_regs_mcdi_strs.h diff --git a/drivers/net/sfc/base/efx_regs_pci.h b/drivers/common/sfc_efx/base/efx_regs_pci.h similarity index 100% rename from drivers/net/sfc/base/efx_regs_pci.h rename to drivers/common/sfc_efx/base/efx_regs_pci.h diff --git a/drivers/net/sfc/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c similarity index 100% rename from drivers/net/sfc/base/efx_rx.c rename to drivers/common/sfc_efx/base/efx_rx.c diff --git a/drivers/net/sfc/base/efx_sram.c b/drivers/common/sfc_efx/base/efx_sram.c similarity index 100% rename from drivers/net/sfc/base/efx_sram.c rename to drivers/common/sfc_efx/base/efx_sram.c diff --git a/drivers/net/sfc/base/efx_tunnel.c b/drivers/common/sfc_efx/base/efx_tunnel.c similarity index 100% rename from drivers/net/sfc/base/efx_tunnel.c rename to drivers/common/sfc_efx/base/efx_tunnel.c diff --git a/drivers/net/sfc/base/efx_tx.c b/drivers/common/sfc_efx/base/efx_tx.c similarity index 100% rename from drivers/net/sfc/base/efx_tx.c rename to drivers/common/sfc_efx/base/efx_tx.c diff --git a/drivers/net/sfc/base/efx_types.h b/drivers/common/sfc_efx/base/efx_types.h similarity index 100% rename from drivers/net/sfc/base/efx_types.h rename to drivers/common/sfc_efx/base/efx_types.h diff --git a/drivers/net/sfc/base/efx_vpd.c b/drivers/common/sfc_efx/base/efx_vpd.c similarity index 100% rename from drivers/net/sfc/base/efx_vpd.c rename to drivers/common/sfc_efx/base/efx_vpd.c diff --git a/drivers/net/sfc/base/hunt_impl.h b/drivers/common/sfc_efx/base/hunt_impl.h similarity index 100% rename from drivers/net/sfc/base/hunt_impl.h rename to drivers/common/sfc_efx/base/hunt_impl.h diff --git a/drivers/net/sfc/base/hunt_nic.c b/drivers/common/sfc_efx/base/hunt_nic.c similarity index 100% rename from drivers/net/sfc/base/hunt_nic.c rename to drivers/common/sfc_efx/base/hunt_nic.c diff --git a/drivers/net/sfc/base/mcdi_mon.c b/drivers/common/sfc_efx/base/mcdi_mon.c similarity index 100% rename from drivers/net/sfc/base/mcdi_mon.c rename to drivers/common/sfc_efx/base/mcdi_mon.c diff --git a/drivers/net/sfc/base/mcdi_mon.h b/drivers/common/sfc_efx/base/mcdi_mon.h similarity index 100% rename from drivers/net/sfc/base/mcdi_mon.h rename to drivers/common/sfc_efx/base/mcdi_mon.h diff --git a/drivers/net/sfc/base/medford2_impl.h b/drivers/common/sfc_efx/base/medford2_impl.h similarity index 100% rename from drivers/net/sfc/base/medford2_impl.h rename to drivers/common/sfc_efx/base/medford2_impl.h diff --git a/drivers/net/sfc/base/medford2_nic.c b/drivers/common/sfc_efx/base/medford2_nic.c similarity index 100% rename from drivers/net/sfc/base/medford2_nic.c rename to drivers/common/sfc_efx/base/medford2_nic.c diff --git a/drivers/net/sfc/base/medford_impl.h b/drivers/common/sfc_efx/base/medford_impl.h similarity index 100% rename from drivers/net/sfc/base/medford_impl.h rename to drivers/common/sfc_efx/base/medford_impl.h diff --git a/drivers/net/sfc/base/medford_nic.c b/drivers/common/sfc_efx/base/medford_nic.c similarity index 100% rename from drivers/net/sfc/base/medford_nic.c rename to drivers/common/sfc_efx/base/medford_nic.c diff --git a/drivers/net/sfc/base/meson.build b/drivers/common/sfc_efx/base/meson.build similarity index 100% rename from drivers/net/sfc/base/meson.build rename to drivers/common/sfc_efx/base/meson.build diff --git a/drivers/net/sfc/base/siena_flash.h b/drivers/common/sfc_efx/base/siena_flash.h similarity index 100% rename from drivers/net/sfc/base/siena_flash.h rename to drivers/common/sfc_efx/base/siena_flash.h diff --git a/drivers/net/sfc/base/siena_impl.h b/drivers/common/sfc_efx/base/siena_impl.h similarity index 100% rename from drivers/net/sfc/base/siena_impl.h rename to drivers/common/sfc_efx/base/siena_impl.h diff --git a/drivers/net/sfc/base/siena_mac.c b/drivers/common/sfc_efx/base/siena_mac.c similarity index 100% rename from drivers/net/sfc/base/siena_mac.c rename to drivers/common/sfc_efx/base/siena_mac.c diff --git a/drivers/net/sfc/base/siena_mcdi.c b/drivers/common/sfc_efx/base/siena_mcdi.c similarity index 100% rename from drivers/net/sfc/base/siena_mcdi.c rename to drivers/common/sfc_efx/base/siena_mcdi.c diff --git a/drivers/net/sfc/base/siena_nic.c b/drivers/common/sfc_efx/base/siena_nic.c similarity index 100% rename from drivers/net/sfc/base/siena_nic.c rename to drivers/common/sfc_efx/base/siena_nic.c diff --git a/drivers/net/sfc/base/siena_nvram.c b/drivers/common/sfc_efx/base/siena_nvram.c similarity index 100% rename from drivers/net/sfc/base/siena_nvram.c rename to drivers/common/sfc_efx/base/siena_nvram.c diff --git a/drivers/net/sfc/base/siena_phy.c b/drivers/common/sfc_efx/base/siena_phy.c similarity index 100% rename from drivers/net/sfc/base/siena_phy.c rename to drivers/common/sfc_efx/base/siena_phy.c diff --git a/drivers/net/sfc/base/siena_sram.c b/drivers/common/sfc_efx/base/siena_sram.c similarity index 100% rename from drivers/net/sfc/base/siena_sram.c rename to drivers/common/sfc_efx/base/siena_sram.c diff --git a/drivers/net/sfc/base/siena_vpd.c b/drivers/common/sfc_efx/base/siena_vpd.c similarity index 100% rename from drivers/net/sfc/base/siena_vpd.c rename to drivers/common/sfc_efx/base/siena_vpd.c diff --git a/drivers/net/sfc/efsys.h b/drivers/common/sfc_efx/efsys.h similarity index 93% rename from drivers/net/sfc/efsys.h rename to drivers/common/sfc_efx/efsys.h index dee06e5ae3..46b08f9789 100644 --- a/drivers/net/sfc/efsys.h +++ b/drivers/common/sfc_efx/efsys.h @@ -25,15 +25,16 @@ #include #include -#include "sfc_debug.h" -#include "sfc_log.h" +#include "sfc_efx_debug.h" +#include "sfc_efx_log.h" #ifdef __cplusplus extern "C" { #endif -/* No specific decorations required since all functions are local now */ -#define LIBEFX_API +#define LIBEFX_API __rte_internal + +/* No specific decorations required since functions are local by default */ #define LIBEFX_INTERNAL #define EFSYS_HAS_UINT64 1 @@ -228,8 +229,8 @@ typedef struct efsys_mem_s { volatile uint32_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_dword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_dword_t))); \ \ _addr = (volatile uint32_t *)(_base + (_offset)); \ (_edp)->ed_u32[0] = _addr[0]; \ @@ -246,8 +247,8 @@ typedef struct efsys_mem_s { volatile uint64_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_qword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_qword_t))); \ \ _addr = (volatile uint64_t *)(_base + (_offset)); \ (_eqp)->eq_u64[0] = _addr[0]; \ @@ -265,8 +266,8 @@ typedef struct efsys_mem_s { volatile __m128i *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_oword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_oword_t))); \ \ _addr = (volatile __m128i *)(_base + (_offset)); \ (_eop)->eo_u128[0] = _addr[0]; \ @@ -287,8 +288,8 @@ typedef struct efsys_mem_s { volatile uint32_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_dword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_dword_t))); \ \ EFSYS_PROBE2(mem_writed, unsigned int, (_offset), \ uint32_t, (_edp)->ed_u32[0]); \ @@ -305,8 +306,8 @@ typedef struct efsys_mem_s { volatile uint64_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_qword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_qword_t))); \ \ EFSYS_PROBE3(mem_writeq, unsigned int, (_offset), \ uint32_t, (_eqp)->eq_u32[1], \ @@ -324,8 +325,8 @@ typedef struct efsys_mem_s { volatile __m128i *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_oword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_oword_t))); \ \ \ EFSYS_PROBE5(mem_writeo, unsigned int, (_offset), \ @@ -390,8 +391,8 @@ typedef struct efsys_bar_s { volatile uint32_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_dword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_dword_t))); \ _NOTE(CONSTANTCONDITION); \ if (_lock) \ SFC_BAR_LOCK(_esbp); \ @@ -415,8 +416,8 @@ typedef struct efsys_bar_s { volatile uint64_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_qword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_qword_t))); \ \ SFC_BAR_LOCK(_esbp); \ \ @@ -438,8 +439,8 @@ typedef struct efsys_bar_s { volatile __m128i *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_oword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_oword_t))); \ \ _NOTE(CONSTANTCONDITION); \ if (_lock) \ @@ -469,8 +470,8 @@ typedef struct efsys_bar_s { volatile uint32_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_dword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_dword_t))); \ \ _NOTE(CONSTANTCONDITION); \ if (_lock) \ @@ -495,8 +496,8 @@ typedef struct efsys_bar_s { volatile uint64_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_qword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_qword_t))); \ \ SFC_BAR_LOCK(_esbp); \ \ @@ -530,8 +531,8 @@ typedef struct efsys_bar_s { volatile __m128i *_addr; \ \ _NOTE(CONSTANTCONDITION); \ - SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ - sizeof(efx_oword_t))); \ + SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof(efx_oword_t))); \ \ _NOTE(CONSTANTCONDITION); \ if (_lock) \ @@ -629,7 +630,7 @@ typedef rte_spinlock_t efsys_lock_t; #define SFC_EFSYS_UNLOCK(_eslp) \ rte_spinlock_unlock((_eslp)) #define SFC_EFSYS_LOCK_ASSERT_OWNED(_eslp) \ - SFC_ASSERT(rte_spinlock_is_locked((_eslp))) + SFC_EFX_ASSERT(rte_spinlock_is_locked((_eslp))) typedef int efsys_lock_state_t; @@ -644,7 +645,7 @@ typedef int efsys_lock_state_t; #define EFSYS_UNLOCK(_lockp, _state) \ do { \ - SFC_ASSERT((_state) == EFSYS_LOCK_MAGIC); \ + SFC_EFX_ASSERT((_state) == EFSYS_LOCK_MAGIC); \ SFC_EFSYS_UNLOCK(_lockp); \ _NOTE(CONSTANTCONDITION); \ } while (B_FALSE) @@ -701,7 +702,7 @@ typedef uint64_t efsys_stat_t; #define EFSYS_ERR(_esip, _code, _dword0, _dword1) \ do { \ (void)(_esip); \ - SFC_GENERIC_LOG(ERR, "FATAL ERROR #%u (0x%08x%08x)", \ + SFC_EFX_LOG(ERR, "FATAL ERROR #%u (0x%08x%08x)", \ (_code), (_dword0), (_dword1)); \ _NOTE(CONSTANTCONDITION); \ } while (B_FALSE) diff --git a/drivers/common/sfc_efx/meson.build b/drivers/common/sfc_efx/meson.build new file mode 100644 index 0000000000..8fab4df792 --- /dev/null +++ b/drivers/common/sfc_efx/meson.build @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019-2020 Xilinx, Inc. +# +# This software was jointly developed between OKTET Labs (under contract +# for Solarflare) and Solarflare Communications, Inc. + +if arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64') + build = false + reason = 'only supported on x86_64' +endif + +extra_flags = [] + +# Enable more warnings +extra_flags += [ + '-Wdisabled-optimization' +] + +# Compiler and version dependent flags +extra_flags += [ + '-Waggregate-return', + '-Wbad-function-cast' +] + +foreach flag: extra_flags + if cc.has_argument(flag) + cflags += flag + endif +endforeach + +subdir('base') +objs = [base_objs] + +sources = files( + 'sfc_efx.c', +) + +includes += include_directories('base') diff --git a/drivers/common/sfc_efx/rte_common_sfc_efx_version.map b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map new file mode 100644 index 0000000000..fa297d251b --- /dev/null +++ b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map @@ -0,0 +1,182 @@ +INTERNAL { + global: + + efx_crc32_calculate; + + efx_ev_fini; + efx_ev_init; + efx_ev_qcreate; + efx_ev_qdestroy; + efx_ev_qmoderate; + efx_ev_qpending; + efx_ev_qpoll; + efx_ev_qpost; + efx_ev_qprime; + efx_ev_usecs_to_ticks; + + efx_evq_nbufs; + efx_evq_size; + + efx_family; + + efx_filter_fini; + efx_filter_init; + efx_filter_insert; + efx_filter_remove; + efx_filter_restore; + efx_filter_spec_init_rx; + efx_filter_spec_init_tx; + efx_filter_spec_set_encap_type; + efx_filter_spec_set_eth_local; + efx_filter_spec_set_ether_type; + efx_filter_spec_set_geneve; + efx_filter_spec_set_ipv4_full; + efx_filter_spec_set_ipv4_local; + efx_filter_spec_set_mc_def; + efx_filter_spec_set_nvgre; + efx_filter_spec_set_rss_context; + efx_filter_spec_set_uc_def; + efx_filter_spec_set_vxlan; + efx_filter_supported_filters; + + efx_hash_bytes; + efx_hash_dwords; + + efx_intr_disable; + efx_intr_disable_unlocked; + efx_intr_enable; + efx_intr_fatal; + efx_intr_fini; + efx_intr_init; + efx_intr_status_line; + efx_intr_status_message; + efx_intr_trigger; + + efx_loopback_mask; + efx_loopback_type_name; + + efx_mac_addr_set; + efx_mac_drain; + efx_mac_fcntl_get; + efx_mac_fcntl_set; + efx_mac_filter_default_rxq_clear; + efx_mac_filter_default_rxq_set; + efx_mac_filter_get_all_ucast_mcast; + efx_mac_filter_set; + efx_mac_multicast_list_set; + efx_mac_pdu_get; + efx_mac_pdu_set; + efx_mac_stat_name; + efx_mac_stats_clear; + efx_mac_stats_get_mask; + efx_mac_stats_periodic; + efx_mac_stats_update; + efx_mac_stats_upload; + efx_mac_up; + + efx_mcdi_fini; + efx_mcdi_get_proxy_handle; + efx_mcdi_get_timeout; + efx_mcdi_init; + efx_mcdi_new_epoch; + efx_mcdi_reboot; + efx_mcdi_request_abort; + efx_mcdi_request_poll; + efx_mcdi_request_start; + + efx_mon_fini; + efx_mon_init; + efx_mon_name; + + efx_nic_calculate_pcie_link_bandwidth; + efx_nic_cfg_get; + efx_nic_check_pcie_link_speed; + efx_nic_create; + efx_nic_destroy; + efx_nic_fini; + efx_nic_get_bar_region; + efx_nic_get_fw_subvariant; + efx_nic_get_fw_version; + efx_nic_get_vi_pool; + efx_nic_hw_unavailable; + efx_nic_init; + efx_nic_probe; + efx_nic_reset; + efx_nic_set_drv_limits; + efx_nic_set_drv_version; + efx_nic_set_fw_subvariant; + efx_nic_set_hw_unavailable; + efx_nic_unprobe; + + efx_phy_adv_cap_get; + efx_phy_adv_cap_set; + efx_phy_fec_type_get; + efx_phy_link_state_get; + efx_phy_lp_cap_get; + efx_phy_media_type_get; + efx_phy_module_get_info; + efx_phy_oui_get; + efx_phy_verify; + + efx_port_fini; + efx_port_init; + efx_port_loopback_set; + efx_port_poll; + + efx_pseudo_hdr_hash_get; + efx_pseudo_hdr_pkt_length_get; + + efx_rx_fini; + efx_rx_hash_default_support_get; + efx_rx_init; + efx_rx_qcreate; + efx_rx_qcreate_es_super_buffer; + efx_rx_qdestroy; + efx_rx_qenable; + efx_rx_qflush; + efx_rx_qpost; + efx_rx_qpush; + efx_rx_scale_context_alloc; + efx_rx_scale_context_free; + efx_rx_scale_default_support_get; + efx_rx_scale_hash_flags_get; + efx_rx_scale_key_set; + efx_rx_scale_mode_set; + efx_rx_scale_tbl_set; + efx_rxq_nbufs; + efx_rxq_size; + + efx_sram_buf_tbl_clear; + efx_sram_buf_tbl_set; + + efx_tunnel_config_clear; + efx_tunnel_config_udp_add; + efx_tunnel_config_udp_remove; + efx_tunnel_fini; + efx_tunnel_init; + efx_tunnel_reconfigure; + + efx_tx_fini; + efx_tx_init; + efx_tx_qcreate; + efx_tx_qdesc_checksum_create; + efx_tx_qdesc_dma_create; + efx_tx_qdesc_post; + efx_tx_qdesc_tso_create; + efx_tx_qdesc_tso2_create; + efx_tx_qdesc_vlantci_create; + efx_tx_qdestroy; + efx_tx_qenable; + efx_tx_qflush; + efx_tx_qpace; + efx_tx_qpio_disable; + efx_tx_qpio_enable; + efx_tx_qpio_post; + efx_tx_qpio_write; + efx_tx_qpost; + efx_tx_qpush; + efx_txq_nbufs; + efx_txq_size; + + local: *; +}; diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c new file mode 100644 index 0000000000..0b8d5efee9 --- /dev/null +++ b/drivers/common/sfc_efx/sfc_efx.c @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2019 Solarflare Communications Inc. + * + * This software was jointly developed between OKTET Labs (under contract + * for Solarflare) and Solarflare Communications, Inc. + */ + +#include + +#include "sfc_efx_log.h" + +uint32_t sfc_efx_logtype; + +RTE_INIT(sfc_efx_register_logtype) +{ + int ret; + + ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx", + RTE_LOG_NOTICE); + sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret; +} diff --git a/drivers/common/sfc_efx/sfc_efx_debug.h b/drivers/common/sfc_efx/sfc_efx_debug.h new file mode 100644 index 0000000000..e0bdeeb5a4 --- /dev/null +++ b/drivers/common/sfc_efx/sfc_efx_debug.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2019 Solarflare Communications Inc. + * + * This software was jointly developed between OKTET Labs (under contract + * for Solarflare) and Solarflare Communications, Inc. + */ + +#ifndef _SFC_EFX_DEBUG_H_ +#define _SFC_EFX_DEBUG_H_ + +#include + +#ifndef RTE_DEBUG_COMMON_SFC_EFX +#define RTE_DEBUG_COMMON_SFC_EFX 0 +#endif + +#ifdef RTE_DEBUG_COMMON_SFC_EFX +/* Avoid dependency from RTE_LOG_DP_LEVEL to be able to enable debug check + * in the driver only. + */ +#define SFC_EFX_ASSERT(exp) RTE_VERIFY(exp) +#else +/* If the driver debug is not enabled, follow DPDK debug/non-debug */ +#define SFC_EFX_ASSERT(exp) RTE_ASSERT(exp) +#endif + +#endif /* _SFC_EFX_DEBUG_H_ */ diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h new file mode 100644 index 0000000000..f4417ffc30 --- /dev/null +++ b/drivers/common/sfc_efx/sfc_efx_log.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2019 Solarflare Communications Inc. + * + * This software was jointly developed between OKTET Labs (under contract + * for Solarflare) and Solarflare Communications, Inc. + */ + +#ifndef _SFC_EFX_LOG_H_ +#define _SFC_EFX_LOG_H_ + +/** Generic driver log type */ +extern uint32_t sfc_efx_logtype; + +/** Log message, add a prefix and a line break */ +#define SFC_EFX_LOG(level, ...) \ + rte_log(RTE_LOG_ ## level, sfc_efx_logtype, \ + RTE_FMT("sfc_efx: " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \ + RTE_FMT_TAIL(__VA_ARGS__ ,))) + +#endif /* _SFC_EFX_LOG_H_ */ diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build index 35c05ac1dd..26f0323738 100644 --- a/drivers/net/sfc/meson.build +++ b/drivers/net/sfc/meson.build @@ -33,9 +33,7 @@ foreach flag: extra_flags endif endforeach -subdir('base') -objs = [base_objs] - +deps += ['common_sfc_efx'] sources = files( 'sfc_ethdev.c', 'sfc_kvargs.c', @@ -54,5 +52,3 @@ sources = files( 'sfc_ef10_essb_rx.c', 'sfc_ef10_tx.c' ) - -includes += include_directories('base') -- 2.20.1