From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <xiaolong.ye@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 259E37CCA
 for <dev@dpdk.org>; Tue, 30 Apr 2019 04:10:43 +0200 (CEST)
X-Amp-Result: UNSCANNABLE
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 Apr 2019 19:10:42 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,412,1549958400"; d="scan'208";a="153439236"
Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206])
 by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2019 19:10:41 -0700
Date: Tue, 30 Apr 2019 10:04:09 +0800
From: Ye Xiaolong <xiaolong.ye@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Message-ID: <20190430020409.GA37233@intel.com>
References: <20190426050912.109813-1-xiaolong.ye@intel.com>
 <20190426050912.109813-3-xiaolong.ye@intel.com>
 <7c41c899-a70c-36d5-19c4-f2280210262e@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <7c41c899-a70c-36d5-19c4-f2280210262e@intel.com>
User-Agent: Mutt/1.9.4 (2018-02-28)
Subject: Re: [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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Apr 2019 02:10:44 -0000

On 04/29, Ferruh Yigit wrote:
>On 4/26/2019 6:09 AM, Xiaolong Ye wrote:
>> 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 <xiaolong.ye@intel.com>
>> ---
>>  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);
>> 
>
>Keeping this patch in separate patch will cause the above error after first
>patch, what do you think merging this with prev patch?

Make sence, will squash it into first patch.

Thanks,
Xiaolong

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id D15BCA0679
	for <public@inbox.dpdk.org>; Tue, 30 Apr 2019 04:10:47 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 38C9D7CDA;
	Tue, 30 Apr 2019 04:10:46 +0200 (CEST)
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 259E37CCA
 for <dev@dpdk.org>; Tue, 30 Apr 2019 04:10:43 +0200 (CEST)
X-Amp-Result: UNSCANNABLE
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 Apr 2019 19:10:42 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,412,1549958400"; d="scan'208";a="153439236"
Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206])
 by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2019 19:10:41 -0700
Date: Tue, 30 Apr 2019 10:04:09 +0800
From: Ye Xiaolong <xiaolong.ye@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Message-ID: <20190430020409.GA37233@intel.com>
References: <20190426050912.109813-1-xiaolong.ye@intel.com>
 <20190426050912.109813-3-xiaolong.ye@intel.com>
 <7c41c899-a70c-36d5-19c4-f2280210262e@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
In-Reply-To: <7c41c899-a70c-36d5-19c4-f2280210262e@intel.com>
User-Agent: Mutt/1.9.4 (2018-02-28)
Subject: Re: [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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190430020409.owuQZIG8N2IHosjt5JugfenwOWSFu6EYngyRUpxZJV4@z>

On 04/29, Ferruh Yigit wrote:
>On 4/26/2019 6:09 AM, Xiaolong Ye wrote:
>> 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 <xiaolong.ye@intel.com>
>> ---
>>  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);
>> 
>
>Keeping this patch in separate patch will cause the above error after first
>patch, what do you think merging this with prev patch?

Make sence, will squash it into first patch.

Thanks,
Xiaolong