From patchwork Tue Sep 8 09:14:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 76897 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B1E1A04AA; Tue, 8 Sep 2020 11:17:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0753C1C1A8; Tue, 8 Sep 2020 11:16:09 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id ABB451C0DB for ; Tue, 8 Sep 2020 11:16:03 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.144]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 51FD420065 for ; Tue, 8 Sep 2020 09:16:03 +0000 (UTC) Received: from us4-mdac16-41.at1.mdlocal (unknown [10.110.48.12]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id B9E3B800EC for ; Tue, 8 Sep 2020 09:16:02 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.12]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id B28BA40131 for ; Tue, 8 Sep 2020 09:14:55 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 2606340062 for ; Tue, 8 Sep 2020 09:14:55 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 8 Sep 2020 10:14:49 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 8 Sep 2020 10:14:49 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 0889EnCb032407 for ; Tue, 8 Sep 2020 10:14:49 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 431FD1613AB for ; Tue, 8 Sep 2020 10:14:49 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 8 Sep 2020 10:14:23 +0100 Message-ID: <1599556475-27820-4-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1599556475-27820-1-git-send-email-arybchenko@solarflare.com> References: <1599556475-27820-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25652.003 X-TM-AS-Result: No-13.911400-8.000000-10 X-TMASE-MatchedRID: CzrRmG7Jh68kVMQcdgU2qW6HurDH4PpP+WsBL5B3ZTHfUZT83lbkED6P hj6DfZCEtZt7pZct9Kv+UA6OdqfdifV+NbN27IZWoprTEHvewAAEa8g1x8eqF1fLpI8fOvDuHfA CHvXeibIHQ6X2WXCI3iU+uzi8gTG2RZJ90/Q8Spmdx4sU8R+eYKld1ZriBTRLGukEjITkpiJdaO 8DxOlYWJgxtRFzQurYRXWLuHFe7bfyNWG6Utfmrz9B1SHosSXQljXTOadSXWkHZBaLwEXlKC2Ng sVnbGZK2B0q6PyRn98sXNQR30ZuabhYaHW9RIv/D3uYMxd01bdDMa/OS9k9gWPK/53RnQ7FXUHY lz+7vydSv1u9wBe+HVS0GixpdR65bOQiEknMHoEgCPGiZqtI8CKpn/iCVxz8KBVvFbsUM5XnDEj LKFGJ49zTdKYcHA6ApxUVxpAT4EFyOVk+FPzL10dwfgSciXneXccelkX/ubBPIi6bm6Wq5oI5IE vkmJtD1UVeRhm40I8HtbigP+IJHx8MyvfwOitdZacDbE73ZSmuWmaqaW5SP8eQfu6iwSfsb7Ah9 7+dVMHE0AQvp+oKYZ3uaNcnu0yTd3WlHgjh+h0h/RMTVV2425wE50C6MzyIrq9Rw9qmVpg56GdZ xUF9VkPZL5UZCKGfuKCwA5lSqrnHPqim4ABQknCO70QAsBdCV9/n5IZng2TmTInKzpSFSYZzi8n 5csaz3HbmaxD3kak7pHnzpyV/bnHxC4bPmCOyalRqQPhHMT66hgVvSdGKo9TSDdVx8njucb0X5x eTKWKng751ZztrlZbybMtrsqDzG86R6Zxt6qaeAiCmPx4NwBnUJ0Ek6yhjxEHRux+uk8jpP8tMO yYmaA== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--13.911400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25652.003 X-MDID: 1599556562-yLOcrAl0dQj4 Subject: [dpdk-dev] [PATCH 02/14] net/sfc: introduce common driver library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- MAINTAINERS | 1 + drivers/common/Makefile | 4 + drivers/common/meson.build | 2 +- drivers/common/sfc_efx/Makefile | 111 ++++++++++++++++ .../{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 | 58 ++++----- drivers/common/sfc_efx/meson.build | 39 ++++++ .../sfc_efx/rte_common_sfc_efx_version.map | 122 ++++++++++++++++++ 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/Makefile | 70 +--------- drivers/net/sfc/meson.build | 6 +- mk/rte.app.mk | 1 + 84 files changed, 386 insertions(+), 102 deletions(-) create mode 100644 drivers/common/sfc_efx/Makefile 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 ed163f5d59..ee20e261d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -872,6 +872,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/Makefile b/drivers/common/Makefile index cfb6b4dc88..378ab4281c 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -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 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/common/sfc_efx/Makefile b/drivers/common/sfc_efx/Makefile new file mode 100644 index 0000000000..0bd6a593e9 --- /dev/null +++ b/drivers/common/sfc_efx/Makefile @@ -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 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 c94e6c0b93..657b45e05d 100644 --- a/drivers/net/sfc/efsys.h +++ b/drivers/common/sfc_efx/efsys.h @@ -25,8 +25,8 @@ #include #include -#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) 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..0c719e8250 --- /dev/null +++ b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map @@ -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: *; +}; 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/Makefile b/drivers/net/sfc/Makefile index 20bf343814..648527f4b8 100644 --- a/drivers/net/sfc/Makefile +++ b/drivers/net/sfc/Makefile @@ -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 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') diff --git a/mk/rte.app.mk b/mk/rte.app.mk index a544259970..d3c165f720 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -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)