linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH v2 0/8] octeontx2: miscellaneous fixes
@ 2021-03-18 14:15 Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 1/8] octeontx2-pf: Do not modify number of rules Hariprasad Kelam
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

This series of patches fixes various issues related to NPC MCAM entry
management, debugfs, devlink, CGX LMAC mapping, RSS config etc

Change-log:
v2:
Fixed below review comments
	- corrected Fixed tag syntax with 12 digits SHA1
          and providing space between SHA1 and subject line
	- remove code improvement patch
	- make commit description more clear

Geetha sowjanya (2):
  octeontx2-af: Fix irq free in rvu teardown
  octeontx2-pf: Clear RSS enable flag on interace down

Hariprasad Kelam (1):
  octeontx2-af: fix infinite loop in unmapping NPC counter

Rakesh Babu (1):
  octeontx2-af: Formatting debugfs entry rsrc_alloc.

Subbaraya Sundeep (4):
  octeontx2-pf: Do not modify number of rules
  octeontx2-af: Remove TOS field from MKEX TX
  octeontx2-af: Return correct CGX RX fifo size
  octeontx2-af: Fix uninitialized variable warning

 .../marvell/octeontx2/af/npc_profile.h        |  2 -
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |  6 +-
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |  1 +
 .../ethernet/marvell/octeontx2/af/rvu_cgx.c   | 18 +++++-
 .../marvell/octeontx2/af/rvu_debugfs.c        | 55 ++++++++++++-------
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |  2 +-
 .../ethernet/marvell/octeontx2/af/rvu_npc.c   |  2 +-
 .../marvell/octeontx2/nic/otx2_flows.c        |  4 +-
 .../ethernet/marvell/octeontx2/nic/otx2_pf.c  |  5 ++
 9 files changed, 65 insertions(+), 30 deletions(-)

--
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [net PATCH v2 1/8] octeontx2-pf: Do not modify number of rules
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 2/8] octeontx2-af: Formatting debugfs entry rsrc_alloc Hariprasad Kelam
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Subbaraya Sundeep <sbhatta@marvell.com>

In the ETHTOOL_GRXCLSRLALL ioctl ethtool uses
below structure to read number of rules from the driver.

    struct ethtool_rxnfc {
            __u32                           cmd;
            __u32                           flow_type;
            __u64                           data;
            struct ethtool_rx_flow_spec     fs;
            union {
                    __u32                   rule_cnt;
                    __u32                   rss_context;
            };
            __u32                           rule_locs[0];
    };

Driver must not modify rule_cnt member. But currently driver
modifies it by modifying rss_context. Hence fix it by using a
local variable.

Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
index 0dbbf38e059..dc177842097 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
@@ -257,17 +257,19 @@ int otx2_get_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc,
 int otx2_get_all_flows(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc,
 		       u32 *rule_locs)
 {
+	u32 rule_cnt = nfc->rule_cnt;
 	u32 location = 0;
 	int idx = 0;
 	int err = 0;
 
 	nfc->data = pfvf->flow_cfg->ntuple_max_flows;
-	while ((!err || err == -ENOENT) && idx < nfc->rule_cnt) {
+	while ((!err || err == -ENOENT) && idx < rule_cnt) {
 		err = otx2_get_flow(pfvf, nfc, location);
 		if (!err)
 			rule_locs[idx++] = location;
 		location++;
 	}
+	nfc->rule_cnt = rule_cnt;
 
 	return err;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 2/8] octeontx2-af: Formatting debugfs entry rsrc_alloc.
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 1/8] octeontx2-pf: Do not modify number of rules Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 3/8] octeontx2-af: Remove TOS field from MKEX TX Hariprasad Kelam
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Rakesh Babu <rsaladi2@marvell.com>

With the existing rsrc_alloc's format, there is misalignment for the
pcifunc entries whose VF's index is a double digit. This patch fixes
this.

    pcifunc     NPA         NIX0        NIX1        SSO GROUP   SSOWS
    TIM         CPT0        CPT1        REE0        REE1
    PF0:VF0     8           5
    PF0:VF1     9                       3
    PF0:VF10    18          10
    PF0:VF11    19                      8
    PF0:VF12    20          11
    PF0:VF13    21                      9
    PF0:VF14    22          12
    PF0:VF15    23                      10
    PF1         0           0

