DPDK patches and discussions
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev <dev@dpdk.org>, Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Subject: Re: [dpdk-dev] [PATCH 5/8] net/bnxt: add a null ptr check in bnxt PCI probe
Date: Fri, 25 Sep 2020 07:34:40 +0530	[thread overview]
Message-ID: <CAOBf=mtpMe-tCwoSRG3S6K2U1eD7hQK_1F-ohY385+_YJcuDCw@mail.gmail.com> (raw)
In-Reply-To: <fceb577e-3eda-f9e4-3b92-b67a1cb06319@intel.com>

On Thu, Sep 24, 2020 at 8:17 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 9/22/2020 8:06 AM, Somnath Kotur wrote:
> > Check for devargs before invoking rep port probe.
> >
> > Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
> >
> > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
> > ---
> >   drivers/net/bnxt/bnxt_ethdev.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> > index db2f0dd..84eba0b 100644
> > --- a/drivers/net/bnxt/bnxt_ethdev.c
> > +++ b/drivers/net/bnxt/bnxt_ethdev.c
> > @@ -6147,6 +6147,10 @@ static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
> >       }
> >       PMD_DRV_LOG(DEBUG, "BNXT Port:%d pci probe\n",
> >                   backing_eth_dev->data->port_id);
> > +
> > +     if (!pci_dev->device.devargs)
> > +             return ret;
> > +
>
> There is already a null check at the beginning of the function because
> of the same thing (port representors), should they be combined?
>
No, this is to catch the corner case if/when 'backing_eth_dev' is
already allocated , so code would unconditionally call
bnxt_rep_port_probe()
irrespective of devargs being there or not, the check at this point
helps prevent that
> And devargs being not NULL does not really mean it has arguments related
> to the port representors, it may have other device devargs. Perhaps
> 'eth_da' can  be used to check?
eth_da is a local var in this function, so perhaps 'num_rep' i.e
invoke bnxt_rep_port_probe only if num_rep > 0 ?
Please let me know if you want me to do a respin of this patch alone
or will you be doing this minor change while merging it in?

Thanks
Som

  reply	other threads:[~2020-09-25  2:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  7:06 [dpdk-dev] [PATCH 0/8] bnxt patches Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 1/8] net/bnxt: add support for decap action for ipv6 VXLAN flows Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 2/8] net/bnxt: simplify representor Rx ring creation Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 3/8] net/bnxt: fix to correct bad shift operation Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 4/8] net/bnxt: fix to honor value passed for truflow devargs Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 5/8] net/bnxt: add a null ptr check in bnxt PCI probe Somnath Kotur
2020-09-24 14:47   ` Ferruh Yigit
2020-09-25  2:04     ` Somnath Kotur [this message]
2020-09-25  8:42       ` Ferruh Yigit
2020-09-25 10:46         ` Somnath Kotur
2020-09-25 10:49           ` Somnath Kotur
2020-09-25 10:40   ` [dpdk-dev] [PATCH v2] net/bnxt: add a " Somnath Kotur
2020-09-25 11:56     ` Ferruh Yigit
2020-09-22  7:06 ` [dpdk-dev] [PATCH 6/8] net/bnxt: support for representors on remote host domain Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 7/8] net/bnxt: fix flow match to ignore pkt type Somnath Kotur
2020-09-22  7:06 ` [dpdk-dev] [PATCH 8/8] net/bnxt: fix seg fault during NAT configuration Somnath Kotur
2020-09-23 23:50 ` [dpdk-dev] [PATCH 0/8] bnxt patches Ajit Khaparde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOBf=mtpMe-tCwoSRG3S6K2U1eD7hQK_1F-ohY385+_YJcuDCw@mail.gmail.com' \
    --to=somnath.kotur@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=venkatkumar.duvvuru@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).