From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7374F1B732 for ; Sun, 24 Mar 2019 12:57:09 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2019 04:57:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="157917989" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga001.fm.intel.com with ESMTP; 24 Mar 2019 04:57:08 -0700 Date: Sun, 24 Mar 2019 19:52:55 +0800 From: Ye Xiaolong To: Maxime Coquelin Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn Message-ID: <20190324115255.GA29795@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190322130129.109964-1-xiaolong.ye@intel.com> <20190322130129.109964-5-xiaolong.ye@intel.com> <0dd90e3f-8412-4508-8056-35ad0a3e5e8d@redhat.com> <20190324090803.GA22909@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190324090803.GA22909@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v4 4/5] net/af_xdp: use mbuf mempool for buffer management 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: Sun, 24 Mar 2019 11:57:10 -0000 On 03/24, Ye Xiaolong wrote: >>> - ret = xsk_umem__create(&umem->umem, bufs, >>> + ret = xsk_umem__create(&umem->umem, base_addr, >>> ETH_AF_XDP_NUM_BUFFERS * ETH_AF_XDP_FRAME_SIZE, >>> &umem->fq, &umem->cq, >>> &usr_config); >>> @@ -499,7 +527,7 @@ static struct xsk_umem_info *xdp_umem_configure(void) >>> AF_XDP_LOG(ERR, "Failed to create umem"); >>> goto err; >> >>You need to destroy mb_pool if xsk_umem__create() fails. > >Will do. Correction, mp_pool destrcttion has alrealy been hanled in xdp_umem_destory. Thanks, Xiaolong > >Thanks, >Xiaolong >> >>> } >>> - umem->buffer = bufs; >>> + umem->buffer = base_addr; >>> return umem; >>> @@ -912,10 +940,9 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev) >>> internals = eth_dev->data->dev_private; >>> - rte_ring_free(internals->umem->buf_ring); >>> - rte_free(internals->umem->buffer); >>> rte_free(internals->umem); >>> + rte_mempool_free(internals->umem->mb_pool); >>> rte_eth_dev_release_port(eth_dev); >>> 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 CFE5AA05D3 for ; Sun, 24 Mar 2019 12:57:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A88F21B7D9; Sun, 24 Mar 2019 12:57:12 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7374F1B732 for ; Sun, 24 Mar 2019 12:57:09 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Mar 2019 04:57:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,256,1549958400"; d="scan'208";a="157917989" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga001.fm.intel.com with ESMTP; 24 Mar 2019 04:57:08 -0700 Date: Sun, 24 Mar 2019 19:52:55 +0800 From: Ye Xiaolong To: Maxime Coquelin Cc: dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn Message-ID: <20190324115255.GA29795@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190322130129.109964-1-xiaolong.ye@intel.com> <20190322130129.109964-5-xiaolong.ye@intel.com> <0dd90e3f-8412-4508-8056-35ad0a3e5e8d@redhat.com> <20190324090803.GA22909@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <20190324090803.GA22909@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v4 4/5] net/af_xdp: use mbuf mempool for buffer management 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" Message-ID: <20190324115255.2nSMYAzZndWEw-4F1iRUaKxXXn14orqGRXRZdWu8m6Y@z> On 03/24, Ye Xiaolong wrote: >>> - ret = xsk_umem__create(&umem->umem, bufs, >>> + ret = xsk_umem__create(&umem->umem, base_addr, >>> ETH_AF_XDP_NUM_BUFFERS * ETH_AF_XDP_FRAME_SIZE, >>> &umem->fq, &umem->cq, >>> &usr_config); >>> @@ -499,7 +527,7 @@ static struct xsk_umem_info *xdp_umem_configure(void) >>> AF_XDP_LOG(ERR, "Failed to create umem"); >>> goto err; >> >>You need to destroy mb_pool if xsk_umem__create() fails. > >Will do. Correction, mp_pool destrcttion has alrealy been hanled in xdp_umem_destory. Thanks, Xiaolong > >Thanks, >Xiaolong >> >>> } >>> - umem->buffer = bufs; >>> + umem->buffer = base_addr; >>> return umem; >>> @@ -912,10 +940,9 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev) >>> internals = eth_dev->data->dev_private; >>> - rte_ring_free(internals->umem->buf_ring); >>> - rte_free(internals->umem->buffer); >>> rte_free(internals->umem); >>> + rte_mempool_free(internals->umem->mb_pool); >>> rte_eth_dev_release_port(eth_dev); >>>