[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIJKM9ujO6zxrBCT@opensource>
Date: Thu, 24 Jul 2025 14:58:59 +0000
From: Subbaraya Sundeep <sbhatta@...vell.com>
To: Simon Horman <horms@...nel.org>
CC: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
<kuba@...nel.org>, <pabeni@...hat.com>, <gakula@...vell.com>,
<hkelam@...vell.com>, <bbhushan2@...vell.com>, <jerinj@...vell.com>,
<lcherian@...vell.com>, <sgoutham@...vell.com>,
<netdev@...r.kernel.org>
Subject: Re: [net-next PATCH v3 09/11] octeontx2-af: Accommodate more
bandwidth profiles for cn20k
On 2025-07-22 at 17:08:47, Simon Horman (horms@...nel.org) wrote:
> On Thu, Jul 17, 2025 at 10:37:41PM +0530, Subbaraya Sundeep wrote:
> > CN20K has 16k of leaf profiles, 2k of middle profiles and
> > 256 of top profiles. This patch modifies existing receive
> > queue and bandwidth profile context structures to accommodate
> > additional profiles of cn20k.
> >
> > Signed-off-by: Subbaraya Sundeep <sbhatta@...vell.com>
> > ---
> > drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 13 ++++++++-----
> > .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 6 ++++--
> > 2 files changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
> > index 162283302e31..f6ecdb4b5ff9 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
> > @@ -5856,7 +5856,7 @@ static int nix_verify_bandprof(struct nix_cn10k_aq_enq_req *req,
> > return -EINVAL;
> >
> > ipolicer = &nix_hw->ipolicer[hi_layer];
> > - prof_idx = req->prof.band_prof_id;
> > + prof_idx = req->prof.band_prof_id_h << 7 | req->prof.band_prof_id;
> > if (prof_idx >= ipolicer->band_prof.max ||
> > ipolicer->pfvf_map[prof_idx] != pcifunc)
> > return -EINVAL;
> > @@ -6021,8 +6021,10 @@ static int nix_ipolicer_map_leaf_midprofs(struct rvu *rvu,
> > aq_req->op = NIX_AQ_INSTOP_WRITE;
> > aq_req->qidx = leaf_prof;
> >
> > - aq_req->prof.band_prof_id = mid_prof;
> > + aq_req->prof.band_prof_id = mid_prof & 0x7F;
> > aq_req->prof_mask.band_prof_id = GENMASK(6, 0);
> > + aq_req->prof.band_prof_id_h = mid_prof >> 7;
> > + aq_req->prof_mask.band_prof_id_h = GENMASK(3, 0);
> > aq_req->prof.hl_en = 1;
> > aq_req->prof_mask.hl_en = 1;
> >
>
> Perhaps it follows an existing pattern in this driver.
> But the shifts in the above two hunks look
> ripe for using FIELD_PREP/FIELD_GET along with #define GENMASK(...).
>
> Likewise elsewhere in this patch.
Okay will use FIELD_* macros.
Thanks,
Sundeep
>
> ...
Powered by blists - more mailing lists