octeontx2-af: Hardware configuration for inline IPsec
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
@@ -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
@@ -655,6 +655,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
@@ -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
@@ -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
David Miller
maintainerFrom: Srujana Challa <[email protected]>
Date: Wed, 1 Sep 2021 16:01:23 +0530
Quoted 9 lines
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.
Signed-off-by Subbaraya Sundeep <[email protected]>Signed-off-by Srujana Challa <[email protected]>Signed-off-by Vidya Sagar Velumuri <[email protected]>
net-next is closed. Please resubmit this when it opens back up.
Thank you.