Skip to contentSkip to conversation

Support for OcteonTX2 98xx CPT block.

PATCH Applied Srujana Challa 2 participants 5 messages Feb 2, 2021 – Feb 4, 2021

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

v2 cover Support for OcteonTX2 98xx CPT block.

OcteonTX2 series of silicons have multiple variants, the 98xx variant has two crypto (CPT) blocks to double the crypto performance. This patchset adds support for new CPT block(CPT1).

Srujana Challa (3):
octeontx2-af: Mailbox changes for 98xx CPT block
octeontx2-af: Add support for CPT1 in debugfs
octeontx2-af: Handle CPT function level reset

 .../net/ethernet/marvell/octeontx2/af/mbox.h  |   2 +
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |   3 +
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   9 ++
 .../ethernet/marvell/octeontx2/af/rvu_cpt.c   | 130 +++++++++++++++---
 .../marvell/octeontx2/af/rvu_debugfs.c        |  86 ++++++------
 .../ethernet/marvell/octeontx2/af/rvu_reg.h   |   8 ++
 6 files changed, 178 insertions(+), 60 deletions(-)
Signature · 1 line
2.29.0
#1 lore raw

PATCH v2 1/3 octeontx2-af: Mailbox changes for 98xx CPT block

This patch changes CPT mailbox message format to
support new block CPT1 in 98xx silicon.

cpt_rd_wr_reg ->
Modify cpt_rd_wr_reg mailbox and its handler to accommodate new block CPT1.
cpt_lf_alloc ->
Modify cpt_lf_alloc mailbox and its handler to configure LFs from a block address out of multiple blocks of same type. If a PF/VF needs to configure LFs from both the blocks then this mbox should be called twice.

---
 .../net/ethernet/marvell/octeontx2/af/mbox.h  |  2 +
 .../ethernet/marvell/octeontx2/af/rvu_cpt.c   | 41 +++++++++++--------
 2 files changed, 27 insertions(+), 16 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2 -0
