octeontx2-af: Miscellaneous changes for CPT
v2 cover octeontx2-af: Miscellaneous changes for CPT
This patchset consists of miscellaneous changes for CPT.
- Adds a new mailbox to reset the requested CPT LF.
- Modify FLR sequence as per HW team suggested.
- Adds support to recover CPT engines when they gets fault.
- Updates CPT inbound inline IPsec configuration mailbox, as per new generation of the OcteonTX2 chips.
- Adds a new mailbox to return CPT FLT Interrupt info.
---
v2:
- Addressed a review comment.
v1:
- Dropped patch "octeontx2-af: Fix interrupt name strings completely" to submit to net.
---
Nithin Dabilpuram (1):
octeontx2-af: restore rxc conf after teardown sequence
Srujana Challa (7):
octeontx2-af: recover CPT engine when it gets fault
octeontx2-af: add mbox for CPT LF reset
octeontx2-af: modify FLR sequence for CPT
octeontx2-af: optimize cpt pf identification
octeontx2-af: update CPT inbound inline IPsec config mailbox
octeontx2-af: add ctx ilen to cpt lf alloc mailbox
octeontx2-af: add mbox to return CPT_AF_FLT_INT info
.../net/ethernet/marvell/octeontx2/af/mbox.h | 33 +- .../net/ethernet/marvell/octeontx2/af/rvu.c | 8 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 18 + .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 309 +++++++++++++----- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 46 ++- .../ethernet/marvell/octeontx2/af/rvu_reg.h | 2 + 6 files changed, 324 insertions(+), 92 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/8 octeontx2-af: recover CPT engine when it gets fault
When CPT engine has uncorrectable errors, it will get halted and must be disabled and re-enabled. This patch adds code for the same.
--- .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 110 +++++++++++++----- 1 file changed, 80 insertions(+), 30 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +80 -30
@@ -37,34 +37,60 @@ (_rsp)->free_sts_##etype = free_sts; \ }) -static irqreturn_t rvu_cpt_af_flt_intr_handler (int irq,void *ptr) +static irqreturn_t cpt_af_flt_intr_handler (int vec,void *ptr) {struct rvu_block *block = ptr;struct rvu *rvu = block->rvu;int blkaddr = block->addr; -u64 reg0, reg1, reg2; - - reg0 =rvu_read64 (rvu, blkaddr,CPT_AF_FLTX_INT (0 )); - reg1 =rvu_read64 (rvu, blkaddr,CPT_AF_FLTX_INT (1 )); -if (!is_rvu_otx2 (rvu)) { - reg2 =rvu_read64 (rvu, blkaddr,CPT_AF_FLTX_INT (2 )); -dev_err_ratelimited (rvu->dev, -"Received CPTAF FLT irq : 0x%llx, 0x%llx, 0x%llx" , - reg0, reg1, reg2); - }else { -dev_err_ratelimited (rvu->dev, -"Received CPTAF FLT irq : 0x%llx, 0x%llx" , - reg0, reg1); +u64 reg, val; +int i, eng; +u8 grp; + + reg =rvu_read64 (rvu, blkaddr,CPT_AF_FLTX_INT (vec)); +dev_err_ratelimited (rvu->dev,"Received CPTAF FLT%d irq : 0x%llx" , vec, reg); + + i =-1 ; +while ((i =find_next_bit ((unsigned long *)®,64 , i +1 )) <64 ) { +switch (vec) { +case 0 : + eng = i; +break ; +case 1 : + eng = i +64 ; +break ; +case 2 : + eng = i +128 ; +break ; + } + grp =rvu_read64 (rvu, blkaddr,CPT_AF_EXEX_CTL2 (eng)) &0xFF ; +/* Disable and enable the engine which triggers fault */ +rvu_write64 (rvu, blkaddr,CPT_AF_EXEX_CTL2 (eng),0x0 ); + val =rvu_read64 (rvu, blkaddr,CPT_AF_EXEX_CTL (eng)); +rvu_write64 (rvu, blkaddr,CPT_AF_EXEX_CTL (eng), val & ~1ULL ); + +rvu_write64 (rvu, blkaddr,CPT_AF_EXEX_CTL2 (eng), grp); +rvu_write64 (rvu, blkaddr,CPT_AF_EXEX_CTL (eng), val |1ULL ); } - -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT (0 ), reg0); -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT (1 ), reg1); -if (!is_rvu_otx2 (rvu)) -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT (2 ), reg2); +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT (vec), reg);return IRQ_HANDLED ; } +static irqreturn_t rvu_cpt_af_flt0_intr_handler (int irq,void *ptr) +{ +return cpt_af_flt_intr_handler (CPT_AF_INT_VEC_FLT0 , ptr); +} + +static irqreturn_t rvu_cpt_af_flt1_intr_handler (int irq,void *ptr) +{ +return cpt_af_flt_intr_handler (CPT_AF_INT_VEC_FLT1 , ptr); +} + +static irqreturn_t rvu_cpt_af_flt2_intr_handler (int irq,void *ptr) +{ +return cpt_af_flt_intr_handler (CPT_10K_AF_INT_VEC_FLT2 , ptr); +} +static irqreturn_t rvu_cpt_af_rvu_intr_handler (int irq,void *ptr) {struct rvu_block *block = ptr;
@@ -119,8 +145,10 @@ static void cpt_10k_unregister_interrupts(struct rvu_block *block, int off)int i;/* Disable all CPT AF interrupts */ -for (i =0 ; i <CPT_10K_AF_INT_VEC_RVU ; i++) -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1C (i),0x1 ); +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1C (0 ), ~0ULL ); +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1C (1 ), ~0ULL ); +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1C (2 ),0xFFFF ); +rvu_write64 (rvu, blkaddr,CPT_AF_RVU_INT_ENA_W1C ,0x1 );rvu_write64 (rvu, blkaddr,CPT_AF_RAS_INT_ENA_W1C ,0x1 );
@@ -151,7 +179,7 @@ static void cpt_unregister_interrupts(struct rvu *rvu, int blkaddr)/* Disable all CPT AF interrupts */ for (i =0 ; i <CPT_AF_INT_VEC_RVU ; i++) -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1C (i),0x1 ); +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1C (i), ~0ULL );rvu_write64 (rvu, blkaddr,CPT_AF_RVU_INT_ENA_W1C ,0x1 );rvu_write64 (rvu, blkaddr,CPT_AF_RAS_INT_ENA_W1C ,0x1 );
@@ -172,16 +200,31 @@ static int cpt_10k_register_interrupts(struct rvu_block *block, int off) {struct rvu *rvu = block->rvu;int blkaddr = block->addr; +irq_handler_t flt_fn;int i, ret;for (i =CPT_10K_AF_INT_VEC_FLT0 ; i <CPT_10K_AF_INT_VEC_RVU ; i++) {sprintf (&rvu->irq_name[(off + i) *NAME_SIZE ],"CPTAF FLT%d" , i); + +switch (i) { +case CPT_10K_AF_INT_VEC_FLT0 : + flt_fn = rvu_cpt_af_flt0_intr_handler; +break ; +case CPT_10K_AF_INT_VEC_FLT1 : + flt_fn = rvu_cpt_af_flt1_intr_handler; +break ; +case CPT_10K_AF_INT_VEC_FLT2 : + flt_fn = rvu_cpt_af_flt2_intr_handler; +break ; + } ret =rvu_cpt_do_register_interrupt (block, off + i, - rvu_cpt_af_flt_intr_handler, - &rvu->irq_name[(off + i) *NAME_SIZE ]); + flt_fn, &rvu->irq_name[(off + i) *NAME_SIZE ]);if (ret) goto err; -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1S (i),0x1 ); +if (i ==CPT_10K_AF_INT_VEC_FLT2 ) +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1S (i),0xFFFF ); +else +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1S (i), ~0ULL ); } ret = rvu_cpt_do_register_interrupt(block, off + CPT_10K_AF_INT_VEC_RVU,
@@ -208,8 +251,8 @@ static int cpt_register_interrupts(struct rvu *rvu, int blkaddr) {struct rvu_hwinfo *hw = rvu->hw;struct rvu_block *block; +irq_handler_t flt_fn;int i, offs, ret =0 ; -char irq_name[16 ];if (!is_block_implemented (rvu->hw, blkaddr))return 0 ;
@@ -226,13 +269,20 @@ static int cpt_register_interrupts(struct rvu *rvu, int blkaddr)return cpt_10k_register_interrupts (block, offs);for (i =CPT_AF_INT_VEC_FLT0 ; i <CPT_AF_INT_VEC_RVU ; i++) { -snprintf (irq_name,sizeof (irq_name),"CPTAF FLT%d" , i); +sprintf (&rvu->irq_name[(offs + i) *NAME_SIZE ],"CPTAF FLT%d" , i); +switch (i) { +case CPT_AF_INT_VEC_FLT0 : + flt_fn = rvu_cpt_af_flt0_intr_handler; +break ; +case CPT_AF_INT_VEC_FLT1 : + flt_fn = rvu_cpt_af_flt1_intr_handler; +break ; + } ret =rvu_cpt_do_register_interrupt (block, offs + i, - rvu_cpt_af_flt_intr_handler, - irq_name); + flt_fn, &rvu->irq_name[(offs + i) *NAME_SIZE ]);if (ret) goto err; -rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1S (i),0x1 ); +rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT_ENA_W1S (i), ~0ULL ); } ret = rvu_cpt_do_register_interrupt(block, offs + CPT_AF_INT_VEC_RVU,
Signature · 1 line
2.25.1
PATCH v2 2/8 octeontx2-af: add mbox for CPT LF reset
In reply to Srujana ChallaAdds a new mailbox to reset a requested CPT LF.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 8 +++++ .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +8 -0
@@ -195,6 +195,7 @@ M(CPT_STATS, 0xA05, cpt_sts, cpt_sts_req, cpt_sts_rsp) \M (CPT_RXC_TIME_CFG ,0xA06 , cpt_rxc_time_cfg, cpt_rxc_time_cfg_req, \ msg_rsp) \ M(CPT_CTX_CACHE_SYNC, 0xA07, cpt_ctx_cache_sync, msg_req, msg_rsp) \ +M (CPT_LF_RESET ,0xA08 , cpt_lf_reset, cpt_lf_rst_req, msg_rsp) \ /* SDP mbox IDs (range 0x1000 - 0x11FF) */ \ M(SET_SDP_CHAN_INFO, 0x1000, set_sdp_chan_info, sdp_chan_info_msg, msg_rsp) \M (GET_SDP_CHAN_INFO ,0x1001 , get_sdp_chan_info, msg_req, sdp_get_chan_info_msg) \
@@ -1692,6 +1693,13 @@ struct cpt_inst_lmtst_req {u64 rsvd; }; +/* Mailbox message format to request for CPT LF reset */ +struct cpt_lf_rst_req { +struct mbox_msghdr hdr; +u32 slot; +u32 rsvd; +}; +struct sdp_node_info {/* Node to which this PF belons to */ u8 node_id;
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +33 -0
@@ -851,6 +851,39 @@ int rvu_mbox_handler_cpt_ctx_cache_sync(struct rvu *rvu, struct msg_req *req,return rvu_cpt_ctx_flush (rvu, req->hdr.pcifunc); } +int rvu_mbox_handler_cpt_lf_reset (struct rvu *rvu,struct cpt_lf_rst_req *req, +struct msg_rsp *rsp) +{ +u16 pcifunc = req->hdr.pcifunc; +struct rvu_block *block; +int cptlf, blkaddr, ret; +u16 actual_slot; +u64 ctl, ctl2; + + blkaddr =rvu_get_blkaddr_from_slot (rvu,BLKTYPE_CPT , pcifunc, + req->slot, &actual_slot); +if (blkaddr <0 ) +return CPT_AF_ERR_LF_INVALID ; + + block = &rvu->hw->block[blkaddr]; + + cptlf =rvu_get_lf (rvu, block, pcifunc, actual_slot); +if (cptlf <0 ) +return CPT_AF_ERR_LF_INVALID ; + ctl =rvu_read64 (rvu, blkaddr,CPT_AF_LFX_CTL (cptlf)); + ctl2 =rvu_read64 (rvu, blkaddr,CPT_AF_LFX_CTL2 (cptlf)); + + ret =rvu_lf_reset (rvu, block, cptlf); +if (ret) +dev_err (rvu->dev,"Failed to reset blkaddr %d LF%d\n" , + block->addr, cptlf); + +rvu_write64 (rvu, blkaddr,CPT_AF_LFX_CTL (cptlf), ctl); +rvu_write64 (rvu, blkaddr,CPT_AF_LFX_CTL2 (cptlf), ctl2); + +return 0 ; +} +static void cpt_rxc_teardown (struct rvu *rvu,int blkaddr) {struct cpt_rxc_time_cfg_req req;
Signature · 1 line
2.25.1
PATCH v2 3/8 octeontx2-af: modify FLR sequence for CPT
In reply to Srujana ChallaThe existing FLR sequence mentioned in HRM requires a dummy LMTST to CPT but LMTST can't be submitted through BAR2 ALIAS registers. So, HW team provided a new sequence to avoid dummy LMTST. This patch adds code for the same.
--- .../net/ethernet/marvell/octeontx2/af/rvu.h | 12 +++ .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 86 +++++++++---------- .../ethernet/marvell/octeontx2/af/rvu_reg.h | 2 + 3 files changed, 53 insertions(+), 47 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +12 -0
@@ -459,6 +459,7 @@ struct rvu {struct rvu_pfvf *pf;struct rvu_pfvf *hwvf;struct mutex rsrc_lock;/* Serialize resource alloc/free */ +struct mutex alias_lock;/* Serialize bar2 alias access */ int vfs;/* Number of VFs attached to RVU */ int nix_blkaddr[MAX_NIX_BLKS ];
@@ -546,6 +547,17 @@ static inline u64 rvupf_read64(struct rvu *rvu, u64 offset)return readq (rvu->pfreg_base + offset); } +static inline void rvu_bar2_sel_write64 (struct rvu *rvu,u64 block,u64 offset,u64 val) +{ +/* HW requires read back of RVU_AF_BAR2_SEL register to make sure completion of +* write operation. +*/ +rvu_write64 (rvu, block, offset, val); +rvu_read64 (rvu, block, offset); +/* Barrier to ensure read completes before accessing LF registers */ +mb (); +} +/* Silicon revisions */ static inline bool is_rvu_pre_96xx_C0 (struct rvu *rvu) {
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +39 -47
139 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +2 -0
@@ -545,6 +545,8 @@#define CPT_LF_CTL 0x10#define CPT_LF_INPROG 0x40 +#define CPT_LF_Q_SIZE 0x100 +#define CPT_LF_Q_INST_PTR 0x110#define CPT_LF_Q_GRP_PTR 0x120#define CPT_LF_CTX_FLUSH 0x510
Signature · 1 line
2.25.1
PATCH v2 4/8 octeontx2-af: optimize cpt pf identification
In reply to Srujana ChallaOptimize CPT PF identification in mbox handling for faster mbox response by doing it at AF driver probe instead of every mbox message.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 8 ++++++++ drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 ++ drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c | 13 ++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +8 -0
@@ -1164,8 +1164,16 @@ static int rvu_setup_hw_resources(struct rvu *rvu) goto nix_err; } + err =rvu_cpt_init (rvu); +if (err) { +dev_err (rvu->dev,"%s: Failed to initialize cpt\n" , __func__); + goto mcs_err; + } +return 0 ; +mcs_err: +rvu_mcs_exit (rvu); nix_err:rvu_nix_freemem (rvu); npa_err:
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
@@ -511,6 +511,7 @@ struct rvu {struct ptp *ptp;int mcs_blk_cnt; +int cpt_pf_num;#ifdef CONFIG_DEBUG_FS struct rvu_debugfs rvu_dbg;
@@ -877,6 +878,7 @@ void rvu_cpt_unregister_interrupts(struct rvu *rvu);int rvu_cpt_lf_teardown (struct rvu *rvu,u16 pcifunc,int blkaddr,int lf,int slot);int rvu_cpt_ctx_flush (struct rvu *rvu,u16 pcifunc); +int rvu_cpt_init (struct rvu *rvu);/* CN10K RVU */ int rvu_set_channels_base (struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +10 -3
@@ -340,7 +340,7 @@ static int get_cpt_pf_num(struct rvu *rvu)static bool is_cpt_pf (struct rvu *rvu,u16 pcifunc) { -int cpt_pf_num =get_cpt_pf_num (rvu); +int cpt_pf_num = rvu->cpt_pf_num;if (rvu_get_pf (pcifunc) != cpt_pf_num)return false;
@@ -352,7 +352,7 @@ static bool is_cpt_pf(struct rvu *rvu, u16 pcifunc)static bool is_cpt_vf (struct rvu *rvu,u16 pcifunc) { -int cpt_pf_num =get_cpt_pf_num (rvu); +int cpt_pf_num = rvu->cpt_pf_num;if (rvu_get_pf (pcifunc) != cpt_pf_num)return false;
@@ -1015,7 +1015,7 @@ int rvu_cpt_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int lf, int sstatic int cpt_inline_inb_lf_cmd_send (struct rvu *rvu,int blkaddr,int nix_blkaddr) { -int cpt_pf_num =get_cpt_pf_num (rvu); +int cpt_pf_num = rvu->cpt_pf_num;struct cpt_inst_lmtst_req *req;dma_addr_t res_daddr;int timeout =3000 ;
@@ -1159,3 +1159,10 @@ int rvu_cpt_ctx_flush(struct rvu *rvu, u16 pcifunc)return 0 ; } + +int rvu_cpt_init (struct rvu *rvu) +{ +/* Retrieve CPT PF number */ + rvu->cpt_pf_num =get_cpt_pf_num (rvu); +return 0 ; +}
Signature · 1 line
2.25.1
PATCH v2 5/8 octeontx2-af: restore rxc conf after teardown sequence
In reply to Srujana ChallaFrom: Nithin Dabilpuram <[email protected]>
Restore rxc timeout and threshold config after teardown sequence is complete as it is global config and not per CPT LF.
--- .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +18 -4
@@ -812,10 +812,21 @@ int rvu_mbox_handler_cpt_sts(struct rvu *rvu, struct cpt_sts_req *req,#define RXC_ZOMBIE_COUNT GENMASK_ULL(60, 48)static void cpt_rxc_time_cfg (struct rvu *rvu,struct cpt_rxc_time_cfg_req *req, -int blkaddr) +int blkaddr,struct cpt_rxc_time_cfg_req *save) {u64 dfrg_reg; +if (save) { +/* Save older config */ + dfrg_reg =rvu_read64 (rvu, blkaddr,CPT_AF_RXC_DFRG ); + save->zombie_thres =FIELD_GET (RXC_ZOMBIE_THRES , dfrg_reg); + save->zombie_limit =FIELD_GET (RXC_ZOMBIE_LIMIT , dfrg_reg); + save->active_thres =FIELD_GET (RXC_ACTIVE_THRES , dfrg_reg); + save->active_limit =FIELD_GET (RXC_ACTIVE_LIMIT , dfrg_reg); + + save->step =rvu_read64 (rvu, blkaddr,CPT_AF_RXC_TIME_CFG ); + } + dfrg_reg =FIELD_PREP (RXC_ZOMBIE_THRES , req->zombie_thres); dfrg_reg |=FIELD_PREP (RXC_ZOMBIE_LIMIT , req->zombie_limit); dfrg_reg |=FIELD_PREP (RXC_ACTIVE_THRES , req->active_thres);
@@ -840,7 +851,7 @@ int rvu_mbox_handler_cpt_rxc_time_cfg(struct rvu *rvu, !is_cpt_vf(rvu, req->hdr.pcifunc))return CPT_AF_ERR_ACCESS_DENIED ; -cpt_rxc_time_cfg (rvu, req, blkaddr); +cpt_rxc_time_cfg (rvu, req, blkaddr,NULL );return 0 ; }
@@ -886,7 +897,7 @@ int rvu_mbox_handler_cpt_lf_reset(struct rvu *rvu, struct cpt_lf_rst_req *req,static void cpt_rxc_teardown (struct rvu *rvu,int blkaddr) { -struct cpt_rxc_time_cfg_req req; +struct cpt_rxc_time_cfg_req req, prev;int timeout =2000 ;u64 reg;
@@ -902,7 +913,7 @@ static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr) req.active_thres =1 ; req.active_limit =1 ; -cpt_rxc_time_cfg (rvu, &req, blkaddr); +cpt_rxc_time_cfg (rvu, &req, blkaddr, &prev); do { reg = rvu_read64(rvu, blkaddr, CPT_AF_RXC_ACTIVE_STS);
@@ -928,6 +939,9 @@ static void cpt_rxc_teardown(struct rvu *rvu, int blkaddr)if (timeout ==0 )dev_warn (rvu->dev,"Poll for RXC zombie count hits hard loop counter\n" ); + +/* Restore config */ +cpt_rxc_time_cfg (rvu, &prev, blkaddr,NULL ); }#define INFLIGHT GENMASK_ULL(8, 0)
Signature · 1 line
2.25.1
PATCH v2 1/1 octeontx2-af: update CPT inbound inline IPsec config mailbox
In reply to Srujana ChallaUpdates CPT inbound inline IPsec configure mailbox to take CPT credit, opcode, credit_th and bpid from VF. This patch also adds a mailbox to read inbound IPsec configuration.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 6 ++- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 46 +++++++++++++++++-- 2 files changed, 47 insertions(+), 5 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +5 -1
@@ -298,6 +298,8 @@ M(NIX_BANDPROF_FREE, 0x801e, nix_bandprof_free, nix_bandprof_free_req, \ msg_rsp) \ M(NIX_BANDPROF_GET_HWINFO, 0x801f, nix_bandprof_get_hwinfo, msg_req, \ nix_bandprof_get_hwinfo_rsp) \ +M(NIX_READ_INLINE_IPSEC_CFG, 0x8023, nix_read_inline_ipsec_cfg, \ + msg_req, nix_inline_ipsec_cfg) \ /* MCS mbox IDs (range 0xA000 - 0xBFFF) */ \ M(MCS_ALLOC_RESOURCES, 0xa000, mcs_alloc_resources, mcs_alloc_rsrc_req, \ mcs_alloc_rsrc_rsp) \
@@ -1197,7 +1199,7 @@ struct nix_inline_ipsec_cfg {u32 cpt_credit;struct {u8 egrp; -u8 opcode; +u16 opcode;u16 param1;u16 param2; } gen_cfg;
@@ -1206,6 +1208,8 @@ struct nix_inline_ipsec_cfg {u8 cpt_slot; } inst_qsel;u8 enable; +u16 bpid; +u32 credit_th; };/* Per NIX LF inline IPSec configuration */
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +42 -4
74 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v2 net-next,/8] octeontx2-af: update CPT inbound inline IPsec config mailbox
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Wed, 11 Jan 2023 17:53:41 +0530 you wrote:
Updates CPT inbound inline IPsec configure mailbox to take CPT credit, opcode,
credit_thand bpid from VF. This patch also adds a mailbox to read inbound IPsec configuration.Signed-off-by Srujana Challa <[email protected]>[...]
Here is the summary with links:
- [v2,net-next,/8] octeontx2-af: update CPT inbound inline IPsec config mailbox
https://git.kernel.org/netdev/net-next/c/5129bd8e8840
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
PATCH v2 7/8 octeontx2-af: add ctx ilen to cpt lf alloc mailbox
In reply to Srujana ChallaAdds ctx_ilen to CPT_LF_ALLOC mailbox to provide the provison to user to give CPT_AF_LFX_CTL:ctx_ilen.
--- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 2 ++ drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2 -0
@@ -1614,6 +1614,8 @@ struct cpt_lf_alloc_req_msg {u16 sso_pf_func;u16 eng_grpmsk;int blkaddr; + u8 ctx_ilen_valid : 1; + u8 ctx_ilen : 7; };#define CPT_INLINE_INBOUND 0
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +7 -3
@@ -17,7 +17,7 @@#define PCI_DEVID_OTX2_CPT10K_PF 0xA0F2/* Length of initial context fetch in 128 byte words */ -#define CPT_CTX_ILEN 2ULL +#define CPT_CTX_ILEN 1ULL#define cpt_get_eng_sts (e_min, e_max, rsp, etype) \ ({ \
@@ -421,8 +421,12 @@ int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu,/* Set CPT LF group and priority */ val = (u64 )req->eng_grpmsk <<48 |1 ; -if (!is_rvu_otx2 (rvu)) - val |= (CPT_CTX_ILEN <<17 ); +if (!is_rvu_otx2 (rvu)) { +if (req->ctx_ilen_valid) + val |= (req->ctx_ilen <<17 ); +else + val |= (CPT_CTX_ILEN <<17 ); + }rvu_write64 (rvu, blkaddr,CPT_AF_LFX_CTL (cptlf), val);
Signature · 1 line
2.25.1
PATCH v2 8/8 octeontx2-af: add mbox to return CPT_AF_FLT_INT info
In reply to Srujana ChallaAdds a new mailbox to return CPT faulted engines bitmap and recovered engines bitmap.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 17 +++++++++ .../net/ethernet/marvell/octeontx2/af/rvu.h | 4 +++ .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 35 +++++++++++++++++++ 3 files changed, 56 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +17 -0
@@ -196,6 +196,8 @@ M(CPT_RXC_TIME_CFG, 0xA06, cpt_rxc_time_cfg, cpt_rxc_time_cfg_req, \ msg_rsp) \ M(CPT_CTX_CACHE_SYNC, 0xA07, cpt_ctx_cache_sync, msg_req, msg_rsp) \ M(CPT_LF_RESET, 0xA08, cpt_lf_reset, cpt_lf_rst_req, msg_rsp) \ +M(CPT_FLT_ENG_INFO, 0xA09, cpt_flt_eng_info, cpt_flt_eng_info_req, \ + cpt_flt_eng_info_rsp) \ /* SDP mbox IDs (range 0x1000 - 0x11FF) */ \ M(SET_SDP_CHAN_INFO, 0x1000, set_sdp_chan_info, sdp_chan_info_msg, msg_rsp) \ M(GET_SDP_CHAN_INFO, 0x1001, get_sdp_chan_info, msg_req, sdp_get_chan_info_msg) \
@@ -1706,6 +1708,21 @@ struct cpt_lf_rst_req {u32 rsvd; }; +/* Mailbox message format to request for CPT faulted engines */ +struct cpt_flt_eng_info_req { +struct mbox_msghdr hdr; +int blkaddr; +bool reset; +u32 rsvd; +}; + +struct cpt_flt_eng_info_rsp { +struct mbox_msghdr hdr; +u64 flt_eng_map[CPT_10K_AF_INT_VEC_RVU ]; +u64 rcvrd_eng_map[CPT_10K_AF_INT_VEC_RVU ]; +u64 rsvd; +}; +struct sdp_node_info {/* Node to which this PF belons to */ u8 node_id;
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +4 -0
@@ -108,6 +108,8 @@ struct rvu_block {u64 lfreset_reg;unsigned char name[NAME_SIZE ];struct rvu *rvu; +u64 cpt_flt_eng_map[3 ]; +u64 cpt_rcvrd_eng_map[3 ]; };struct nix_mcast {
@@ -526,6 +528,8 @@ struct rvu {struct list_head mcs_intrq_head;/* mcs interrupt queue lock */ spinlock_t mcs_intrq_lock; +/* CPT interrupt lock */ +spinlock_t cpt_intr_lock; };static inline void rvu_write64 (struct rvu *rvu,u64 block,u64 offset,u64 val)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +35 -0
@@ -70,6 +70,14 @@ static irqreturn_t cpt_af_flt_intr_handler(int vec, void *ptr)rvu_write64 (rvu, blkaddr,CPT_AF_EXEX_CTL2 (eng), grp);rvu_write64 (rvu, blkaddr,CPT_AF_EXEX_CTL (eng), val |1ULL ); + +spin_lock (&rvu->cpt_intr_lock); + block->cpt_flt_eng_map[vec] |=BIT_ULL (i); + val =rvu_read64 (rvu, blkaddr,CPT_AF_EXEX_STS (eng)); + val = val &0x3 ; +if (val ==0x1 || val ==0x2 ) + block->cpt_rcvrd_eng_map[vec] |=BIT_ULL (i); +spin_unlock (&rvu->cpt_intr_lock); }rvu_write64 (rvu, blkaddr,CPT_AF_FLTX_INT (vec), reg);
@@ -899,6 +907,31 @@ int rvu_mbox_handler_cpt_lf_reset(struct rvu *rvu, struct cpt_lf_rst_req *req,return 0 ; } +int rvu_mbox_handler_cpt_flt_eng_info (struct rvu *rvu,struct cpt_flt_eng_info_req *req, +struct cpt_flt_eng_info_rsp *rsp) +{ +struct rvu_block *block; +unsigned long flags; +int blkaddr, vec; + + blkaddr =validate_and_get_cpt_blkaddr (req->blkaddr); +if (blkaddr <0 ) +return blkaddr; + + block = &rvu->hw->block[blkaddr]; +for (vec =0 ; vec <CPT_10K_AF_INT_VEC_RVU ; vec++) { +spin_lock_irqsave (&rvu->cpt_intr_lock, flags); + rsp->flt_eng_map[vec] = block->cpt_flt_eng_map[vec]; + rsp->rcvrd_eng_map[vec] = block->cpt_rcvrd_eng_map[vec]; +if (req->reset) { + block->cpt_flt_eng_map[vec] =0x0 ; + block->cpt_rcvrd_eng_map[vec] =0x0 ; + } +spin_unlock_irqrestore (&rvu->cpt_intr_lock, flags); + } +return 0 ; +} +static void cpt_rxc_teardown (struct rvu *rvu,int blkaddr) {struct cpt_rxc_time_cfg_req req, prev;
@@ -1182,5 +1215,7 @@ int rvu_cpt_init(struct rvu *rvu) {/* Retrieve CPT PF number */ rvu->cpt_pf_num =get_cpt_pf_num (rvu); +spin_lock_init (&rvu->cpt_intr_lock); +return 0 ; }
Signature · 1 line
2.25.1
Quoted 19 lines · Srujana Challa
This patchset consists of miscellaneous changes for CPT.
- Adds a new mailbox to reset the requested CPT LF.
- Modify FLR sequence as per HW team suggested.
- Adds support to recover CPT engines when they gets fault.
- Updates CPT inbound inline IPsec configuration mailbox, as per new generation of the OcteonTX2 chips.
- Adds a new mailbox to return CPT FLT Interrupt info.---
v2:
- Addressed a review comment.
v1:
- Dropped patch "octeontx2-af: Fix interrupt name strings completely" to submit to net.
---Nithin Dabilpuram (1):
octeontx2-af: restore rxc conf after teardown sequence
Quoted 9 lines
Srujana Challa (7):
octeontx2-af: recover CPT engine when it gets fault
octeontx2-af: add mbox for CPT LF reset
octeontx2-af: modify FLR sequence for CPT
octeontx2-af: optimize cpt pf identification
octeontx2-af: update CPT inbound inline IPsec config mailbox
octeontx2-af: add ctx ilen to cpt lf alloc mailbox
octeontx2-af: add mbox to returnCPT_AF_FLT_INTinfo
Except not-so-great commit messages and huge amount of timeout loops in patch #3, the series is ok.
Thanks,