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 0C43BA04BB; Fri, 25 Sep 2020 04:04:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB6B91DFE2; Fri, 25 Sep 2020 04:04:54 +0200 (CEST) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id E90D91DEEA for ; Fri, 25 Sep 2020 04:04:52 +0200 (CEST) Received: by mail-pj1-f68.google.com with SMTP id b17so995952pji.1 for ; Thu, 24 Sep 2020 19:04:52 -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=7v+gvp/dTctvch4+W1rQvtfJ9Y1HZvGunpiKw/+OoTE=; b=WOx6N+7nN7eGJqTdihyL49p/KsWAufehsactlohh2C19l2t19yryZxdceIpRvtk3Vh a56twl+4RYvuK8raBMtdLxR7tvtOdr5ZR0iUHHmQjODUKV54gy4Db41ga0kKwCb624Iw Vus3u9XZFaNhBl8CCS2CZsZSLo55uz2Qxc0YE= 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=7v+gvp/dTctvch4+W1rQvtfJ9Y1HZvGunpiKw/+OoTE=; b=aToLwfKaAP0tusWFmStRd4luZJWo8JA1oSyzEzvdE2Nd6XwdMLEOdj6Nk3ds5YUR0c N3CTcwiMiygl+7lR4tUDM7sw0+XLKJPF4fvNilpUI1RPryAOtMhYRq1SnNT3n63TAtee Q66yeWwD0r72N9LsnmC6XGvOLLRdx9bU/xVEquvBHXQps8MB0sAuuvAg92dYHn9X/T5j TpmgCdNv5Qq2YVIxrVEV2qup9YTBdWDwaDt7KZslm8GfTCKX58/2FKj6i0+OVIjjT3E8 GPHLXoEZY7b2OfsqhsvYsx4nesm9lOZociQlSHWmkB2rfdGCZk7V3EIOs5rCktxql66h GhfQ== X-Gm-Message-State: AOAM5327+A1pt3E5oAvswUKF4jk7bOSnt9S6sOrvKiYxF3IzdnNd6HXV e6sipmLoU+Ca7NP+wzsojTY5eUDCG9i7USYdfO4Wsg== X-Google-Smtp-Source: ABdhPJxdaCQDf8SPEngLm4pXUlBrYtcKKVrmwjKUomeWlPZhRx24+M9TWI7SOxaSlRCVnh/J1jqBKANvvp9Qp/a27d4= X-Received: by 2002:a17:90a:db56:: with SMTP id u22mr480081pjx.85.1600999491842; Thu, 24 Sep 2020 19:04:51 -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 07:34:40 +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 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 ? 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