index 89e93eb46ab7..a0fa44941204 100644
@@ -1073,6 +1073,7 @@ struct cpt_rd_wr_reg_msg {
 	u64 *ret_val;
 	u64 val;
 	u8 is_write;
+	int blkaddr;
 };
 
 struct cpt_lf_alloc_req_msg {
@@ -1080,6 +1081,7 @@ struct cpt_lf_alloc_req_msg {
 	u16 nix_pf_func;
 	u16 sso_pf_func;
 	u16 eng_grpmsk;
+	int blkaddr;
 };
 
 #endif /* MBOX_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +25 -16

76 lines not on this page · raw message

Signature · 1 line
2.29.0
#2 lore raw

PATCH v2 2/3 octeontx2-af: Add support for CPT1 in debugfs

In reply to Srujana Challa

Adds support to display block CPT1 stats at
"/sys/kernel/debug/octeontx2/cpt1".

---
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |  7 ++
 .../marvell/octeontx2/af/rvu_debugfs.c        | 86 +++++++++----------
 2 files changed, 49 insertions(+), 44 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +7 -0
index b1a6ecfd563e..aabf6d5ee020 100644
@@ -33,6 +33,7 @@
 
 #define NAME_SIZE				32
 #define MAX_NIX_BLKS				2
+#define MAX_CPT_BLKS				2
 
 /* PF_FUNC */
 #define RVU_PFVF_PF_SHIFT	10
@@ -47,6 +48,11 @@ struct dump_ctx {
 	bool	all;
 };
 
+struct cpt_ctx {
+	int blkaddr;
+	struct rvu *rvu;
+};
+
 struct rvu_debugfs {
 	struct dentry *root;
 	struct dentry *cgx_root;
@@ -61,6 +67,7 @@ struct rvu_debugfs {
 	struct dump_ctx nix_cq_ctx;
 	struct dump_ctx nix_rq_ctx;
 	struct dump_ctx nix_sq_ctx;
+	struct cpt_ctx cpt_ctx[MAX_CPT_BLKS];
 	int npa_qsize_id;
 	int nix_qsize_id;
 };
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +42 -44

156 lines not on this page · raw message

Signature · 1 line
2.29.0
#3 lore raw

PATCH v2 3/3 octeontx2-af: Handle CPT function level reset

In reply to Srujana Challa

When FLR is initiated for a VF (PCI function level reset), the parent PF gets a interrupt. PF then sends a message to admin function (AF), which then cleans up all resources attached to that VF. This patch adds support to handle CPT FLR.

---
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |  3 +
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |  2 +
 .../ethernet/marvell/octeontx2/af/rvu_cpt.c   | 89 +++++++++++++++++++
 .../ethernet/marvell/octeontx2/af/rvu_reg.h   |  8 ++
 4 files changed, 102 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +3 -0
index 4ef7fc8bbb19..50c2a1d800f4 100644
@@ -2150,6 +2150,9 @@ static void rvu_blklf_teardown(struct rvu *rvu, u16 pcifunc, u8 blkaddr)
 			rvu_nix_lf_teardown(rvu, pcifunc, block->addr, lf);
 		else if (block->addr == BLKADDR_NPA)
 			rvu_npa_lf_teardown(rvu, pcifunc, lf);
+		else if ((block->addr == BLKADDR_CPT0) ||
+			 (block->addr == BLKADDR_CPT1))
+			rvu_cpt_lf_teardown(rvu, pcifunc, lf, slot);
 
 		err = rvu_lf_reset(rvu, block, lf);
 		if (err) {
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
index aabf6d5ee020..ce931d86600b 100644
@@ -608,6 +608,8 @@ void npc_enable_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,
 void npc_read_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,
 			 int blkaddr, u16 src, struct mcam_entry *entry,
 			 u8 *intf, u8 *ena);
+/* CPT APIs */
+int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int lf, int slot);
 
 #ifdef CONFIG_DEBUG_FS
 void rvu_dbg_init(struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +89 -0

92 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +8 -0
index 0fb2aa909a23..79a6dcf0e3c0 100644
@@ -484,9 +484,17 @@
 #define CPT_AF_RAS_INT_ENA_W1S          (0x47030)
 #define CPT_AF_RAS_INT_ENA_W1C          (0x47038)
 
+#define AF_BAR2_ALIASX(a, b)            (0x9100000ull | (a) << 12 | (b))
+#define CPT_AF_BAR2_SEL                 0x9000000
+#define CPT_AF_BAR2_ALIASX(a, b)        AF_BAR2_ALIASX(a, b)
+
 #define CPT_AF_LF_CTL2_SHIFT 3
 #define CPT_AF_LF_SSO_PF_FUNC_SHIFT 32
 
+#define CPT_LF_CTL                      0x10
+#define CPT_LF_INPROG                   0x40
+#define CPT_LF_Q_GRP_PTR                0x120
+
 #define NPC_AF_BLK_RST                  (0x00040)
 
 /* NPC */
Signature · 1 line
2.29.0
#4 lore raw
In reply to Srujana Challa
This series was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 10 lines · On Tue, 2 Feb 2021 20:57:06 +0530 you wrote:

OcteonTX2 series of silicons have multiple variants, the 98xx variant has two crypto (CPT) blocks to double the crypto performance. This patchset adds support for new CPT block(CPT1).

Srujana Challa (3):
octeontx2-af: Mailbox changes for 98xx CPT block
octeontx2-af: Add support for CPT1 in debugfs
octeontx2-af: Handle CPT function level reset

[...]

Here is the summary with links:
- [v2,net-next,1/3] octeontx2-af: Mailbox changes for 98xx CPT block

    https://git.kernel.org/netdev/net-next/c/de2854c87c64
  - [v2,net-next,2/3] octeontx2-af: Add support for CPT1 in debugfs
    https://git.kernel.org/netdev/net-next/c/b0f60fab7805
  - [v2,net-next,3/3] octeontx2-af: Handle CPT function level reset
    https://git.kernel.org/netdev/net-next/c/c57c58fd5c4f

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