From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 0CF501B5F5 for ; Fri, 26 Apr 2019 07:15:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 22:15:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,396,1549958400"; d="scan'208";a="319108859" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by orsmga005.jf.intel.com with ESMTP; 25 Apr 2019 22:15:41 -0700 From: Xiaolong Ye To: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon Cc: Xiaolong Ye Date: Fri, 26 Apr 2019 13:09:12 +0800 Message-Id: <20190426050912.109813-3-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426050912.109813-1-xiaolong.ye@intel.com> References: <20190426050912.109813-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH v1 2/2] net/af_xdp: set MAC addrs field to NULL 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: Fri, 26 Apr 2019 05:15:43 -0000 As af_xdp pmd doesn't allocate MAC addresses dynamically, it needs to be set as NULL, so it won't be released by rte_eth_dev_release_port(), otherwise, there would be "EAL: Error: Invalid memory" error. Signed-off-by: Xiaolong Ye --- drivers/net/af_xdp/rte_eth_af_xdp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index a12551cbf..f659c0496 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -458,6 +458,12 @@ eth_dev_close(struct rte_eth_dev *dev) (void)xsk_umem__delete(internals->umem->umem); + /* + * MAC is not allocated dynamically, setting it to NULL would prevent + * from releasing it in rte_eth_dev_release_port. + */ + dev->data->mac_addrs = NULL; + xdp_umem_destroy(internals->umem); remove_xdp_program(internals); -- 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 69B00A05D3 for ; Fri, 26 Apr 2019 07:15:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B19061B5FB; Fri, 26 Apr 2019 07:15:47 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 0CF501B5F5 for ; Fri, 26 Apr 2019 07:15:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 22:15:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,396,1549958400"; d="scan'208";a="319108859" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by orsmga005.jf.intel.com with ESMTP; 25 Apr 2019 22:15:41 -0700 From: Xiaolong Ye To: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon Cc: Xiaolong Ye Date: Fri, 26 Apr 2019 13:09:12 +0800 Message-Id: <20190426050912.109813-3-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426050912.109813-1-xiaolong.ye@intel.com> References: <20190426050912.109813-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH v1 2/2] net/af_xdp: set MAC addrs field to NULL 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: <20190426050912.gziQ3XYNptiEERo2gARiRLsYrsB_o4d-udxt1fVxhgo@z> As af_xdp pmd doesn't allocate MAC addresses dynamically, it needs to be set as NULL, so it won't be released by rte_eth_dev_release_port(), otherwise, there would be "EAL: Error: Invalid memory" error. Signed-off-by: Xiaolong Ye --- drivers/net/af_xdp/rte_eth_af_xdp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index a12551cbf..f659c0496 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -458,6 +458,12 @@ eth_dev_close(struct rte_eth_dev *dev) (void)xsk_umem__delete(internals->umem->umem); + /* + * MAC is not allocated dynamically, setting it to NULL would prevent + * from releasing it in rte_eth_dev_release_port. + */ + dev->data->mac_addrs = NULL; + xdp_umem_destroy(internals->umem); remove_xdp_program(internals); -- 2.17.1