Add support for CN10K CPT block
v2 cover Add support for CN10K CPT block
OcteonTX3 (CN10K) silicon is a Marvell next-gen silicon. CN10K CPT introduces new features like reassembly support and some feature enhancements.
This patchset adds new mailbox messages and some minor changes to existing mailbox messages to support CN10K CPT.
v1-v2
Fixed sparse warnings.
Srujana Challa (3):
octeontx2-af: cn10k: Mailbox changes for CN10K CPT
octeontx2-af: cn10k: Add mailbox to configure reassembly timeout
octeontx2-af: Add mailbox for CPT stats
.../net/ethernet/marvell/octeontx2/af/mbox.h | 61 ++++++ .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 192 +++++++++++++++++- .../ethernet/marvell/octeontx2/af/rvu_reg.h | 21 ++ 3 files changed, 266 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/3 octeontx2-af: cn10k: Mailbox changes for CN10K CPT
Adds changes to existing CPT mailbox messages to support CN10K CPT block. This patch also adds new register defines for CN10K CPT.
--- .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 11 +++++++++- .../ethernet/marvell/octeontx2/af/rvu_reg.h | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +10 -1
@@ -9,6 +9,10 @@/* CPT PF device id */ #define PCI_DEVID_OTX2_CPT_PF 0xA0FD +#define PCI_DEVID_OTX2_CPT10K_PF 0xA0F2 + +/* Length of initial context fetch in 128 byte words */ +#define CPT_CTX_ILEN 2static int get_cpt_pf_num (struct rvu *rvu) {
@@ -21,7 +25,8 @@ static int get_cpt_pf_num(struct rvu *rvu)if (!pdev)continue ; -if (pdev->device ==PCI_DEVID_OTX2_CPT_PF ) { +if (pdev->device ==PCI_DEVID_OTX2_CPT_PF || + pdev->device ==PCI_DEVID_OTX2_CPT10K_PF ) { cpt_pf_num = i;put_device (&pdev->dev);break ;
@@ -103,6 +108,9 @@ 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 ); +rvu_write64 (rvu, blkaddr,CPT_AF_LFX_CTL (cptlf), val);/* Set CPT LF NIX_PF_FUNC and SSO_PF_FUNC */
@@ -192,6 +200,7 @@ static bool is_valid_offset(struct rvu *rvu, struct cpt_rd_wr_reg_msg *req)case CPT_AF_PF_FUNC :case CPT_AF_BLK_RST :case CPT_AF_CONSTANTS1 : +case CPT_AF_CTX_FLUSH_TIMER :return true; }
drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +21 -0
@@ -494,6 +494,27 @@#define CPT_AF_RAS_INT_W1S (0x47028)#define CPT_AF_RAS_INT_ENA_W1S (0x47030)#define CPT_AF_RAS_INT_ENA_W1C (0x47038) +#define CPT_AF_CTX_FLUSH_TIMER (0x48000ull) +#define CPT_AF_CTX_ERR (0x48008ull) +#define CPT_AF_CTX_ENC_ID (0x48010ull) +#define CPT_AF_CTX_MIS_PC (0x49400ull) +#define CPT_AF_CTX_HIT_PC (0x49408ull) +#define CPT_AF_CTX_AOP_PC (0x49410ull) +#define CPT_AF_CTX_AOP_LATENCY_PC (0x49418ull) +#define CPT_AF_CTX_IFETCH_PC (0x49420ull) +#define CPT_AF_CTX_IFETCH_LATENCY_PC (0x49428ull) +#define CPT_AF_CTX_FFETCH_PC (0x49430ull) +#define CPT_AF_CTX_FFETCH_LATENCY_PC (0x49438ull) +#define CPT_AF_CTX_WBACK_PC (0x49440ull) +#define CPT_AF_CTX_WBACK_LATENCY_PC (0x49448ull) +#define CPT_AF_CTX_PSH_PC (0x49450ull) +#define CPT_AF_CTX_PSH_LATENCY_PC (0x49458ull) +#define CPT_AF_RXC_TIME (0x50010ull) +#define CPT_AF_RXC_TIME_CFG (0x50018ull) +#define CPT_AF_RXC_DFRG (0x50020ull) +#define CPT_AF_RXC_ACTIVE_STS (0x50028ull) +#define CPT_AF_RXC_ZOMBIE_STS (0x50030ull) +#define CPT_AF_X2PX_LINK_CFG (a) (0x51000ull | (u64)(a) << 3)#define AF_BAR2_ALIASX (a, b) (0x9100000ull | (a) << 12 | (b))#define CPT_AF_BAR2_SEL 0x9000000
Signature · 1 line
2.25.1
PATCH v2 2/3 octeontx2-af: cn10k: Add mailbox to configure reassembly timeout
In reply to Srujana ChallaCN10K CPT coprocessor includes a component named RXC which is responsible for reassembly of inner IP packets. RXC has the feature to evict oldest entries based on age/threshold. This patch adds a new mailbox to configure reassembly age or threshold.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 13 ++++ .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 69 +++++++++++++++++-- 2 files changed, 75 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +13 -0
@@ -177,6 +177,8 @@ M(CPT_LF_ALLOC, 0xA00, cpt_lf_alloc, cpt_lf_alloc_req_msg, \ M(CPT_LF_FREE, 0xA01, cpt_lf_free, msg_req, msg_rsp) \M (CPT_RD_WR_REGISTER ,0xA02 , cpt_rd_wr_register, cpt_rd_wr_reg_msg, \ cpt_rd_wr_reg_msg) \ +M (CPT_RXC_TIME_CFG ,0xA06 , cpt_rxc_time_cfg, cpt_rxc_time_cfg_req, \ + msg_rsp) \ /* NPC mbox IDs (range 0x6000 - 0x7FFF) */ \M (NPC_MCAM_ALLOC_ENTRY ,0x6000 , npc_mcam_alloc_entry, npc_mcam_alloc_entry_req,\ npc_mcam_alloc_entry_rsp) \
@@ -1255,4 +1257,15 @@ struct cpt_lf_alloc_req_msg { int blkaddr; }; +/* Mailbox message request format to configure reassembly timeout. */ +struct cpt_rxc_time_cfg_req { +struct mbox_msghdr hdr; +int blkaddr; +u32 step; +u16 zombie_thres; +u16 zombie_limit; +u16 active_thres; +u16 active_limit; +}; +#endif /* MBOX_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +62 -7
105 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v2 3/3 octeontx2-af: Add mailbox for CPT stats
In reply to Srujana ChallaAdds a new mailbox to get CPT stats, includes performance counters, CPT engines status and RXC status.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 48 ++++++++ .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 112 ++++++++++++++++++ 2 files changed, 160 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +48 -0
@@ -177,6 +177,7 @@ M(CPT_LF_ALLOC, 0xA00, cpt_lf_alloc, cpt_lf_alloc_req_msg, \ M(CPT_LF_FREE, 0xA01, cpt_lf_free, msg_req, msg_rsp) \M (CPT_RD_WR_REGISTER ,0xA02 , cpt_rd_wr_register, cpt_rd_wr_reg_msg, \ cpt_rd_wr_reg_msg) \ +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) \/* NPC mbox IDs (range 0x6000 - 0x7FFF) */ \
@@ -1257,6 +1258,53 @@ struct cpt_lf_alloc_req_msg {int blkaddr; }; +/* Mailbox message request and response format for CPT stats. */ +struct cpt_sts_req { +struct mbox_msghdr hdr; +u8 blkaddr; +}; + +struct cpt_sts_rsp { +struct mbox_msghdr hdr; +u64 inst_req_pc; +u64 inst_lat_pc; +u64 rd_req_pc; +u64 rd_lat_pc; +u64 rd_uc_pc; +u64 active_cycles_pc; +u64 ctx_mis_pc; +u64 ctx_hit_pc; +u64 ctx_aop_pc; +u64 ctx_aop_lat_pc; +u64 ctx_ifetch_pc; +u64 ctx_ifetch_lat_pc; +u64 ctx_ffetch_pc; +u64 ctx_ffetch_lat_pc; +u64 ctx_wback_pc; +u64 ctx_wback_lat_pc; +u64 ctx_psh_pc; +u64 ctx_psh_lat_pc; +u64 ctx_err; +u64 ctx_enc_id; +u64 ctx_flush_timer; +u64 rxc_time; +u64 rxc_time_cfg; +u64 rxc_active_sts; +u64 rxc_zombie_sts; +u64 busy_sts_ae; +u64 free_sts_ae; +u64 busy_sts_se; +u64 free_sts_se; +u64 busy_sts_ie; +u64 free_sts_ie; +u64 exe_err_info; +u64 cptclk_cnt; +u64 diag; +u64 rxc_dfrg; +u64 x2p_link_cfg0; +u64 x2p_link_cfg1; +}; +/* Mailbox message request format to configure reassembly timeout. */ struct cpt_rxc_time_cfg_req {struct mbox_msghdr hdr;
drivers/net/ethernet/marvell/octeontx2/af/rvu_cpt.c +112 -0
124 lines not on this page · raw message
Signature · 1 line
2.25.1
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 10 lines · On Wed, 21 Apr 2021 14:52:59 +0530 you wrote:
OcteonTX3 (CN10K) silicon is a Marvell next-gen silicon. CN10K CPT introduces new features like reassembly support and some feature enhancements.
This patchset adds new mailbox messages and some minor changes to existing mailbox messages to support CN10K CPT.v1-v2
Fixed sparse warnings.[...]
Here is the summary with links:
- [v2,1/3] octeontx2-af: cn10k: Mailbox changes for CN10K CPT
https://git.kernel.org/netdev/net-next/c/e4bbc5c53a8f - [v2,2/3] octeontx2-af: cn10k: Add mailbox to configure reassembly timeout https://git.kernel.org/netdev/net-next/c/ecad2ce8c48f - [v2,3/3] octeontx2-af: Add mailbox for CPT stats https://git.kernel.org/netdev/net-next/c/2e2ee4cd0ab5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html