Fixes: 23205e6d06d4 ("octeontx2-af: Dump current resource provisioning status")
Signed-off-by: Rakesh Babu <rsaladi2@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 .../marvell/octeontx2/af/rvu_debugfs.c        | 46 ++++++++++++-------
 1 file changed, 29 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
index aa2ca8780b9..dc946953af0 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
@@ -234,12 +234,14 @@ static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
 					  char __user *buffer,
 					  size_t count, loff_t *ppos)
 {
-	int index, off = 0, flag = 0, go_back = 0, off_prev;
+	int index, off = 0, flag = 0, go_back = 0, len = 0;
 	struct rvu *rvu = filp->private_data;
 	int lf, pf, vf, pcifunc;
 	struct rvu_block block;
 	int bytes_not_copied;
+	int lf_str_size = 12;
 	int buf_size = 2048;
+	char *lfs;
 	char *buf;
 
 	/* don't allow partial reads */
@@ -249,12 +251,18 @@ static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
 	buf = kzalloc(buf_size, GFP_KERNEL);
 	if (!buf)
 		return -ENOSPC;
-	off +=	scnprintf(&buf[off], buf_size - 1 - off, "\npcifunc\t\t");
+
+	lfs = kzalloc(lf_str_size, GFP_KERNEL);
+	if (!lfs)
+		return -ENOMEM;
+	off +=	scnprintf(&buf[off], buf_size - 1 - off, "%-*s", lf_str_size,
+			  "pcifunc");
 	for (index = 0; index < BLK_COUNT; index++)
-		if (strlen(rvu->hw->block[index].name))
-			off +=	scnprintf(&buf[off], buf_size - 1 - off,
-					  "%*s\t", (index - 1) * 2,
-					  rvu->hw->block[index].name);
+		if (strlen(rvu->hw->block[index].name)) {
+			off += scnprintf(&buf[off], buf_size - 1 - off,
+					 "%-*s", lf_str_size,
+					 rvu->hw->block[index].name);
+		}
 	off += scnprintf(&buf[off], buf_size - 1 - off, "\n");
 	for (pf = 0; pf < rvu->hw->total_pfs; pf++) {
 		for (vf = 0; vf <= rvu->hw->total_vfs; vf++) {
@@ -263,14 +271,15 @@ static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
 				continue;
 
 			if (vf) {
+				sprintf(lfs, "PF%d:VF%d", pf, vf - 1);
 				go_back = scnprintf(&buf[off],
 						    buf_size - 1 - off,
-						    "PF%d:VF%d\t\t", pf,
-						    vf - 1);
+						    "%-*s", lf_str_size, lfs);
 			} else {
+				sprintf(lfs, "PF%d", pf);
 				go_back = scnprintf(&buf[off],
 						    buf_size - 1 - off,
-						    "PF%d\t\t", pf);
+						    "%-*s", lf_str_size, lfs);
 			}
 
 			off += go_back;
@@ -278,20 +287,22 @@ static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
 				block = rvu->hw->block[index];
 				if (!strlen(block.name))
 					continue;
-				off_prev = off;
+				len = 0;
+				lfs[len] = '\0';
 				for (lf = 0; lf < block.lf.max; lf++) {
 					if (block.fn_map[lf] != pcifunc)
 						continue;
 					flag = 1;
-					off += scnprintf(&buf[off], buf_size - 1
-							- off, "%3d,", lf);
+					len += sprintf(&lfs[len], "%d,", lf);
 				}
-				if (flag && off_prev != off)
-					off--;
-				else
-					go_back++;
+
+				if (flag)
+					len--;
+				lfs[len] = '\0';
 				off += scnprintf(&buf[off], buf_size - 1 - off,
-						"\t");
+						 "%-*s", lf_str_size, lfs);
+				if (!strlen(lfs))
+					go_back += lf_str_size;
 			}
 			if (!flag)
 				off -= go_back;
