From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C2C62A04FF; Tue, 14 Jan 2020 15:49:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D9531C037; Tue, 14 Jan 2020 15:49:31 +0100 (CET) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by dpdk.org (Postfix) with ESMTP id 234F11C031 for ; Tue, 14 Jan 2020 15:49:29 +0100 (CET) Received: by mail-vs1-f67.google.com with SMTP id u14so8372800vsu.3 for ; Tue, 14 Jan 2020 06:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Grg+LgPCpX0XaCV04+FgDBnlRTgBOkUV3GWkkuB6lF0=; b=F1dKa0f8ZINHL1hX68gRVCGHi6ekRHFqr1utoYAB2XqScYQbQe8plmZMTBShQFBpQX 2oFYbsuiC+J+wx27+ATQboHcyk0fks9l3iVjSHpPPmnhH9sKtc718kbEh8wCJ83pc1Jw Y57hyatS7ovGtj+izXYH+vXzowKkz9+5dvQVM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Grg+LgPCpX0XaCV04+FgDBnlRTgBOkUV3GWkkuB6lF0=; b=spglfHHy5x0x5W3OeK7ilI5kZqFU8YE2HrV8IEe26O3MlggniH7qA+xc8lHjV2TDj9 GCECHHTlSeyZUpp0aq6M0UkOlWvjWuTNuiZsYnFwUM1mdFh+vs2lvT/dJj+kA+lZFqkA M8wjH9+U9GukEugkgqXyZc3yBOhayMkcZS/gAzx4/EfpvOXuLlSU0uZoSp1e2PizunPK Awf0oYzre5FYWKB83lxLHYhWIcZbENM7mTIhcrlazRTFu75kWVW6cbT10vqd1SCLN9pE yTJTpVm0y7AMowM5tq1/1c2ZmGrxh7NQ/5R9LLjZyZ8kF0jWBJclPvUgQOePYv9cc9V9 +Bhg== X-Gm-Message-State: APjAAAXScf1NpAm7bhkOSl5T8YtgVxcLhRWDny2E1oKryCSKxLRTlfB0 cATkLiIZa/2jPMPoYQM2TcrC4JHEQkoLgrfI9NtY1w== X-Google-Smtp-Source: APXvYqzVC3Q3tfPmrLISCOf/+JhKI5344vqLvOEJxjhHpmG+muXf+IBvKqC5XRfgh+weXyOMBxMAFj+w+bHVPSUcL6s= X-Received: by 2002:a67:b911:: with SMTP id q17mr1586089vsn.230.1579013368377; Tue, 14 Jan 2020 06:49:28 -0800 (PST) MIME-Version: 1.0 References: <20200113050118.28719-1-kalesh-anakkur.purayil@broadcom.com> <20200114051435.46093-1-ajit.khaparde@broadcom.com> <20200114051435.46093-10-ajit.khaparde@broadcom.com> <724362fa-c88f-262b-055c-d117a6aebac6@intel.com> In-Reply-To: <724362fa-c88f-262b-055c-d117a6aebac6@intel.com> From: Somnath Kotur Date: Tue, 14 Jan 2020 20:19:16 +0530 Message-ID: To: Ferruh Yigit Cc: Ajit Khaparde , dev , Kalesh Anakkur Purayil Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 09/10] net/bnxt: release port upon close 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" Ferruh, Will recheck and revert on Thanks Som On Tue, 14 Jan 2020, 18:26 Ferruh Yigit, wrote: > On 1/14/2020 5:14 AM, Ajit Khaparde wrote: > > From: Somnath Kotur > > > > Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the private resources > > for the port can be freed by rte_eth_dev_close(). > > > > Signed-off-by: Somnath Kotur > > Reviewed-by: Kalesh Anakkur Purayil > > > Reviewed-by: Ajit Khaparde > > --- > > drivers/net/bnxt/bnxt_ethdev.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/net/bnxt/bnxt_ethdev.c > b/drivers/net/bnxt/bnxt_ethdev.c > > index ba3f0a7d9..8acfade5f 100644 > > --- a/drivers/net/bnxt/bnxt_ethdev.c > > +++ b/drivers/net/bnxt/bnxt_ethdev.c > > @@ -4856,6 +4856,11 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) > > if (rc) > > goto error_free; > > > > + /* Pass the information to the rte_eth_dev_close() that it should > also > > + * release the private port resources. > > + */ > > + eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; > > + > > When you give this flag, 'rte_eth_dev_close()' will release port > resources, it > will memset the 'eth_dev->data'. > > In case user first closed the port, later removed it, remove path should > be safe > for it. I can see 'bnxt_dev_uninit()' operates on the values of > 'eth_dev->data' > which should crash in this case. > > Can you please double check the return path, all following should be safe: > - close the port > - remove the port > - close and remove the port >