From patchwork Mon Oct 21 09:11:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 61570 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B1DB31BE8E; Mon, 21 Oct 2019 11:27:35 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 42D887CCA for ; Mon, 21 Oct 2019 11:27:29 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D36EC2004F4; Mon, 21 Oct 2019 11:27:28 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0ADDC2004F0; Mon, 21 Oct 2019 11:27:27 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3629C402F3; Mon, 21 Oct 2019 17:27:23 +0800 (SGT) From: Gagandeep Singh To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Gagandeep Singh Date: Mon, 21 Oct 2019 14:41:34 +0530 Message-Id: <20191021091134.12850-4-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191021091134.12850-1-g.singh@nxp.com> References: <20191021085831.12397-1-g.singh@nxp.com> <20191021091134.12850-1-g.singh@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 3/3] net/enetc: enable dpaax 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" With this patch, enetc driver would start using the physical-virtual library interfaces. Signed-off-by: Gagandeep Singh --- drivers/net/enetc/Makefile | 2 ++ drivers/net/enetc/enetc_ethdev.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/enetc/Makefile b/drivers/net/enetc/Makefile index 312b37245..4498bc51f 100644 --- a/drivers/net/enetc/Makefile +++ b/drivers/net/enetc/Makefile @@ -10,6 +10,7 @@ LIB = librte_pmd_enetc.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax EXPORT_MAP := rte_pmd_enetc_version.map LIBABIVER := 1 @@ -19,5 +20,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += enetc_rxtx.c LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool LDLIBS += -lrte_ethdev -lrte_net LDLIBS += -lrte_bus_pci +LDLIBS += -lrte_common_dpaax include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index 475ec77c3..03590c6c3 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "enetc_logs.h" #include "enetc.h" @@ -896,6 +897,9 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) eth_dev->data->mtu = RTE_ETHER_MAX_LEN - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN; + if (rte_eal_iova_mode() == RTE_IOVA_PA) + dpaax_iova_table_populate(); + ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x", eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id); @@ -906,6 +910,10 @@ static int enetc_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused) { PMD_INIT_FUNC_TRACE(); + + if (rte_eal_iova_mode() == RTE_IOVA_PA) + dpaax_iova_table_depopulate(); + return 0; }