Skip to contentSkip to conversation

octeontx2-af: Hardware configuration for inline IPsec

PATCH Applied Srujana Challa 2 participants 2 messages Sep 16, 2021

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

PATCH 1/1 octeontx2-af: Hardware configuration for inline IPsec

On OcteonTX2/CN10K SoC, the admin function (AF) is the only one with all priviliges to configure HW and alloc resources, PFs and it's VFs have to request AF via mailbox for all their needs. This patch adds new mailbox messages for CPT PFs and VFs to configure HW resources for inline-IPsec.

---
 .../ethernet/marvell/octeontx2/af/common.h    |   1 +
 .../net/ethernet/marvell/octeontx2/af/mbox.h  |  60 +++++++-
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |  54 +++++++
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   2 +
 .../ethernet/marvell/octeontx2/af/rvu_cn10k.c |   4 +-
 .../ethernet/marvell/octeontx2/af/rvu_cpt.c   | 135 ++++++++++++++++++
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   | 112 +++++++++++++++
 .../ethernet/marvell/octeontx2/af/rvu_reg.h   |   2 +
 8 files changed, 367 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/common.h +1 -0
index d9bea13f15b8..8931864ee110 100644
@@ -191,6 +191,7 @@ enum nix_scheduler {
 #define NIX_CHAN_SDP_CH_START          (0x700ull)
 #define NIX_CHAN_SDP_CHX(a)            (NIX_CHAN_SDP_CH_START + (a))
 #define NIX_CHAN_SDP_NUM_CHANS		256
+#define NIX_CHAN_CPT_CH_START          (0x800ull)
 
 /* The mask is to extract lower 10-bits of channel number
  * which CPT will pass to X2P.
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +59 -1

90 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu.c +54 -0

60 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
index 1d9411232f1d..f59169cdc0db 100644
@@ -656,6 +656,8 @@ int rvu_lf_reset(struct rvu *rvu, struct rvu_block *block, int lf);
 int rvu_get_blkaddr(struct rvu *rvu, int blktype, u16 pcifunc);
 int rvu_poll_reg(struct rvu *rvu, u64 block, u64 offset, u64 mask, bool zero);
 int rvu_get_num_lbk_chans(void);
+int rvu_get_blkaddr_from_slot(struct rvu *rvu, int blktype, u16 pcifunc,
+			      u16 global_slot, u16 *slot_in_block);
 
 /* RVU HW reg validation */
 enum regmap_block {
drivers/net/ethernet/marvell/octeontx2/af/rvu_cn10k.c +2 -2
index 46a41cfff575..7dbbc115cde4 100644
@@ -334,8 +334,8 @@ int rvu_set_channels_base(struct rvu *rvu)
 	/* Out of 4096 channels start CPT from 2048 so
 	 * that MSB for CPT channels is always set
 	 */
-	if (cpt_chan_base <= 0x800) {
-		hw->cpt_chan_base = 0x800;
+	if (cpt_chan_base <= NIX_CHAN_CPT_CH_START) {
+		hw->cpt_chan_base = NIX_CHAN_CPT_CH_START;
 	} else {
 		dev_err(rvu->dev,
 			"CPT channels could not fit in the range 2048-4095\n");
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +135 -0

141 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +112 -0

118 lines not on this page · raw message

drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +2 -0
index 21f1ed4e222f..dbaeb10de7c2 100644
@@ -236,6 +236,8 @@
 #define NIX_AF_RX_DEF_OIP6_DSCP		(0x02F8)
 #define NIX_AF_RX_IPSEC_GEN_CFG		(0x0300)
 #define NIX_AF_RX_CPTX_INST_ADDR	(0x0310)
+#define NIX_AF_RX_CPTX_INST_QSEL(a)	(0x0320ull | (uint64_t)(a) << 3)
+#define NIX_AF_RX_CPTX_CREDIT(a)	(0x0360ull | (uint64_t)(a) << 3)
 #define NIX_AF_NDC_TX_SYNC		(0x03F0)
 #define NIX_AF_AQ_CFG			(0x0400)
 #define NIX_AF_AQ_BASE			(0x0410)
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 11 lines · On Thu, 16 Sep 2021 15:11:14 +0530 you wrote:

On OcteonTX2/CN10K SoC, the admin function (AF) is the only one with all priviliges to configure HW and alloc resources, PFs and it's VFs have to request AF via mailbox for all their needs. This patch adds new mailbox messages for CPT PFs and VFs to configure HW resources for inline-IPsec.

[...]

Here is the summary with links:
- [net-next] octeontx2-af: Hardware configuration for inline IPsec

    https://git.kernel.org/netdev/net-next/c/4b5a3ab17c6c

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