From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 863BD1BB86 for ; Thu, 18 Apr 2019 17:26:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 08:26:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,366,1549958400"; d="scan'208";a="224656168" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by orsmga001.jf.intel.com with ESMTP; 18 Apr 2019 08:26:55 -0700 From: Xiaolong Ye To: dev@dpdk.org, Ferruh Yigit Cc: Qi Zhang , Xiaolong Ye Date: Thu, 18 Apr 2019 23:20:56 +0800 Message-Id: <20190418152056.15018-2-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190418152056.15018-1-xiaolong.ye@intel.com> References: <34359a7b-f2c8-81f2-8a49-f1238e8dfbf0@tu-ilmenau.de> <20190418152056.15018-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH v1 2/2] net/af_xdp: name the umem memzone dynamically 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: , X-List-Received-Date: Thu, 18 Apr 2019 15:26:57 -0000 Naming the umem memzone dynamically allows to create multiple af_xdp vdevs. Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") Reported-by: Markus Theil Signed-off-by: Xiaolong Ye --- drivers/net/af_xdp/rte_eth_af_xdp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index d8e99204e..666b4c17e 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -483,6 +483,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals) .frame_size = ETH_AF_XDP_FRAME_SIZE, .frame_headroom = ETH_AF_XDP_DATA_HEADROOM }; char ring_name[RTE_RING_NAMESIZE]; + char mz_name[RTE_MEMZONE_NAMESIZE]; int ret; uint64_t i; @@ -508,7 +509,9 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals) (void *)(i * ETH_AF_XDP_FRAME_SIZE + ETH_AF_XDP_DATA_HEADROOM)); - mz = rte_memzone_reserve_aligned("af_xdp uemem", + ret = snprintf(mz_name, sizeof(mz_name), "af_xdp_umem_%s_%d", + internals->if_name, internals->queue_idx); + mz = rte_memzone_reserve_aligned(mz_name, ETH_AF_XDP_NUM_BUFFERS * ETH_AF_XDP_FRAME_SIZE, rte_socket_id(), RTE_MEMZONE_IOVA_CONTIG, getpagesize()); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 40934A00E6 for ; Thu, 18 Apr 2019 17:27:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FA561BBE6; Thu, 18 Apr 2019 17:27:06 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 863BD1BB86 for ; Thu, 18 Apr 2019 17:26:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 08:26:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,366,1549958400"; d="scan'208";a="224656168" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by orsmga001.jf.intel.com with ESMTP; 18 Apr 2019 08:26:55 -0700 From: Xiaolong Ye To: dev@dpdk.org, Ferruh Yigit Cc: Qi Zhang , Xiaolong Ye Date: Thu, 18 Apr 2019 23:20:56 +0800 Message-Id: <20190418152056.15018-2-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190418152056.15018-1-xiaolong.ye@intel.com> References: <34359a7b-f2c8-81f2-8a49-f1238e8dfbf0@tu-ilmenau.de> <20190418152056.15018-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH v1 2/2] net/af_xdp: name the umem memzone dynamically 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190418152056.drDO90I3CcjpUM2fOrC4EI-KnNVliExWvcef0_itnc8@z> Naming the umem memzone dynamically allows to create multiple af_xdp vdevs. Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") Reported-by: Markus Theil Signed-off-by: Xiaolong Ye --- drivers/net/af_xdp/rte_eth_af_xdp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index d8e99204e..666b4c17e 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -483,6 +483,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals) .frame_size = ETH_AF_XDP_FRAME_SIZE, .frame_headroom = ETH_AF_XDP_DATA_HEADROOM }; char ring_name[RTE_RING_NAMESIZE]; + char mz_name[RTE_MEMZONE_NAMESIZE]; int ret; uint64_t i; @@ -508,7 +509,9 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals) (void *)(i * ETH_AF_XDP_FRAME_SIZE + ETH_AF_XDP_DATA_HEADROOM)); - mz = rte_memzone_reserve_aligned("af_xdp uemem", + ret = snprintf(mz_name, sizeof(mz_name), "af_xdp_umem_%s_%d", + internals->if_name, internals->queue_idx); + mz = rte_memzone_reserve_aligned(mz_name, ETH_AF_XDP_NUM_BUFFERS * ETH_AF_XDP_FRAME_SIZE, rte_socket_id(), RTE_MEMZONE_IOVA_CONTIG, getpagesize()); -- 2.17.1