From patchwork Fri Apr 26 05:09:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaolong Ye X-Patchwork-Id: 53094 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 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" 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);