Skip to content

Commit

Permalink
octeontx2-af: update cpt lf alloc mailbox
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
SruChalla authored and kuba-moo committed Jan 20, 2023
1 parent e2784ac commit d1e1de1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/marvell/octeontx2/af/mbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
({ \
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit d1e1de1

Please sign in to comment.