@@ -303,6 +314,7 @@ static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
 	}
 
 	bytes_not_copied = copy_to_user(buffer, buf, off);
+	kfree(lfs);
 	kfree(buf);
 
 	if (bytes_not_copied)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 3/8] octeontx2-af: Remove TOS field from MKEX TX
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 1/8] octeontx2-pf: Do not modify number of rules Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 2/8] octeontx2-af: Formatting debugfs entry rsrc_alloc Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 4/8] octeontx2-af: Return correct CGX RX fifo size Hariprasad Kelam
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Subbaraya Sundeep <sbhatta@marvell.com>

The MKEX profile describes what packet fields need to be extracted from
the input packet and how to place those packet fields in the output key
for MCAM matching.  The MKEX profile can be in a way where higher layer
packet fields can overwrite lower layer packet fields in output MCAM
Key.
Hence MKEX profile is always ensured that there are no overlaps between
any of the layers. But the commit 42006910b5ea
("octeontx2-af: cleanup KPU config data") introduced TX TOS field which
overlaps with DMAC in MCAM key.
This led to AF driver returning error when TX rule is installed with
DMAC as match criteria since DMAC gets overwritten and cannot be
supported. This patch fixes the issue by removing TOS field from MKEX TX
profile.

Fixes: 42006910b5ea ("octeontx2-af: cleanup KPU config data")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h b/drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h
index b192692b4fc..5c372d2c24a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h
@@ -13499,8 +13499,6 @@ static struct npc_mcam_kex npc_mkex_default = {
 			[NPC_LT_LC_IP] = {
 				/* SIP+DIP: 8 bytes, KW2[63:0] */
 				KEX_LD_CFG(0x07, 0xc, 0x1, 0x0, 0x10),
-				/* TOS: 1 byte, KW1[63:56] */
-				KEX_LD_CFG(0x0, 0x1, 0x1, 0x0, 0xf),
 			},
 			/* Layer C: IPv6 */
 			[NPC_LT_LC_IP6] = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 4/8] octeontx2-af: Return correct CGX RX fifo size
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
                   ` (2 preceding siblings ...)
  2021-03-18 14:15 ` [net PATCH v2 3/8] octeontx2-af: Remove TOS field from MKEX TX Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 5/8] octeontx2-af: Fix irq free in rvu teardown Hariprasad Kelam
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Subbaraya Sundeep <sbhatta@marvell.com>

CGX receive buffer size is a constant value and
cannot be read from CGX0 block always since
CGX0 may not enabled everytime. Hence return CGX
receive buffer size from first enabled CGX block
instead of CGX0.

Fixes: 6e54e1c5399a ("octeontx2-af: cn10K: MTU configuration")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 .../net/ethernet/marvell/octeontx2/af/rvu.h    |  1 +
 .../ethernet/marvell/octeontx2/af/rvu_cgx.c    | 18 ++++++++++++++++--
 .../marvell/octeontx2/af/rvu_debugfs.c         |  9 +++++----
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index fa6e46e36ae..76f399229dd 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -678,6 +678,7 @@ void npc_read_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,
 			 u8 *intf, u8 *ena);
 bool is_mac_feature_supported(struct rvu *rvu, int pf, int feature);
 u32  rvu_cgx_get_fifolen(struct rvu *rvu);
+void *rvu_first_cgx_pdata(struct rvu *rvu);
 
 /* CPT APIs */
 int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int lf, int slot);
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index e668e482383..6e2bf4fcd29 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -89,6 +89,21 @@ void *rvu_cgx_pdata(u8 cgx_id, struct rvu *rvu)
 	return rvu->cgx_idmap[cgx_id];
 }
 
