Skip to contentSkip to conversation

Interrupt handler support for NPA and NIX in Octeontx2.

PATCH In review [email protected] 3 participants 5 messages Jul 21, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Interrupt handler support for NPA and NIX in Octeontx2.

From: Rakesh Babu <[email protected]>

Changes from v1.
1. Assigned void pointers to another type of pointers without type casting.
2. Removed Switch and If cases in interrupt handlers and printed the hexa value of the interrupt

Jerin Jacob (2):
octeontx2-af: add npa error af interrupt handlers
octeontx2-af: add nix error af interrupt handlers

 .../net/ethernet/marvell/octeontx2/af/rvu.c   |  12 ++
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   4 +
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   | 148 +++++++++++++++
 .../ethernet/marvell/octeontx2/af/rvu_npa.c   | 176 ++++++++++++++++++
 .../marvell/octeontx2/af/rvu_struct.h         |  20 ++
 5 files changed, 360 insertions(+)

--
2.17.1

#1 lore raw

PATCH v2 1/2 octeontx2-af: add npa error af interrupt handlers

From: Jerin Jacob <[email protected]>

Added debug messages for NPA NPA_AF_RVU_INT, NPA_AF_GEN_INT, NPA_AF_ERR_INT and NPA_AF_RAS error AF interrupts

---
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |   7 +
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   2 +
 .../ethernet/marvell/octeontx2/af/rvu_npa.c   | 176 ++++++++++++++++++
 .../marvell/octeontx2/af/rvu_struct.h         |  10 +
 4 files changed, 195 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +7 -0
index 557e4292c846..6c4027f04cfc 100644
@@ -2130,6 +2130,8 @@ static void rvu_unregister_interrupts(struct rvu *rvu)
 {
 	int irq;
 
+	rvu_npa_unregister_interrupts(rvu);
+
 	/* Disable the Mbox interrupt */
 	rvu_write64(rvu, BLKADDR_RVUM, RVU_AF_PFAF_MBOX_INT_ENA_W1C,
 		    INTR_MASK(rvu->hw->total_pfs) & ~1ULL);
@@ -2337,6 +2339,11 @@ static int rvu_register_interrupts(struct rvu *rvu)
 		goto fail;
 	}
 	rvu->irq_allocated[offset] = true;
+
+	ret = rvu_npa_register_interrupts(rvu);
+	if (ret)
+		goto fail;
+
 	return 0;
 
 fail:
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
index dcf25a092008..63c9f6049ad5 100644
@@ -453,6 +453,8 @@ void rvu_npa_freemem(struct rvu *rvu);
 void rvu_npa_lf_teardown(struct rvu *rvu, u16 pcifunc, int npalf);
 int rvu_npa_aq_enq_inst(struct rvu *rvu, struct npa_aq_enq_req *req,
 			struct npa_aq_enq_rsp *rsp);
+int rvu_npa_register_interrupts(struct rvu *rvu);
+void rvu_npa_unregister_interrupts(struct rvu *rvu);
 
 /* NIX APIs */
 bool is_nixlf_attached(struct rvu *rvu, u16 pcifunc);
drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c +176 -0

185 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h +10 -0
index a3ecb5de9000..cc06a9242300 100644
@@ -60,6 +60,16 @@ enum rvu_af_int_vec_e {
 	RVU_AF_INT_VEC_CNT    = 0x5,
 };
 
+/* NPA Admin function Interrupt Vector Enumeration */
+enum npa_af_int_vec_e {
+	NPA_AF_INT_VEC_RVU	= 0x0,
+	NPA_AF_INT_VEC_GEN	= 0x1,
+	NPA_AF_INT_VEC_AQ_DONE	= 0x2,
+	NPA_AF_INT_VEC_AF_ERR	= 0x3,
+	NPA_AF_INT_VEC_POISON	= 0x4,
+	NPA_AF_INT_VEC_CNT	= 0x5,
+};
+
 /**
  * RVU PF Interrupt Vector Enumeration
  */

