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 9A42EA04C0; Fri, 25 Sep 2020 12:49:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7BCA31E8C5; Fri, 25 Sep 2020 12:49:27 +0200 (CEST) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id 46F1F1D179 for ; Fri, 25 Sep 2020 12:49:26 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id mn7so1553980pjb.5 for ; Fri, 25 Sep 2020 03:49:26 -0700 (PDT) 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=LdN1zDFaqxptNUNEMTtujsfcgvdgzE5nnfo/Mbkg98k=; b=a6BCLZd39/ShwXZ72ygy4A7HLqUCDiv+K2aTrS92pwIf6QjKtvIYalq71XqmB/s3ge +M/MPxZqp9eibj0YCDGmSfdRdE4N5uN1PIAZU89otNcMZQNnKZ6LY5ZllQRwWleMk8zc VJ4dMvCpUeGXYH/xRU3GpM9mhCR+N+PRqKAi8= 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=LdN1zDFaqxptNUNEMTtujsfcgvdgzE5nnfo/Mbkg98k=; b=iij9r93Ne7TzSVnNmnMtT7ogBIwOF50Gw/KB9k0cpRVBcj9wnpnN1rF0S88/hAjC7s FNuK4nqt9dZ571xHcc892A6HWlYSZLQxLJf9ObJ1cRqCziwso0Ux7WiILfFZ7UyOp4G8 LYanQWQI/9iSNswUnkynuXK9iPMTeV2bj/Hu0jldr+jRu1iKPiaCV1aJH8s/fa18IfEQ 890HKOHS8IGRORuoVCMg8OR3sE+diqA5BIX+eu33njuBvbFeokpG3O3wpoMiSNs2bGmA Lr+6ciGW1aWzgGBA5jVCrxuOqRL7h3MgQXPWD+9ZVogcrH/4cb5e6qJHA4pwmZaSY62W fA5Q== X-Gm-Message-State: AOAM532jojokW1hQOeWn5xMol4xAnzqHkS0PuO/afAvUZLCd65ZASDyM B3JMkOe2aTdyV7ykJH1qnfHxuDBWNM3rzw12ZenNvg== X-Google-Smtp-Source: ABdhPJxJGJU8+Xe9NV/G2siGD7/TlfqZawUHBTxDwmAu3IvRr0SX6BL0F5NTgHjiVwBgNKiIRIYbZgYOdnFj3wtaUrw= X-Received: by 2002:a17:90a:bf8c:: with SMTP id d12mr2104597pjs.157.1601030965341; Fri, 25 Sep 2020 03:49:25 -0700 (PDT) MIME-Version: 1.0 References: <20200922070632.17706-1-somnath.kotur@broadcom.com> <20200922070632.17706-6-somnath.kotur@broadcom.com> In-Reply-To: From: Somnath Kotur Date: Fri, 25 Sep 2020 16:19:14 +0530 Message-ID: To: Ferruh Yigit Cc: dev , Venkat Duvvuru Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 5/8] net/bnxt: add a null ptr check in bnxt PCI probe 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" On Fri, Sep 25, 2020 at 4:16 PM Somnath Kotur wrote: > > On Fri, Sep 25, 2020 at 2:12 PM Ferruh Yigit wrote: > > > > On 9/25/2020 3:04 AM, Somnath Kotur wrote: > > > On Thu, Sep 24, 2020 at 8:17 PM Ferruh Yigit 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 > > >>> Reviewed-by: Venkat Duvvuru > > >>> --- > > >>> 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 ? > > > > +1 > > > > > 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? > > > > Please send a new version of this patch alone. Thanks. > Thanks Ferruh, Done Sorry Ferruh, the first one i sent did not have the in-reply-to, re-sent it with the correct in-reply-to format again, so please pick that up Thanks a lot -Som