[net,v3,03/10] octeontx2-af: Fix depth of cam and mem table.

Message ID 20230419062018.286136-4-saikrishnag@marvell.com
State New
Headers
Series octeontx2: Miscellaneous fixes |

Commit Message

Sai Krishna Gajula April 19, 2023, 6:20 a.m. UTC
  From: Ratheesh Kannoth <rkannoth@marvell.com>

Depth of CAM and MEM tables were wrongly configured. Fixed
the same in NPC module.

Fixes: b747923afff8 ("octeontx2-af: Exact match support")
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Simon Horman April 19, 2023, 9:54 a.m. UTC | #1
On Wed, Apr 19, 2023 at 11:50:11AM +0530, Sai Krishna wrote:
> From: Ratheesh Kannoth <rkannoth@marvell.com>
> 
> Depth of CAM and MEM tables were wrongly configured. Fixed
> the same in NPC module.
> 
> Fixes: b747923afff8 ("octeontx2-af: Exact match support")
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> Signed-off-by: Sai Krishna <saikrishnag@marvell.com>

If there is an issue that this resolves, especially
something user-visible, it might be useful to explain what it
is - e.g. before and after. Likewise for a number of other patches
in the series.

But that notwithstanding, this looks good,
with the caveat that I can't verify that the change matches the HW.

Reviewed-by: Simon Horman <simon.horman@corigine.com>
  
Sai Krishna Gajula April 20, 2023, 7:40 a.m. UTC | #2
> -----Original Message-----
> From: Simon Horman <simon.horman@corigine.com>
> Sent: Wednesday, April 19, 2023 3:24 PM
> To: Sai Krishna Gajula <saikrishnag@marvell.com>
> Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; leon@kernel.org; Sunil Kovvuri Goutham
> <sgoutham@marvell.com>; Geethasowjanya Akula <gakula@marvell.com>;
> Linu Cherian <lcherian@marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>;
> Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; Ratheesh Kannoth
> <rkannoth@marvell.com>
> Subject: Re: [net PATCH v3 03/10] octeontx2-af: Fix depth of cam and
> mem table.
> 
> On Wed, Apr 19, 2023 at 11:50:11AM +0530, Sai Krishna wrote:
> > From: Ratheesh Kannoth <rkannoth@marvell.com>
> >
> > Depth of CAM and MEM tables were wrongly configured. Fixed the same in
> > NPC module.
> >
> > Fixes: b747923afff8 ("octeontx2-af: Exact match support")
> > Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> > Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> > Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
> 
> If there is an issue that this resolves, especially something user-visible, it
> might be useful to explain what it is - e.g. before and after. Likewise for a
> number of other patches in the series.
> 
> But that notwithstanding, this looks good, with the caveat that I can't verify
> that the change matches the HW.
> 

We will expand the commit messages with the explanation about the issues and fixes that resolves the issues in v4 patches.

Thanks,
Sai
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
  

Patch

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
index 20ebb9c95c73..6597af84aa36 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
@@ -1868,9 +1868,9 @@  int rvu_npc_exact_init(struct rvu *rvu)
 	rvu->hw->table = table;
 
 	/* Read table size, ways and depth */
-	table->mem_table.depth = FIELD_GET(GENMASK_ULL(31, 24), npc_const3);
 	table->mem_table.ways = FIELD_GET(GENMASK_ULL(19, 16), npc_const3);
-	table->cam_table.depth = FIELD_GET(GENMASK_ULL(15, 0), npc_const3);
+	table->mem_table.depth = FIELD_GET(GENMASK_ULL(15, 0), npc_const3);
+	table->cam_table.depth = FIELD_GET(GENMASK_ULL(31, 24), npc_const3);
 
 	dev_dbg(rvu->dev, "%s: NPC exact match 4way_2k table(ways=%d, depth=%d)\n",
 		__func__,  table->mem_table.ways, table->cam_table.depth);