@@ -872,6 +872,7 @@ F: doc/guides/nics/features/qede*.ini
Solarflare sfc_efx
M: Andrew Rybchenko <arybchenko@solarflare.com>
+F: drivers/common/sfc_efx/
F: drivers/net/sfc/
F: doc/guides/nics/sfc_efx.rst
F: doc/guides/nics/features/sfc_efx.ini
@@ -36,4 +36,8 @@ ifneq (,$(findstring y,$(IAVF-y)))
DIRS-y += iavf
endif
+ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD)),y)
+DIRS-y += sfc_efx
+endif
+
include $(RTE_SDK)/mk/rte.subdir.mk
@@ -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@'
new file mode 100644
@@ -0,0 +1,111 @@
+# 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_common_sfc_efx.a
+
+CFLAGS += -I$(SRCDIR)/base/
+CFLAGS += -I$(SRCDIR)
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+# Enable extra warnings
+CFLAGS += -Wextra
+
+# More warnings not enabled by above aggregators
+CFLAGS += -Wdisabled-optimization
+
+# Extra CFLAGS for base driver files
+CFLAGS_BASE_DRIVER += -Wno-sign-compare
+CFLAGS_BASE_DRIVER += -Wno-unused-parameter
+CFLAGS_BASE_DRIVER += -Wno-unused-variable
+
+# Compiler and version dependent flags
+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
+CFLAGS += -Waggregate-return
+CFLAGS += -Wnested-externs
+CFLAGS_BASE_DRIVER += -Wno-empty-body
+CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS += -Waggregate-return
+CFLAGS += -Wbad-function-cast
+CFLAGS_BASE_DRIVER += -Wno-empty-body
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
+CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
+endif
+LDLIBS += -lrte_eal
+
+#
+# List of base driver object files for which
+# special CFLAGS above should be applied
+#
+BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))))
+$(foreach obj, $(BASE_DRIVER_OBJS), \
+ $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
+
+EXPORT_MAP := rte_common_sfc_efx_version.map
+
+#
+# all source are stored in SRCS-y
+#
+
+SRCS-y += sfc_efx.c
+
+VPATH += $(SRCDIR)/base
+
+SRCS-y += efx_bootcfg.c
+SRCS-y += efx_crc32.c
+SRCS-y += efx_ev.c
+SRCS-y += efx_evb.c
+SRCS-y += efx_filter.c
+SRCS-y += efx_hash.c
+SRCS-y += efx_intr.c
+SRCS-y += efx_lic.c
+SRCS-y += efx_mac.c
+SRCS-y += efx_mcdi.c
+SRCS-y += efx_mon.c
+SRCS-y += efx_nic.c
+SRCS-y += efx_nvram.c
+SRCS-y += efx_phy.c
+SRCS-y += efx_port.c
+SRCS-y += efx_proxy.c
+SRCS-y += efx_rx.c
+SRCS-y += efx_sram.c
+SRCS-y += efx_tunnel.c
+SRCS-y += efx_tx.c
+SRCS-y += efx_vpd.c
+SRCS-y += mcdi_mon.c
+SRCS-y += siena_mac.c
+SRCS-y += siena_mcdi.c
+SRCS-y += siena_nic.c
+SRCS-y += siena_nvram.c
+SRCS-y += siena_phy.c
+SRCS-y += siena_sram.c
+SRCS-y += siena_vpd.c
+SRCS-y += ef10_ev.c
+SRCS-y += ef10_evb.c
+SRCS-y += ef10_filter.c
+SRCS-y += ef10_intr.c
+SRCS-y += ef10_image.c
+SRCS-y += ef10_mac.c
+SRCS-y += ef10_mcdi.c
+SRCS-y += ef10_nic.c
+SRCS-y += ef10_nvram.c
+SRCS-y += ef10_phy.c
+SRCS-y += ef10_proxy.c
+SRCS-y += ef10_rx.c
+SRCS-y += ef10_tx.c
+SRCS-y += ef10_vpd.c
+SRCS-y += hunt_nic.c
+SRCS-y += medford_nic.c
+SRCS-y += medford2_nic.c
+
+include $(RTE_SDK)/mk/rte.lib.mk
similarity index 100%
rename from drivers/net/sfc/base/README
rename to drivers/common/sfc_efx/base/README
similarity index 100%
rename from drivers/net/sfc/base/ef10_ev.c
rename to drivers/common/sfc_efx/base/ef10_ev.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_evb.c
rename to drivers/common/sfc_efx/base/ef10_evb.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_filter.c
rename to drivers/common/sfc_efx/base/ef10_filter.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_firmware_ids.h
rename to drivers/common/sfc_efx/base/ef10_firmware_ids.h
similarity index 100%
rename from drivers/net/sfc/base/ef10_image.c
rename to drivers/common/sfc_efx/base/ef10_image.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_impl.h
rename to drivers/common/sfc_efx/base/ef10_impl.h
similarity index 100%
rename from drivers/net/sfc/base/ef10_intr.c
rename to drivers/common/sfc_efx/base/ef10_intr.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_mac.c
rename to drivers/common/sfc_efx/base/ef10_mac.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_mcdi.c
rename to drivers/common/sfc_efx/base/ef10_mcdi.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_nic.c
rename to drivers/common/sfc_efx/base/ef10_nic.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_nvram.c
rename to drivers/common/sfc_efx/base/ef10_nvram.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_phy.c
rename to drivers/common/sfc_efx/base/ef10_phy.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_proxy.c
rename to drivers/common/sfc_efx/base/ef10_proxy.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_rx.c
rename to drivers/common/sfc_efx/base/ef10_rx.c
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
similarity index 100%
rename from drivers/net/sfc/base/ef10_tlv_layout.h
rename to drivers/common/sfc_efx/base/ef10_tlv_layout.h
similarity index 100%
rename from drivers/net/sfc/base/ef10_tx.c
rename to drivers/common/sfc_efx/base/ef10_tx.c
similarity index 100%
rename from drivers/net/sfc/base/ef10_vpd.c
rename to drivers/common/sfc_efx/base/ef10_vpd.c
similarity index 100%
rename from drivers/net/sfc/base/efx.h
rename to drivers/common/sfc_efx/base/efx.h
similarity index 100%
rename from drivers/net/sfc/base/efx_annote.h
rename to drivers/common/sfc_efx/base/efx_annote.h
similarity index 100%
rename from drivers/net/sfc/base/efx_bootcfg.c
rename to drivers/common/sfc_efx/base/efx_bootcfg.c
similarity index 100%
rename from drivers/net/sfc/base/efx_check.h
rename to drivers/common/sfc_efx/base/efx_check.h
similarity index 100%
rename from drivers/net/sfc/base/efx_crc32.c
rename to drivers/common/sfc_efx/base/efx_crc32.c
similarity index 100%
rename from drivers/net/sfc/base/efx_ev.c
rename to drivers/common/sfc_efx/base/efx_ev.c
similarity index 100%
rename from drivers/net/sfc/base/efx_evb.c
rename to drivers/common/sfc_efx/base/efx_evb.c
similarity index 100%
rename from drivers/net/sfc/base/efx_filter.c
rename to drivers/common/sfc_efx/base/efx_filter.c
similarity index 100%
rename from drivers/net/sfc/base/efx_hash.c
rename to drivers/common/sfc_efx/base/efx_hash.c
similarity index 100%
rename from drivers/net/sfc/base/efx_impl.h
rename to drivers/common/sfc_efx/base/efx_impl.h
similarity index 100%
rename from drivers/net/sfc/base/efx_intr.c
rename to drivers/common/sfc_efx/base/efx_intr.c
similarity index 100%
rename from drivers/net/sfc/base/efx_lic.c
rename to drivers/common/sfc_efx/base/efx_lic.c
similarity index 100%
rename from drivers/net/sfc/base/efx_mac.c
rename to drivers/common/sfc_efx/base/efx_mac.c
similarity index 100%
rename from drivers/net/sfc/base/efx_mcdi.c
rename to drivers/common/sfc_efx/base/efx_mcdi.c
similarity index 100%
rename from drivers/net/sfc/base/efx_mcdi.h
rename to drivers/common/sfc_efx/base/efx_mcdi.h
similarity index 100%
rename from drivers/net/sfc/base/efx_mon.c
rename to drivers/common/sfc_efx/base/efx_mon.c
similarity index 100%
rename from drivers/net/sfc/base/efx_nic.c
rename to drivers/common/sfc_efx/base/efx_nic.c
similarity index 100%
rename from drivers/net/sfc/base/efx_nvram.c
rename to drivers/common/sfc_efx/base/efx_nvram.c
similarity index 100%
rename from drivers/net/sfc/base/efx_phy.c
rename to drivers/common/sfc_efx/base/efx_phy.c
similarity index 100%
rename from drivers/net/sfc/base/efx_phy_ids.h
rename to drivers/common/sfc_efx/base/efx_phy_ids.h
similarity index 100%
rename from drivers/net/sfc/base/efx_port.c
rename to drivers/common/sfc_efx/base/efx_port.c
similarity index 100%
rename from drivers/net/sfc/base/efx_proxy.c
rename to drivers/common/sfc_efx/base/efx_proxy.c
similarity index 100%
rename from drivers/net/sfc/base/efx_regs.h
rename to drivers/common/sfc_efx/base/efx_regs.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
similarity index 100%
rename from drivers/net/sfc/base/efx_regs_mcdi.h
rename to drivers/common/sfc_efx/base/efx_regs_mcdi.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
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
similarity index 100%
rename from drivers/net/sfc/base/efx_regs_pci.h
rename to drivers/common/sfc_efx/base/efx_regs_pci.h
similarity index 100%
rename from drivers/net/sfc/base/efx_rx.c
rename to drivers/common/sfc_efx/base/efx_rx.c
similarity index 100%
rename from drivers/net/sfc/base/efx_sram.c
rename to drivers/common/sfc_efx/base/efx_sram.c
similarity index 100%
rename from drivers/net/sfc/base/efx_tunnel.c
rename to drivers/common/sfc_efx/base/efx_tunnel.c
similarity index 100%
rename from drivers/net/sfc/base/efx_tx.c
rename to drivers/common/sfc_efx/base/efx_tx.c
similarity index 100%
rename from drivers/net/sfc/base/efx_types.h
rename to drivers/common/sfc_efx/base/efx_types.h
similarity index 100%
rename from drivers/net/sfc/base/efx_vpd.c
rename to drivers/common/sfc_efx/base/efx_vpd.c
similarity index 100%
rename from drivers/net/sfc/base/hunt_impl.h
rename to drivers/common/sfc_efx/base/hunt_impl.h
similarity index 100%
rename from drivers/net/sfc/base/hunt_nic.c
rename to drivers/common/sfc_efx/base/hunt_nic.c
similarity index 100%
rename from drivers/net/sfc/base/mcdi_mon.c
rename to drivers/common/sfc_efx/base/mcdi_mon.c
similarity index 100%
rename from drivers/net/sfc/base/mcdi_mon.h
rename to drivers/common/sfc_efx/base/mcdi_mon.h
similarity index 100%
rename from drivers/net/sfc/base/medford2_impl.h
rename to drivers/common/sfc_efx/base/medford2_impl.h
similarity index 100%
rename from drivers/net/sfc/base/medford2_nic.c
rename to drivers/common/sfc_efx/base/medford2_nic.c
similarity index 100%
rename from drivers/net/sfc/base/medford_impl.h
rename to drivers/common/sfc_efx/base/medford_impl.h
similarity index 100%
rename from drivers/net/sfc/base/medford_nic.c
rename to drivers/common/sfc_efx/base/medford_nic.c
similarity index 100%
rename from drivers/net/sfc/base/meson.build
rename to drivers/common/sfc_efx/base/meson.build
similarity index 100%
rename from drivers/net/sfc/base/siena_flash.h
rename to drivers/common/sfc_efx/base/siena_flash.h
similarity index 100%
rename from drivers/net/sfc/base/siena_impl.h
rename to drivers/common/sfc_efx/base/siena_impl.h
similarity index 100%
rename from drivers/net/sfc/base/siena_mac.c
rename to drivers/common/sfc_efx/base/siena_mac.c
similarity index 100%
rename from drivers/net/sfc/base/siena_mcdi.c
rename to drivers/common/sfc_efx/base/siena_mcdi.c
similarity index 100%
rename from drivers/net/sfc/base/siena_nic.c
rename to drivers/common/sfc_efx/base/siena_nic.c
similarity index 100%
rename from drivers/net/sfc/base/siena_nvram.c
rename to drivers/common/sfc_efx/base/siena_nvram.c
similarity index 100%
rename from drivers/net/sfc/base/siena_phy.c
rename to drivers/common/sfc_efx/base/siena_phy.c
similarity index 100%
rename from drivers/net/sfc/base/siena_sram.c
rename to drivers/common/sfc_efx/base/siena_sram.c
similarity index 100%
rename from drivers/net/sfc/base/siena_vpd.c
rename to drivers/common/sfc_efx/base/siena_vpd.c
similarity index 93%
rename from drivers/net/sfc/efsys.h
rename to drivers/common/sfc_efx/efsys.h
@@ -25,8 +25,8 @@
#include <rte_log.h>
#include <rte_io.h>
-#include "sfc_debug.h"
-#include "sfc_log.h"
+#include "sfc_efx_debug.h"
+#include "sfc_efx_log.h"
#ifdef __cplusplus
extern "C" {
@@ -224,8 +224,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]; \
@@ -242,8 +242,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]; \
@@ -261,8 +261,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]; \
@@ -283,8 +283,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]); \
@@ -301,8 +301,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], \
@@ -320,8 +320,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), \
@@ -386,8 +386,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); \
@@ -411,8 +411,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); \
\
@@ -434,8 +434,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) \
@@ -465,8 +465,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) \
@@ -491,8 +491,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); \
\
@@ -526,8 +526,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) \
@@ -625,7 +625,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;
@@ -640,7 +640,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)
@@ -697,7 +697,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)
new file mode 100644
@@ -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')
new file mode 100644
@@ -0,0 +1,122 @@
+DPDK_21 {
+ global:
+
+ efx_ev_fini;
+ efx_ev_init;
+ efx_ev_qcreate;
+ efx_ev_qdestroy;
+ efx_ev_qpoll;
+ efx_ev_qprime;
+
+ efx_evb_fini;
+ efx_evb_init;
+ efx_evb_vswitch_create;
+ efx_evb_vswitch_destroy;
+ efx_evq_size;
+
+ efx_family;
+
+ efx_filter_fini;
+ efx_filter_init;
+ efx_filter_insert;
+ efx_filter_remove;
+ efx_filter_supported_filters;
+
+ efx_intr_disable;
+ efx_intr_enable;
+ efx_intr_fatal;
+ efx_intr_fini;
+ efx_intr_init;
+ efx_intr_status_line;
+ efx_intr_status_message;
+
+ 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_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_mcdi_fini;
+ efx_mcdi_get_proxy_handle;
+ efx_mcdi_init;
+ efx_mcdi_new_epoch;
+ efx_mcdi_request_abort;
+ efx_mcdi_request_poll;
+ efx_mcdi_request_start;
+
+ efx_nic_cfg_get;
+ efx_nic_create;
+ efx_nic_destroy;
+ efx_nic_fini;
+ efx_nic_get_fw_subvariant;
+ efx_nic_get_fw_version;
+ efx_nic_get_vi_pool;
+ efx_nic_init;
+ efx_nic_probe;
+ efx_nic_reset;
+ efx_nic_set_drv_limits;
+ efx_nic_set_fw_subvariant;
+ efx_nic_unprobe;
+
+ efx_phy_adv_cap_get;
+ efx_phy_adv_cap_set;
+
+ 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_size;
+
+ 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_dma_create;
+ efx_tx_qdesc_post;
+ efx_tx_qdesc_tso2_create;
+ efx_tx_qdesc_vlantci_create;
+ efx_tx_qdestroy;
+ efx_tx_qenable;
+ efx_tx_qflush;
+ efx_tx_qpush;
+ efx_txq_size;
+
+ local: *;
+};
new file mode 100644
@@ -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 <rte_log.h>
+
+#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;
+}
new file mode 100644
@@ -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 <rte_debug.h>
+
+#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_ */
new file mode 100644
@@ -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_ */
@@ -13,7 +13,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_sfc_efx.a
-CFLAGS += -I$(SRCDIR)/base/
+CFLAGS += -I$(RTE_SDK)/drivers/common/sfc_efx/base
+CFLAGS += -I$(RTE_SDK)/drivers/common/sfc_efx
CFLAGS += -I$(SRCDIR)
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
@@ -26,39 +27,23 @@ CFLAGS += -Wextra
# More warnings not enabled by above aggregators
CFLAGS += -Wdisabled-optimization
-# Extra CFLAGS for base driver files
-CFLAGS_BASE_DRIVER += -Wno-sign-compare
-CFLAGS_BASE_DRIVER += -Wno-unused-parameter
-CFLAGS_BASE_DRIVER += -Wno-unused-variable
-
# Compiler and version dependent flags
ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
CFLAGS += -Waggregate-return
CFLAGS += -Wnested-externs
-CFLAGS_BASE_DRIVER += -Wno-empty-body
-CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
CFLAGS += -Waggregate-return
CFLAGS += -Wbad-function-cast
-CFLAGS_BASE_DRIVER += -Wno-empty-body
else ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
-CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
# Suppress ICC false positive warning on 'bulk' may be used before its
# value is set
CFLAGS_sfc_ef10_tx.o += -diag-disable 3656
endif
+LDLIBS += -lrte_common_sfc_efx
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
LDLIBS += -lrte_bus_pci -lrte_pci
-#
-# List of base driver object files for which
-# special CFLAGS above should be applied
-#
-BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))))
-$(foreach obj, $(BASE_DRIVER_OBJS), \
- $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
-
EXPORT_MAP := rte_pmd_sfc_version.map
#
@@ -81,53 +66,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_ef10_rx.c
SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_ef10_essb_rx.c
SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc_ef10_tx.c
-VPATH += $(SRCDIR)/base
-
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_bootcfg.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_crc32.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_ev.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_evb.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_filter.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_hash.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_intr.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_lic.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_mac.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_mcdi.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_mon.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_nic.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_nvram.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_phy.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_port.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_proxy.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_rx.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_sram.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_tunnel.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_tx.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += efx_vpd.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += mcdi_mon.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_mac.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_mcdi.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_nic.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_nvram.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_phy.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_sram.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += siena_vpd.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_ev.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_evb.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_filter.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_intr.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_image.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_mac.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_mcdi.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_nic.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_nvram.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_phy.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_proxy.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_rx.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_tx.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += ef10_vpd.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += hunt_nic.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += medford_nic.c
-SRCS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += medford2_nic.c
-
include $(RTE_SDK)/mk/rte.lib.mk
@@ -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')
@@ -234,6 +234,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += -lrte_pmd_softnic
endif
_LDLIBS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += -lrte_pmd_sfc_efx
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += -lrte_common_sfc_efx
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2 -lsze2
_LDLIBS-$(CONFIG_RTE_LIBRTE_NFB_PMD) += -lrte_pmd_nfb
_LDLIBS-$(CONFIG_RTE_LIBRTE_NFB_PMD) += $(shell command -v pkg-config > /dev/null 2>&1 && pkg-config --libs netcope-common)