From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A62EC3064D for ; Tue, 2 Jul 2024 13:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6sQQLIa+NbHko7xpI0TuCmQ8MXvIWKM3U6ppCxEpRw4=; b=nXGGkbNikZvu9uF14FuWE7Zjl0 UupyMkxjb1ZZdsIXo86Z/2MxKHE7bQ3yULTWdAXjsyndGnSlIIcMkWiwbUfBs6pwKYVoD5332czAp 5UajyCKR5wm/+u6/GNgr9y2QOEao3ZykYCubbINzCj8I0W+vfF9+yABUBko/l24wXpeLFYIpqpdAi Uc5yuERbzYXQsLJ6CUD332Qd3CRV1M6n2bmoT4WLe1JtEJWlP9HInVcb7sNkfqehO6uTUJJsJ2sza MDHDkHV1BI/4ybX9IHlsWpQynJxvb7I4LY8Qgrt3LaP0SG18KeXlWo5L9/L5yr5L7tdgl8MhiigXN hyiMLQTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOd7n-00000006lTz-0F6w; Tue, 02 Jul 2024 13:00:47 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOd7Y-00000006lPX-219h for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 13:00:35 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id BB159CE0F47; Tue, 2 Jul 2024 13:00:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 957EAC2BD10; Tue, 2 Jul 2024 13:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719925230; bh=3IcKndPgJRKyDI4uLAvL9dcl2uguX3FJbSHktips0FI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ozESms7CPjBSF7HnyGgtc5BOIx/GdqR1fdGFtQDO8e2pWqvWA3H92MeHHz0lsqsm+ KWf7GUFwobINaivWa2jXhe/rVmBOT8AoUfVKjp7KAsBbwEZcZv56xGsYPbSHNMRmyt kxKgoKLsPKVU0JxTB54QYBeYbmo/xV0GmDcgfKaH03i+BnoGQFONeBS1wdTsUopZph J1+kBPg8oq1Zbv7Hr3xKr7+9Jq5Z3M7bZmuZJRyFL9yBE6wW/k7KJVDxpQspfJeUMl sNBOWdVlTKweq+g/p17iXmK98PgtTP+C4eqLrFg+R7K4663SzUIFoidm4LPPFwd6Em BzBGnQ9P8pvOw== Date: Tue, 2 Jul 2024 14:00:24 +0100 From: Simon Horman To: Peter Yin Cc: patrick@stwcx.xyz, amithash@meta.com, Samuel Mendoza-Jonas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Andrew Jeffery , Cosmo Chou , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: Re: [PATCH v1 1/1] net/ncsi: specify maximum package to probe Message-ID: <20240702130024.GJ598357@kernel.org> References: <20240701154336.3536924-1-peteryin.openbmc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240701154336.3536924-1-peteryin.openbmc@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_060032_899336_A4603C36 X-CRM114-Status: GOOD ( 25.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [ As this seems to relate to: DT, ASPEED and ARM, CC: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Joel Stanley, Andrew Jeffery, devicetree, linux-arm-kernel, linux-aspeed. ] On Mon, Jul 01, 2024 at 11:43:36PM +0800, Peter Yin wrote: > Most NICs have a single package. For OCP3.0 NICs, the package ID is > determined by the slot ID. Probing all 8 package IDs is usually > unnecessary. To reduce probe time, add properties to specify the > maximum number of packages. > > Signed-off-by: Cosmo Chou > Signed-off-by: Peter Yin > --- > net/ncsi/internal.h | 1 + > net/ncsi/ncsi-manage.c | 16 ++++++++++++---- > 2 files changed, 13 insertions(+), 4 deletions(-) > > diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h > index ef0f8f73826f..bd7ad0bf803f 100644 > --- a/net/ncsi/internal.h > +++ b/net/ncsi/internal.h > @@ -341,6 +341,7 @@ struct ncsi_dev_priv { > #define NCSI_MAX_VLAN_VIDS 15 > struct list_head vlan_vids; /* List of active VLAN IDs */ > > + unsigned int max_package; /* Num of packages to probe */ > bool multi_package; /* Enable multiple packages */ > bool mlx_multi_host; /* Enable multi host Mellanox */ > u32 package_whitelist; /* Packages to configure */ > diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c > index 5ecf611c8820..159943ee1317 100644 > --- a/net/ncsi/ncsi-manage.c > +++ b/net/ncsi/ncsi-manage.c > @@ -1358,12 +1358,12 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp) > nd->state = ncsi_dev_state_probe_deselect; > fallthrough; > case ncsi_dev_state_probe_deselect: > - ndp->pending_req_num = 8; > + ndp->pending_req_num = ndp->max_package; > > /* Deselect all possible packages */ > nca.type = NCSI_PKT_CMD_DP; > nca.channel = NCSI_RESERVED_CHANNEL; > - for (index = 0; index < 8; index++) { > + for (index = 0; index < ndp->max_package; index++) { > nca.package = index; > ret = ncsi_xmit_cmd(&nca); > if (ret) > @@ -1491,7 +1491,7 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp) > > /* Probe next package */ > ndp->package_probe_id++; > - if (ndp->package_probe_id >= 8) { > + if (ndp->package_probe_id >= ndp->max_package) { > /* Probe finished */ > ndp->flags |= NCSI_DEV_PROBED; > break; > @@ -1746,7 +1746,7 @@ struct ncsi_dev *ncsi_register_dev(struct net_device *dev, > struct platform_device *pdev; > struct device_node *np; > unsigned long flags; > - int i; > + int i, ret; > > /* Check if the device has been registered or not */ > nd = ncsi_find_dev(dev); > @@ -1795,6 +1795,14 @@ struct ncsi_dev *ncsi_register_dev(struct net_device *dev, > if (np && (of_property_read_bool(np, "mellanox,multi-host") || > of_property_read_bool(np, "mlx,multi-host"))) > ndp->mlx_multi_host = true; > + Should the "ncsi-package" (and above multi-host properties) be documented in DT bindings somewhere? I was unable to locate such documentation. > + if (np) { > + ret = of_property_read_u32(np, "ncsi-package", > + &ndp->max_package); > + if (ret || !ndp->max_package || > + ndp->max_package > NCSI_MAX_PACKAGE) > + ndp->max_package = NCSI_MAX_PACKAGE; > + } > } It seems that ndp->max_package will be 0 unless pdev != NULL and np != NULL. Would it be better set to NCSI_MAX_PACKAGE in such cases? > > return nd; > -- > 2.25.1 > >