+/* Return first enabled CGX instance if none are enabled then return NULL */
+void *rvu_first_cgx_pdata(struct rvu *rvu)
+{
+	int first_enabled_cgx = 0;
+	void *cgxd = NULL;
+
+	for (; first_enabled_cgx < rvu->cgx_cnt_max; first_enabled_cgx++) {
+		cgxd = rvu_cgx_pdata(first_enabled_cgx, rvu);
+		if (cgxd)
+			break;
+	}
+
+	return cgxd;
+}
+
 /* Based on P2X connectivity find mapped NIX block for a PF */
 static void rvu_map_cgx_nix_block(struct rvu *rvu, int pf,
 				  int cgx_id, int lmac_id)
@@ -711,10 +726,9 @@ int rvu_mbox_handler_cgx_features_get(struct rvu *rvu,
 u32 rvu_cgx_get_fifolen(struct rvu *rvu)
 {
 	struct mac_ops *mac_ops;
-	int rvu_def_cgx_id = 0;
 	u32 fifo_len;
 
-	mac_ops = get_mac_ops(rvu_cgx_pdata(rvu_def_cgx_id, rvu));
+	mac_ops = get_mac_ops(rvu_first_cgx_pdata(rvu));
 	fifo_len = mac_ops ? mac_ops->fifo_len : 0;
 
 	return fifo_len;
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
index dc946953af0..b4c53b19f53 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
@@ -331,7 +331,6 @@ static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused)
 	struct rvu *rvu = filp->private;
 	struct pci_dev *pdev = NULL;
 	struct mac_ops *mac_ops;
-	int rvu_def_cgx_id = 0;
 	char cgx[10], lmac[10];
 	struct rvu_pfvf *pfvf;
 	int pf, domain, blkid;
@@ -339,7 +338,10 @@ static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused)
 	u16 pcifunc;
 
 	domain = 2;
-	mac_ops = get_mac_ops(rvu_cgx_pdata(rvu_def_cgx_id, rvu));
+	mac_ops = get_mac_ops(rvu_first_cgx_pdata(rvu));
+	/* There can be no CGX devices at all */
+	if (!mac_ops)
+		return 0;
 	seq_printf(filp, "PCI dev\t\tRVU PF Func\tNIX block\t%s\tLMAC\n",
 		   mac_ops->name);
 	for (pf = 0; pf < rvu->hw->total_pfs; pf++) {
@@ -1830,7 +1832,6 @@ static void rvu_dbg_cgx_init(struct rvu *rvu)
 {
 	struct mac_ops *mac_ops;
 	unsigned long lmac_bmap;
-	int rvu_def_cgx_id = 0;
 	int i, lmac_id;
 	char dname[20];
 	void *cgx;
@@ -1838,7 +1839,7 @@ static void rvu_dbg_cgx_init(struct rvu *rvu)
 	if (!cgx_get_cgxcnt_max())
 		return;
 
-	mac_ops = get_mac_ops(rvu_cgx_pdata(rvu_def_cgx_id, rvu));
+	mac_ops = get_mac_ops(rvu_first_cgx_pdata(rvu));
 	if (!mac_ops)
 		return;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 5/8] octeontx2-af: Fix irq free in rvu teardown
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
                   ` (3 preceding siblings ...)
  2021-03-18 14:15 ` [net PATCH v2 4/8] octeontx2-af: Return correct CGX RX fifo size Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 6/8] octeontx2-pf: Clear RSS enable flag on interace down Hariprasad Kelam
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Geetha sowjanya <gakula@marvell.com>

Current devlink code try to free already freed irqs as the
irq_allocate flag is not cleared after free leading to kernel
crash while removing rvu driver. The patch fixes the irq free
sequence and clears the irq_allocate flag on free.

Fixes: 7304ac4567bc ("octeontx2-af: Add mailbox IRQ and msg handlers")
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
index d9a1a71c7cc..ab24a5e8ee8 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -2462,8 +2462,10 @@ static void rvu_unregister_interrupts(struct rvu *rvu)
 		    INTR_MASK(rvu->hw->total_pfs) & ~1ULL);
 
 	for (irq = 0; irq < rvu->num_vec; irq++) {
-		if (rvu->irq_allocated[irq])
+		if (rvu->irq_allocated[irq]) {
 			free_irq(pci_irq_vector(rvu->pdev, irq), rvu);
+			rvu->irq_allocated[irq] = false;
+		}
 	}
 
 	pci_free_irq_vectors(rvu->pdev);
