Skip to content

Commit d1e1de1

Browse files
SruChallakuba-moo
authored andcommitted
octeontx2-af: update cpt lf alloc mailbox
The CN10K CPT coprocessor contains a context processor to accelerate updates to the IPsec security association contexts. The context processor contains a context cache. This patch updates CPT LF ALLOC mailbox to config ctx_ilen requested by VFs. CPT_LF_ALLOC:ctx_ilen is the size of initial context fetch. Signed-off-by: Srujana Challa <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e2784ac commit d1e1de1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/net/ethernet/marvell/octeontx2/af/mbox.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,8 @@ struct cpt_lf_alloc_req_msg {
16141614
u16 sso_pf_func;
16151615
u16 eng_grpmsk;
16161616
int blkaddr;
1617+
u8 ctx_ilen_valid : 1;
1618+
u8 ctx_ilen : 7;
16171619
};
16181620

16191621
#define CPT_INLINE_INBOUND 0

drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define PCI_DEVID_OTX2_CPT10K_PF 0xA0F2
1818

1919
/* Length of initial context fetch in 128 byte words */
20-
#define CPT_CTX_ILEN 2ULL
20+
#define CPT_CTX_ILEN 1ULL
2121

2222
#define cpt_get_eng_sts(e_min, e_max, rsp, etype) \
2323
({ \
@@ -421,8 +421,12 @@ int rvu_mbox_handler_cpt_lf_alloc(struct rvu *rvu,
421421

422422
/* Set CPT LF group and priority */
423423
val = (u64)req->eng_grpmsk << 48 | 1;
424-
if (!is_rvu_otx2(rvu))
425-
val |= (CPT_CTX_ILEN << 17);
424+
if (!is_rvu_otx2(rvu)) {
425+
if (req->ctx_ilen_valid)
426+
val |= (req->ctx_ilen << 17);
427+
else
428+
val |= (CPT_CTX_ILEN << 17);
429+
}
426430

427431
rvu_write64(rvu, blkaddr, CPT_AF_LFX_CTL(cptlf), val);
428432

0 commit comments

Comments
 (0)