Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp611555lqi; Thu, 7 Mar 2024 06:52:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUoAqZeyWpQaBDoM7SO5dobq1HAGlvkiFlOYPA9hqROEvuVGQUp5Nc0QRl0dFIkiS75otLDZbRs2KKZxJutEDxh2KKI9Roh7ulOotOujQ== X-Google-Smtp-Source: AGHT+IEb+9u8KsdRhfa2+z6A0eIVqhR/WdntPtllvfvQNiaG1llqR4GS3Q8/tNedmGeHBSozFlyH X-Received: by 2002:a05:6808:2207:b0:3c1:c34e:19e3 with SMTP id bd7-20020a056808220700b003c1c34e19e3mr10792210oib.28.1709823121951; Thu, 07 Mar 2024 06:52:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709823121; cv=pass; d=google.com; s=arc-20160816; b=iBlMp3Y67KsqQx1JjFt8uH0EN8m7qTWERVXc0dyBheEuW7dyO71cdNAqQfawxA/qPL /eUIBQcHj9Ijd/34d3fpdmxDzhhdWrBL0uz47ChLQshQXOQ+33AoMO33guRzZO5nRDD6 +iXdIZzVwazthju8p3N9a7FnLdr+6175XOiap4C4iL28vFFgQadfWfVfU/8w1+xNPCaR ZD7MQDMoWH/4OhKfUERULVyy3ZpNNJ1+f3teeSGtot7LhUzmzK97GsRAdANrhLjP5eQO uPQZjnmAr9NfGzor6q4HEeliROGpKgXKNLJlXJJZFdBbxPBaU+J2qdKKrO4gAKyB5BDx A/RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9Bp2zhp0/U1bB6nfhu8dHVLMw7YXQ93zbX55ezjZeaI=; fh=WEIonXXfxrrgV+4xiIJBrLUMH1LQY2wq+K5nt41lwcw=; b=UFvQHnYO2wOE2pA+Gp7JnTgjJ9qIGfucO5sAi1Yb3ubOcdsX4xoMkIpJrhUMkSS7+c dc0yH6qlZuYGW6FeyOdmqH3Ru5kCl/rQp9d4xK/vh9JX7doCdclLNzyBqoX1O7tUe750 AitJcJcN4uEIHsXNkys/rBu9cXRimVHwEEcI25xkvK14zwzLQ2VJAfTkPULDDJ+tkRaw PE9mcV3WGkfrVUNqA24SSj0F3gLj7JXBu0DK8ZiAR8gQiIVZ4+PNUiSA+VLWs0ybcn1Y yxJ7Qy9vECYO0DQ7+li1Ab0KTKf3yKZfNTAo1XFzDQKpsabDY8UxSZ2EGYMkEAScMCJ9 zTKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VrKVEwwZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e9-20020a630f09000000b005dc505aef9asi13982528pgl.354.2024.03.07.06.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:52:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VrKVEwwZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95772-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95772-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8EBB8283200 for ; Thu, 7 Mar 2024 14:52:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3393512DDB9; Thu, 7 Mar 2024 14:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VrKVEwwZ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5714E1EB2B; Thu, 7 Mar 2024 14:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709823112; cv=none; b=pn6W7cWrihbLHMzmMzcNFdG3e1zPVqc1z7/hqJp7t86xKNDz6JdHgUZGw8ohjn+fvi45GKL6ZMp8STPg8pDQ6CEoP8e0BjNFxIeXZt+jHcSGdOYGWVWEqQVCTjxd1VO1T7TuGJXp9c9Z42b2zKki1EyyfRij3Ci9v7gZW3q17Xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709823112; c=relaxed/simple; bh=jmDXRT1UHHl9wuZwkCbShwjLFqFjqh3WNMPKmI4PmDg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=irKIyZjdAKVP28S2UqooRsddSXv9BwHFCsUC72Annj1Pc/IruICXu0QmQI6vkaZXKLMPYHkS5gqke7CKzcBbC1dTuGmZP52YsSwNECvQZIDW8FtDTa2Byzxjbzq0mQhPUy405JIb++3U8AVpw5Tj6uHHo6gX2IzwMT353zXu8CI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VrKVEwwZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6196C433F1; Thu, 7 Mar 2024 14:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709823111; bh=jmDXRT1UHHl9wuZwkCbShwjLFqFjqh3WNMPKmI4PmDg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VrKVEwwZDMVXu96zzJnPJ98MvmbYZPykuAClMNSXnd8VstCnROhLvCLwUYqkBDLdL EQuwthvZpj9Rchvva+eRiZRyOTqRU1xPUdWsKyEzSt1DnNRtw2DIFaCLDkv2ZE89MV CExqMzSxfYV9wvGb55cO/DSRs4OgfVcjGfIH+kjY0xieCLx8nTTCkXIG3xl8STRMVW nHjMnHLFiKmLnIH9WqX+qeu31/5LSelkS1TwxDcPsajp0w9zLHBBBjb2X/fgjZ4EQe YxKnFuevN/q2mBGUXl4KOyaGVaziIYB9B7VrrD5T8c9YMZHwokmCojR+3FZixo+oXr YKD8HIDX8J2dA== Date: Thu, 7 Mar 2024 14:51:46 +0000 From: Simon Horman To: Radha Mohan Chintakuntla Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com, hkelam@marvell.com, jerinj@marvell.com, sbhatta@marvell.com Subject: Re: [PATCH] octeontx2-af: Increase maximum BPID channels Message-ID: <20240307145146.GB576211@kernel.org> References: <20240306213806.431830-1-radhac@marvell.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240306213806.431830-1-radhac@marvell.com> On Wed, Mar 06, 2024 at 01:38:06PM -0800, Radha Mohan Chintakuntla wrote: > Any NIX interface type can have maximum 256 channels. So increased the > backpressure ID count to 256 so that it can cover cn9k and cn10k SoCs that > have different NIX interface types with varied maximum channels. > > Signed-off-by: Radha Mohan Chintakuntla > --- > drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h > index d5c4f810da61..223a2e39172c 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h > +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h > @@ -1207,10 +1207,8 @@ struct nix_bp_cfg_req { > /* bpid_per_chan = 1 assigns separate bp id for each channel */ > }; > > -/* PF can be mapped to either CGX or LBK interface, > - * so maximum 64 channels are possible. > - */ > -#define NIX_MAX_BPID_CHAN 64 > +/* Maximum channels any single NIX interface can have */ > +#define NIX_MAX_BPID_CHAN 256 > struct nix_bp_cfg_rsp { > struct mbox_msghdr hdr; > u16 chan_bpid[NIX_MAX_BPID_CHAN]; /* Channel and bpid mapping */ Hi Radha, looking over this, I am curious to know how out-of bounds access to chan_bpid is prevented. The bounds seems to be the the number of PF or VF rings. Which I assume is derived from the HW. But if so, what if the HW reports more than NIX_MAX_BPID_CHAN rings? On a different note, struct includes the following field: u16 bpid[NIX_MAX_BPID_CHAN]; But here the index used seems to be 1. VLAN priority (which has maximum value of 8) if DCB is used 2. 0 otherwise So perhaps fewer elements are needed? Apologies in advance if I'm on the wrong track here.