@@ -2975,8 +2977,8 @@ static void rvu_remove(struct pci_dev *pdev)
 	struct rvu *rvu = pci_get_drvdata(pdev);
 
 	rvu_dbg_exit(rvu);
-	rvu_unregister_interrupts(rvu);
 	rvu_unregister_dl(rvu);
+	rvu_unregister_interrupts(rvu);
 	rvu_flr_wq_destroy(rvu);
 	rvu_cgx_exit(rvu);
 	rvu_fwdata_exit(rvu);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 6/8] octeontx2-pf: Clear RSS enable flag on interace down
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
                   ` (4 preceding siblings ...)
  2021-03-18 14:15 ` [net PATCH v2 5/8] octeontx2-af: Fix irq free in rvu teardown Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 7/8] octeontx2-af: fix infinite loop in unmapping NPC counter Hariprasad Kelam
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Geetha sowjanya <gakula@marvell.com>

RSS configuration can not be get/set when interface is in down state
as they required mbox communication. RSS enable flag status
is used for set/get configuration. Current code do not clear the
RSS enable flag on interface down which lead to mbox error while
trying to set/get RSS configuration.

Fixes: 85069e95e531 ("octeontx2-pf: Receive side scaling support")
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 53ab1814d74..2fd3d235d29 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -1672,6 +1672,7 @@ int otx2_stop(struct net_device *netdev)
 	struct otx2_nic *pf = netdev_priv(netdev);
 	struct otx2_cq_poll *cq_poll = NULL;
 	struct otx2_qset *qset = &pf->qset;
+	struct otx2_rss_info *rss;
 	int qidx, vec, wrk;
 
 	netif_carrier_off(netdev);
@@ -1684,6 +1685,10 @@ int otx2_stop(struct net_device *netdev)
 	/* First stop packet Rx/Tx */
 	otx2_rxtx_enable(pf, false);
 
+	/* Clear RSS enable flag */
+	rss = &pf->hw.rss_info;
+	rss->enable = false;
+
 	/* Cleanup Queue IRQ */
 	vec = pci_irq_vector(pf->pdev,
 			     pf->hw.nix_msixoff + NIX_LF_QINT_VEC_START);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 7/8] octeontx2-af: fix infinite loop in unmapping NPC counter
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
                   ` (5 preceding siblings ...)
  2021-03-18 14:15 ` [net PATCH v2 6/8] octeontx2-pf: Clear RSS enable flag on interace down Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 14:15 ` [net PATCH v2 8/8] octeontx2-af: Fix uninitialized variable warning Hariprasad Kelam
  2021-03-18 21:30 ` [net PATCH v2 0/8] octeontx2: miscellaneous fixes patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

unmapping npc counter works in a way by traversing all mcam
entries to find which mcam rule is associated with counter.
But loop cursor variable 'entry' is not incremented before
checking next mcam entry which resulting in infinite loop.

This in turn hogs the kworker thread forever and no other
mbox message is processed by AF driver after that.
Fix this by updating entry value before checking next
mcam entry.

Fixes: a958dd59f9ce ("octeontx2-af: Map or unmap NPC MCAM entry and counter")
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 04bb0803a5c..0bd49c7080a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -2490,10 +2490,10 @@ int rvu_mbox_handler_npc_mcam_free_counter(struct rvu *rvu,
 		index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry);
 		if (index >= mcam->bmap_entries)
 			break;
+		entry = index + 1;
 		if (mcam->entry2cntr_map[index] != req->cntr)
 			continue;
 
-		entry = index + 1;
 		npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr,
 					      index, req->cntr);
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [net PATCH v2 8/8] octeontx2-af: Fix uninitialized variable warning
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
                   ` (6 preceding siblings ...)
  2021-03-18 14:15 ` [net PATCH v2 7/8] octeontx2-af: fix infinite loop in unmapping NPC counter Hariprasad Kelam