--
2.17.1

#2 lore raw

PATCH v2 2/2 octeontx2-af: add nix error af interrupt handlers

In reply to [email protected]

From: Jerin Jacob <[email protected]>

Added debug messages for NIX_AF_RVU_INT, NIX_AF_ERR_INT and NIX_AF_RAS error AF interrupts.

---
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |   5 +
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   2 +
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   | 148 ++++++++++++++++++
 .../marvell/octeontx2/af/rvu_struct.h         |  10 ++
 4 files changed, 165 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +5 -0
index 6c4027f04cfc..9a36ce5fc57a 100644
@@ -2131,6 +2131,7 @@ static void rvu_unregister_interrupts(struct rvu *rvu)
 	int irq;
 
 	rvu_npa_unregister_interrupts(rvu);
+	rvu_nix_unregister_interrupts(rvu);
 
 	/* Disable the Mbox interrupt */
 	rvu_write64(rvu, BLKADDR_RVUM, RVU_AF_PFAF_MBOX_INT_ENA_W1C,
@@ -2344,6 +2345,10 @@ static int rvu_register_interrupts(struct rvu *rvu)
 	if (ret)
 		goto fail;
 
+	ret = rvu_nix_register_interrupts(rvu);
+	if (ret)
+		goto fail;
+
 	return 0;
 
 fail:
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
index 63c9f6049ad5..44d25a8f598d 100644
@@ -465,6 +465,8 @@ void rvu_nix_freemem(struct rvu *rvu);
 int rvu_get_nixlf_count(struct rvu *rvu);
 void rvu_nix_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int npalf);
 int nix_get_nixlf(struct rvu *rvu, u16 pcifunc, int *nixlf, int *nix_blkaddr);
+int rvu_nix_register_interrupts(struct rvu *rvu);
+void rvu_nix_unregister_interrupts(struct rvu *rvu);
 
 /* NPC APIs */
 int rvu_npc_init(struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +148 -0

151 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h +10 -0
index cc06a9242300..5d868eb80115 100644
@@ -70,6 +70,16 @@ enum npa_af_int_vec_e {
 	NPA_AF_INT_VEC_CNT	= 0x5,
 };
 
+/* NIX Admin function Interrupt Vector Enumeration */
+enum nix_af_int_vec_e {
+	NIX_AF_INT_VEC_RVU	= 0x0,
+	NIX_AF_INT_VEC_GEN	= 0x1,
+	NIX_AF_INT_VEC_AQ_DONE	= 0x2,
+	NIX_AF_INT_VEC_AF_ERR	= 0x3,
+	NIX_AF_INT_VEC_POISON	= 0x4,
+	NIX_AF_INT_VEC_CNT	= 0x5,
+};
+
 /**
  * RVU PF Interrupt Vector Enumeration
  */

--
2.17.1

maintainer
#3 lore raw
In reply to [email protected]
Quoted 6 lines · On Tue, 21 Jul 2020 08:08:45 +0530 [email protected] wrote:

From: Rakesh Babu <[email protected]>

Changes from v1.
1. Assigned void pointers to another type of pointers without type casting.
2. Removed Switch and If cases in interrupt handlers and printed the hexa value of the interrupt

These days error events should be reported via devlink health, not printing messages to the logs.

maintainer
#4 lore raw

From: Jakub Kicinski <[email protected]>
Date: Tue, 21 Jul 2020 12:23:29 -0700

Quoted 10 lines · On Tue, 21 Jul 2020 08:08:45 +0530 [email protected] wrote:
Quoted 6 lines

From: Rakesh Babu <[email protected]>

Changes from v1.
1. Assigned void pointers to another type of pointers without type casting.
2. Removed Switch and If cases in interrupt handlers and printed the hexa value of the interrupt

These days error events should be reported via devlink health, not printing messages to the logs.

+1