From: Simon Horman <horms@kernel.org>
To: Radha Mohan Chintakuntla <radhac@marvell.com>
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
Date: Thu, 7 Mar 2024 14:51:46 +0000 [thread overview]
Message-ID: <20240307145146.GB576211@kernel.org> (raw)
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 <radhac@marvell.com>
> ---
> 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.
next prev parent reply other threads:[~2024-03-07 14:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 21:38 [PATCH] octeontx2-af: Increase maximum BPID channels Radha Mohan Chintakuntla
2024-03-07 14:51 ` Simon Horman [this message]
2024-03-11 19:23 ` [EXTERNAL] " Radha Chintakuntla
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=20240307145146.GB576211@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radhac@marvell.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.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).