@ 2021-03-18 14:15 ` Hariprasad Kelam
  2021-03-18 21:30 ` [net PATCH v2 0/8] octeontx2: miscellaneous fixes patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Hariprasad Kelam @ 2021-03-18 14:15 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, willemdebruijn.kernel, andrew, sgoutham, lcherian,
	gakula, jerinj, sbhatta, hkelam

From: Subbaraya Sundeep <sbhatta@marvell.com>

Initialize l4_key_offset variable to fix uninitialized
variable compiler warning.

Fixes: b9b7421a01d8 ("octeontx2-af: Support ESP/AH RSS hashing")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
index d3000194e2d..3d068b7d46b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
@@ -2629,7 +2629,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)
 	struct nix_rx_flowkey_alg *field;
 	struct nix_rx_flowkey_alg tmp;
 	u32 key_type, valid_key;
-	int l4_key_offset;
+	int l4_key_offset = 0;
 
 	if (!alg)
 		return -EINVAL;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [net PATCH v2 0/8] octeontx2: miscellaneous fixes
  2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
                   ` (7 preceding siblings ...)
  2021-03-18 14:15 ` [net PATCH v2 8/8] octeontx2-af: Fix uninitialized variable warning Hariprasad Kelam
@ 2021-03-18 21:30 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-18 21:30 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: netdev, linux-kernel, kuba, davem, willemdebruijn.kernel, andrew,
	sgoutham, lcherian, gakula, jerinj, sbhatta

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Thu, 18 Mar 2021 19:45:41 +0530 you wrote:
> This series of patches fixes various issues related to NPC MCAM entry
> management, debugfs, devlink, CGX LMAC mapping, RSS config etc
> 
> Change-log:
> v2:
> Fixed below review comments
> 	- corrected Fixed tag syntax with 12 digits SHA1
>           and providing space between SHA1 and subject line
> 	- remove code improvement patch
> 	- make commit description more clear
> 
> [...]

Here is the summary with links:
  - [net,v2,1/8] octeontx2-pf: Do not modify number of rules
    https://git.kernel.org/netdev/net/c/f41b2d67d767
  - [net,v2,2/8] octeontx2-af: Formatting debugfs entry rsrc_alloc.
    https://git.kernel.org/netdev/net/c/f7884097141b
  - [net,v2,3/8] octeontx2-af: Remove TOS field from MKEX TX
    https://git.kernel.org/netdev/net/c/ce86c2a531e2
  - [net,v2,4/8] octeontx2-af: Return correct CGX RX fifo size
    https://git.kernel.org/netdev/net/c/297887872973
  - [net,v2,5/8] octeontx2-af: Fix irq free in rvu teardown
    https://git.kernel.org/netdev/net/c/ae2619dd4fcc
  - [net,v2,6/8] octeontx2-pf: Clear RSS enable flag on interace down
    https://git.kernel.org/netdev/net/c/f12098ce9b43
  - [net,v2,7/8] octeontx2-af: fix infinite loop in unmapping NPC counter
    https://git.kernel.org/netdev/net/c/64451b98306b
  - [net,v2,8/8] octeontx2-af: Fix uninitialized variable warning
    https://git.kernel.org/netdev/net/c/8c16cb0304cd

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-03-18 21:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 14:15 [net PATCH v2 0/8] octeontx2: miscellaneous fixes Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 1/8] octeontx2-pf: Do not modify number of rules Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 2/8] octeontx2-af: Formatting debugfs entry rsrc_alloc Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 3/8] octeontx2-af: Remove TOS field from MKEX TX Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 4/8] octeontx2-af: Return correct CGX RX fifo size Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 5/8] octeontx2-af: Fix irq free in rvu teardown Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 6/8] octeontx2-pf: Clear RSS enable flag on interace down Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 7/8] octeontx2-af: fix infinite loop in unmapping NPC counter Hariprasad Kelam
2021-03-18 14:15 ` [net PATCH v2 8/8] octeontx2-af: Fix uninitialized variable warning Hariprasad Kelam
2021-03-18 21:30 ` [net PATCH v2 0/8] octeontx2: miscellaneous fixes patchwork-bot+netdevbpf

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).