octeontx2-af: Debugfs support and updates to parser profile
v2 cover octeontx2-af: Debugfs support and updates to parser profile
From: Sunil Goutham <[email protected]>
This patchset adds debugfs support to dump various HW state machine info which helps in debugging issues. Info includes
- Current queue context, stats, resource utilization etc
- MCAM entry utilization, miss and pkt drop counter
- CGX ingress and egress stats
- Current RVU block allocation status
- etc.
Rest patches has changes wrt
- Updated packet parsing profile for parsing more protocols.
- RSS algorithms to include inner protocols while generating hash
- Handle current version of silicon's limitations wrt shaping, coloring and fixed mapping of transmit limiter queue's configuration.
- Enable broadcast packet replication to PF and it's VFs.
- Support for configurable NDC cache waymask
- etc
Changes from v1:
Removed inline keyword for newly introduced APIs in few patches.
- Suggested by David Miller.
Christina Jacob (2):
octeontx2-af: Dump current resource provisioning status
octeontx2-af: Add NPA aura and pool contexts to debugfs
Geetha sowjanya (2):
octeontx2-af: Sync hw mbox with bounce buffer.
octeontx2-af: Support configurable NDC cache way_mask
Hao Zheng (1):
octeontx2-af: Update NPC KPU packet parsing profile
Kiran Kumar K (1):
octeontx2-af: Add more RSS algorithms
Linu Cherian (1):
octeontx2-af: Add per CGX port level NIX Rx/Tx counters
Nithin Dabilpuram (1):
octeontx2-af: Clear NPC MCAM entries before update
Prakash Brahmajyosyula (3):
octeontx2-af: Add NIX RQ, SQ and CQ contexts to debugfs
octeontx2-af: Add NDC block stats to debugfs.
octeontx2-af: Add CGX LMAC stats to debugfs
Subbaraya Sundeep (2):
octeontx2-af: Add macro to generate mbox handlers declarations
octeontx2-af: Start/Stop traffic in CGX along with NPC
Sunil Goutham (5):
octeontx2-af: Add NPC MCAM entry allocation status to debugfs
octeontx2-af: Add mbox API to validate all responses
octeontx2-af: Support fixed transmit scheduler topology
octeontx2-af: Enable broadcast packet replication
octeontx2-af: Add option to disable dynamic entry caching in NDC
drivers/net/ethernet/marvell/octeontx2/Kconfig | 10 + drivers/net/ethernet/marvell/octeontx2/af/Makefile | 2 +- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 60 + drivers/net/ethernet/marvell/octeontx2/af/cgx.h | 13 + drivers/net/ethernet/marvell/octeontx2/af/common.h | 16 + drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 87 +- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 28 +- drivers/net/ethernet/marvell/octeontx2/af/npc.h | 95 +- .../ethernet/marvell/octeontx2/af/npc_profile.h | 14946 ++++++++++++++----- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 116 +- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 217 +- .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 129 +- .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 1711 +++ .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 876 +- .../net/ethernet/marvell/octeontx2/af/rvu_npa.c | 55 +- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 187 +- .../net/ethernet/marvell/octeontx2/af/rvu_reg.h | 28 +- .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 36 +- 18 files changed, 14258 insertions(+), 4354 deletions(-) create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
Signature · 1 line
2.7.4
PATCH v2 1/18 octeontx2-af: Dump current resource provisioning status
From: Christina Jacob <[email protected]>
Added support to dump current resource provisioning status of all resource virtualization unit (RVU) block's (i.e NPA, NIX, SSO, SSOW, CPT, TIM) local functions attached to a PF_FUNC into a debugfs file.
'cat /sys/kernel/debug/octeontx2/rsrc_alloc' will show the current block LF's allocation status.
--- drivers/net/ethernet/marvell/octeontx2/af/Makefile | 2 +- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 4 + drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 18 +++ .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 146 +++++++++++++++++++++ 4 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
drivers/net/ethernet/marvell/octeontx2/af/Makefile +1 -1
@@ -8,4 +8,4 @@ obj-$(CONFIG_OCTEONTX2_AF) += octeontx2_af.o octeontx2_mbox-y := mbox.o octeontx2_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o rvu_nix.o \ - rvu_reg.o rvu_npc.o + rvu_reg.o rvu_npc.o rvu_debugfs.o
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +4 -0
@@ -2456,6 +2456,9 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (err) goto err_irq; +/* Initialize debugfs */ +rvu_dbg_init (rvu); +return 0 ; err_irq:rvu_unregister_interrupts (rvu);
@@ -2482,6 +2485,7 @@ static void rvu_remove(struct pci_dev *pdev) {struct rvu *rvu =pci_get_drvdata (pdev); +rvu_dbg_exit (rvu);rvu_unregister_interrupts (rvu);rvu_flr_wq_destroy (rvu);rvu_cgx_exit (rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +18 -0
@@ -35,6 +35,12 @@#define RVU_PFVF_FUNC_SHIFT 0#define RVU_PFVF_FUNC_MASK 0x3FF +#ifdef CONFIG_DEBUG_FS +struct rvu_debugfs { +struct dentry *root; +}; +#endif +struct rvu_work {struct work_struct work;struct rvu *rvu;
@@ -263,6 +269,10 @@ struct rvu {struct list_head cgx_evq_head;/* cgx event queue head */ char mkex_pfl_name[MKEX_NAME_LEN ];/* Configured MKEX profile name */ + +#ifdef CONFIG_DEBUG_FS +struct rvu_debugfs rvu_dbg; +#endif };static inline void rvu_write64 (struct rvu *rvu,u64 block,u64 offset,u64 val)
@@ -501,4 +511,12 @@ int rvu_mbox_handler_npc_mcam_alloc_and_write_entry(struct rvu *rvu, struct npc_mcam_alloc_and_write_entry_rsp *rsp);int rvu_mbox_handler_npc_get_kex_cfg (struct rvu *rvu,struct msg_req *req,struct npc_get_kex_cfg_rsp *rsp); + +#ifdef CONFIG_DEBUG_FS +void rvu_dbg_init (struct rvu *rvu); +void rvu_dbg_exit (struct rvu *rvu); +#else +static inline void rvu_dbg_init (struct rvu *rvu) {} +static inline void rvu_dbg_exit (struct rvu *rvu) {} +#endif #endif /* RVU_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c new file +146 -0
146 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/18 octeontx2-af: Add NPA aura and pool contexts to debugfs
In reply to [email protected]From: Christina Jacob <[email protected]>
To aid in debugging NPA related issues, added support to dump NPA (pool allocator) block LF's aura and pool hardware contexts in debugfs. User can check which contexts are enabled currently and dump it's current HW context.
Three new files 'qsize', 'aura_ctx', 'pool_ctx' are added to the debugfs at 'sys/kernel/debug/octeontx2/npa/'
'echo <npalf index> > qsize' will display current enabled Aura/Pools. 'echo <npalf> [aura number/all] > aura_ctx' &
'echo <npalf> [aura number/all] > pool_ctx' will dump Aura/Pool context info.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 12 + .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 516 +++++++++++++++++++++ .../net/ethernet/marvell/octeontx2/af/rvu_npa.c | 4 +- 3 files changed, 530 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +12 -0
@@ -36,8 +36,18 @@#define RVU_PFVF_FUNC_MASK 0x3FF#ifdef CONFIG_DEBUG_FS +struct dump_ctx { +int lf; +int id; +bool all; +}; +struct rvu_debugfs {struct dentry *root; +struct dentry *npa; +struct dump_ctx npa_aura_ctx; +struct dump_ctx npa_pool_ctx; +int npa_qsize_id; };#endif
@@ -387,6 +397,8 @@ int rvu_mbox_handler_cgx_intlbk_disable(struct rvu *rvu, struct msg_req *req,int rvu_npa_init (struct rvu *rvu);void rvu_npa_freemem (struct rvu *rvu);void rvu_npa_lf_teardown (struct rvu *rvu,u16 pcifunc,int npalf); +int rvu_npa_aq_enq_inst (struct rvu *rvu,struct npa_aq_enq_req *req, +struct npa_aq_enq_rsp *rsp);int rvu_mbox_handler_npa_aq_enq (struct rvu *rvu,struct npa_aq_enq_req *req,struct npa_aq_enq_rsp *rsp);
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +516 -0
534 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c +2 -2
@@ -52,8 +52,8 @@ static int npa_aq_enqueue_wait(struct rvu *rvu, struct rvu_block *block,return 0 ; } -static int rvu_npa_aq_enq_inst (struct rvu *rvu,struct npa_aq_enq_req *req, -struct npa_aq_enq_rsp *rsp) +int rvu_npa_aq_enq_inst (struct rvu *rvu,struct npa_aq_enq_req *req, +struct npa_aq_enq_rsp *rsp) {struct rvu_hwinfo *hw = rvu->hw;u16 pcifunc = req->hdr.pcifunc;
Signature · 1 line
2.7.4
PATCH v2 3/18 octeontx2-af: Add NIX RQ, SQ and CQ contexts to debugfs
In reply to [email protected]From: Prakash Brahmajyosyula <[email protected]>
To aid in debugging NIX block related issues, added support to dump NIX block LF's RQ, SQ and CQ hardware contexts in debugfs. User can check which contexts are enabled currently and dump it's current HW context.
Four new files 'qsize', 'rq_ctx', 'sq_ctx' and 'cq_ctx' are added to the debugfs at 'sys/kernel/debug/octeontx2/nix/'
'echo <nixlf index> > qsize' will display current enabled CQ/SQ/RQs. 'echo <nixlf> [rq number/all] > rq_ctx',
'echo <nixlf> [sq number/all] > sq_ctx' &
'echo <nixlf> [cq number/all] > cq_ctx' will dump RQ/SQ/CQ's current hardware context.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 5 + .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 500 +++++++++++++++++++++ .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 4 +- 3 files changed, 507 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +5 -0
@@ -45,9 +45,14 @@ struct dump_ctx {struct rvu_debugfs {struct dentry *root;struct dentry *npa; +struct dentry *nix;struct dump_ctx npa_aura_ctx;struct dump_ctx npa_pool_ctx; +struct dump_ctx nix_cq_ctx; +struct dump_ctx nix_rq_ctx; +struct dump_ctx nix_sq_ctx;int npa_qsize_id; +int nix_qsize_id; };#endif
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +500 -0
530 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h +2 -2
@@ -474,9 +474,9 @@ struct nix_cq_ctx_s { u64 ena : 1; u64 drop_ena : 1; u64 drop : 8; - u64 dp : 8; + u64 bp : 8;#else - u64 dp : 8; + u64 bp : 8; u64 drop : 8; u64 drop_ena : 1; u64 ena : 1;
Signature · 1 line
2.7.4
PATCH v2 4/18 octeontx2-af: Add NDC block stats to debugfs.
In reply to [email protected]From: Prakash Brahmajyosyula <[email protected]>
NDC is a data cache unit which caches NPA and NIX block's aura/pool/RQ/SQ/CQ/etc contexts to reduce number of costly DRAM accesses.
This patch adds support to dump cache's performance stats like cache line hit/miss counters, average cycles taken for accessing cached and non-cached data. This will help in checking if NPA/NIX context reads/writes are having NDC cache misses which inturn might effect performance.
Also changed NDC enums to reflect correct NDC hardware instance.
--- drivers/net/ethernet/marvell/octeontx2/af/common.h | 16 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 6 +- .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 140 +++++++++++++++++++++ .../net/ethernet/marvell/octeontx2/af/rvu_reg.h | 27 +++- .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 32 ++--- 5 files changed, 201 insertions(+), 20 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/common.h +16 -0
@@ -196,4 +196,20 @@ enum nix_scheduler {#define DEFAULT_RSS_CONTEXT_GROUP 0#define MAX_RSS_INDIR_TBL_SIZE 256/* 1 << Max adder bits */ +/* NDC info */ +enum ndc_idx_e { +NIX0_RX =0x0 , +NIX0_TX =0x1 , +NPA0_U =0x2 , +}; + +enum ndc_ctype_e { +CACHING =0x0 , +BYPASS =0x1 , +}; + +#define NDC_MAX_PORT 6 +#define NDC_READ_TRANS 0 +#define NDC_WRITE_TRANS 1 +#endif /* COMMON_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +3 -3
@@ -433,9 +433,9 @@ static void rvu_reset_all_blocks(struct rvu *rvu)rvu_block_reset (rvu,BLKADDR_SSO ,SSO_AF_BLK_RST );rvu_block_reset (rvu,BLKADDR_TIM ,TIM_AF_BLK_RST );rvu_block_reset (rvu,BLKADDR_CPT0 ,CPT_AF_BLK_RST ); -rvu_block_reset (rvu,BLKADDR_NDC0 ,NDC_AF_BLK_RST ); -rvu_block_reset (rvu,BLKADDR_NDC1 ,NDC_AF_BLK_RST ); -rvu_block_reset (rvu,BLKADDR_NDC2 ,NDC_AF_BLK_RST ); +rvu_block_reset (rvu,BLKADDR_NDC_NIX0_RX ,NDC_AF_BLK_RST ); +rvu_block_reset (rvu,BLKADDR_NDC_NIX0_TX ,NDC_AF_BLK_RST ); +rvu_block_reset (rvu,BLKADDR_NDC_NPA0 ,NDC_AF_BLK_RST ); }static void rvu_scan_block (struct rvu *rvu,struct rvu_block *block)
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +140 -0
164 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +26 -1
@@ -435,7 +435,6 @@#define CPT_AF_LF_RST (0x44000)#define CPT_AF_BLK_RST (0x46000) -#define NDC_AF_BLK_RST (0x002F0)#define NPC_AF_BLK_RST (0x00040)/* NPC */
@@ -499,4 +498,30 @@#define NPC_AF_DBG_DATAX (a) (0x3001400 | (a) << 4)#define NPC_AF_DBG_RESULTX (a) (0x3001800 | (a) << 4) +/* NDC */ +#define NDC_AF_CONST (0x00000) +#define NDC_AF_CLK_EN (0x00020) +#define NDC_AF_CTL (0x00030) +#define NDC_AF_BANK_CTL (0x00040) +#define NDC_AF_BANK_CTL_DONE (0x00048) +#define NDC_AF_INTR (0x00058) +#define NDC_AF_INTR_W1S (0x00060) +#define NDC_AF_INTR_ENA_W1S (0x00068) +#define NDC_AF_INTR_ENA_W1C (0x00070) +#define NDC_AF_ACTIVE_PC (0x00078) +#define NDC_AF_BP_TEST_ENABLE (0x001F8) +#define NDC_AF_BP_TEST (a) (0x00200 | (a) << 3) +#define NDC_AF_BLK_RST (0x002F0) +#define NDC_PRIV_AF_INT_CFG (0x002F8) +#define NDC_AF_HASHX (a) (0x00300 | (a) << 3) +#define NDC_AF_PORTX_RTX_RWX_REQ_PC (a, b, c) \ + (0x00C00 | (a) << 5 | (b) << 4 | (c) << 3) +#define NDC_AF_PORTX_RTX_RWX_OSTDN_PC (a, b, c) \ + (0x00D00 | (a) << 5 | (b) << 4 | (c) << 3) +#define NDC_AF_PORTX_RTX_RWX_LAT_PC (a, b, c) \ + (0x00E00 | (a) << 5 | (b) << 4 | (c) << 3) +#define NDC_AF_PORTX_RTX_CANT_ALLOC_PC (a, b) \ + (0x00F00 | (a) << 5 | (b) << 4) +#define NDC_AF_BANKX_HIT_PC (a) (0x01000 | (a) << 3) +#define NDC_AF_BANKX_MISS_PC (a) (0x01100 | (a) << 3)#endif /* RVU_REG_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h +16 -16
@@ -13,22 +13,22 @@/* RVU Block Address Enumeration */ enum rvu_block_addr_e { -BLKADDR_RVUM =0x0ULL , -BLKADDR_LMT =0x1ULL , -BLKADDR_MSIX =0x2ULL , -BLKADDR_NPA =0x3ULL , -BLKADDR_NIX0 =0x4ULL , -BLKADDR_NIX1 =0x5ULL , -BLKADDR_NPC =0x6ULL , -BLKADDR_SSO =0x7ULL , -BLKADDR_SSOW =0x8ULL , -BLKADDR_TIM =0x9ULL , -BLKADDR_CPT0 =0xaULL , -BLKADDR_CPT1 =0xbULL , -BLKADDR_NDC0 =0xcULL , -BLKADDR_NDC1 =0xdULL , -BLKADDR_NDC2 =0xeULL , -BLK_COUNT =0xfULL , +BLKADDR_RVUM =0x0ULL , +BLKADDR_LMT =0x1ULL , +BLKADDR_MSIX =0x2ULL , +BLKADDR_NPA =0x3ULL , +BLKADDR_NIX0 =0x4ULL , +BLKADDR_NIX1 =0x5ULL , +BLKADDR_NPC =0x6ULL , +BLKADDR_SSO =0x7ULL , +BLKADDR_SSOW =0x8ULL , +BLKADDR_TIM =0x9ULL , +BLKADDR_CPT0 =0xaULL , +BLKADDR_CPT1 =0xbULL , +BLKADDR_NDC_NIX0_RX =0xcULL , +BLKADDR_NDC_NIX0_TX =0xdULL , +BLKADDR_NDC_NPA0 =0xeULL , +BLK_COUNT =0xfULL , };/* RVU Block Type Enumeration */
Signature · 1 line
2.7.4
PATCH v2 5/18 octeontx2-af: Add CGX LMAC stats to debugfs
In reply to [email protected]From: Prakash Brahmajyosyula <[email protected]>
This patch adds CGX LMAC physical interface or serdes Rx/Tx packet stats to debugfs.
'cat cgx<idx>/lmac<idx>/stats' dumps the current interface link status and Rx/Tx stats. Stats include pkt received/transmitted, dropped, pause frames etc etc.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 3 + .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 160 +++++++++++++++++++++ 2 files changed, 163 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +3 -0
@@ -44,6 +44,9 @@ struct dump_ctx {struct rvu_debugfs {struct dentry *root; +struct dentry *cgx_root; +struct dentry *cgx; +struct dentry *lmac;struct dentry *npa;struct dentry *nix;struct dump_ctx npa_aura_ctx;
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +160 -0
181 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 6/18 octeontx2-af: Add per CGX port level NIX Rx/Tx counters
In reply to [email protected]From: Linu Cherian <[email protected]>
A CGX port is shared by a RVU PF and it's VFs. These per CGX port level NIX Rx/Tx counters are cumilative stats of all NIXLFs sharing this port. These stats when compared to CGX Rx/Tx stats helps in identifying pkts dropped within the system, if any.
--- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 10 +++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h | 6 ++ drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 62 +++++++++++++- .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 95 ++++++++++++++++++++++ 5 files changed, 173 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +10 -0
@@ -138,6 +138,16 @@ void *cgx_get_pdata(int cgx_id) }EXPORT_SYMBOL (cgx_get_pdata); +int cgx_get_cgxid (void *cgxd) +{ +struct cgx *cgx = cgxd; + +if (!cgx) +return -EINVAL ; + +return cgx->cgx_id; +} +/* Ensure the required lock for event queue(where asynchronous events are * posted) is acquired before calling this API. Else an asynchronous event(with * latest link status) can reach the destination before this function returns
drivers/net/ethernet/marvell/octeontx2/af/cgx.h +6 -0
@@ -63,6 +63,11 @@#define CGX_NVEC 37#define CGX_LMAC_FWI 0 +enum cgx_nix_stat_type { +NIX_STATS_RX , +NIX_STATS_TX , +}; +enum LMAC_TYPE {LMAC_MODE_SGMII =0 ,LMAC_MODE_XAUI =1 ,
@@ -96,6 +101,7 @@ struct cgx_event_cb {extern struct pci_driver cgx_driver;int cgx_get_cgxcnt_max (void ); +int cgx_get_cgxid (void *cgxd);int cgx_get_lmac_cnt (void *cgxd);void *cgx_get_pdata (int cgx_id);int cgx_set_pkind (void *cgxd,u8 lmac_id,int pkind);
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
@@ -374,6 +374,8 @@ int rvu_cgx_init(struct rvu *rvu);int rvu_cgx_exit (struct rvu *rvu);void *rvu_cgx_pdata (u8 cgx_id,struct rvu *rvu);int rvu_cgx_config_rxtx (struct rvu *rvu,u16 pcifunc,bool start); +int rvu_cgx_nix_cuml_stats (struct rvu *rvu,void *cgxd,int lmac_id,int index, +int rxtxflag,u64 *stat);int rvu_mbox_handler_cgx_start_rxtx (struct rvu *rvu,struct msg_req *req,struct msg_rsp *rsp); int rvu_mbox_handler_cgx_stop_rxtx(struct rvu *rvu, struct msg_req *req,
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +60 -2
81 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +95 -0
119 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 7/18 octeontx2-af: Add NPC MCAM entry allocation status to debugfs
In reply to [email protected]From: Sunil Goutham <[email protected]>
Added support to display current NPC MCAM entries and counter's allocation status ín debugfs.
cat /sys/kernel/debug/octeontx2/npc/mcam_info' will dump following info
- MCAM Rx and Tx keysize
- Total MCAM entries and counters
- Current available count
- Count of number of MCAM entries and counters allocated
by a RVU PF/VF device.
Also, one NPC MCAM counter (last one) is reserved and mapped to NPC RX_INTF's MISS_ACTION to count dropped packets due to no MCAM entry match. This pkt drop counter can be checked via debugfs.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 8 ++ .../ethernet/marvell/octeontx2/af/rvu_debugfs.c | 154 +++++++++++++++++++++ .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 52 ++++++- 3 files changed, 213 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +8 -0
@@ -49,6 +49,7 @@ struct rvu_debugfs {struct dentry *lmac;struct dentry *npa;struct dentry *nix; +struct dentry *npc;struct dump_ctx npa_aura_ctx;struct dump_ctx npa_pool_ctx;struct dump_ctx nix_cq_ctx;
@@ -123,6 +124,7 @@ struct npc_mcam {u16 lprio_start;u16 hprio_count;u16 hprio_end; +u16 rx_miss_act_cntr;/* Counter for RX MISS action */ };/* Structure for per RVU func info ie PF/VF */
@@ -498,6 +500,12 @@ void rvu_npc_disable_default_entries(struct rvu *rvu, u16 pcifunc, int nixlf);void rvu_npc_enable_default_entries (struct rvu *rvu,u16 pcifunc,int nixlf);void rvu_npc_update_flowkey_alg_idx (struct rvu *rvu,u16 pcifunc,int nixlf,int group,int alg_idx,int mcam_index); +void rvu_npc_get_mcam_entry_alloc_info (struct rvu *rvu,u16 pcifunc, +int blkaddr,int *alloc_cnt, +int *enable_cnt); +void rvu_npc_get_mcam_counter_alloc_info (struct rvu *rvu,u16 pcifunc, +int blkaddr,int *alloc_cnt, +int *enable_cnt);int rvu_mbox_handler_npc_mcam_alloc_entry (struct rvu *rvu,struct npc_mcam_alloc_entry_req *req,struct npc_mcam_alloc_entry_rsp *rsp);
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +154 -0
172 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +51 -1
78 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 8/18 octeontx2-af: Add mbox API to validate all responses
In reply to [email protected]From: Sunil Goutham <[email protected]>
Added a new mailbox API which goes through all responses to check their IDs and response codes.
Also added logic to prevent queuing multiple works to process the same mailbox message. This scenario happens when AF is processing a PF's request and menawhile PF sends ACK to AF sent UP message, then mbox_hdr->num_msgs in the PF->AF DOWN mbox region will be nonzero and AF will end up processing PF's request again. This is fixed by taking a backup of num_msgs counter and clearing the same in the mbox region before scheduling work.
--- drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 47 ++++++++++++++++++++++-- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 1 + drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 32 ++++++++++++---- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 + 4 files changed, 70 insertions(+), 12 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.c +43 -4
@@ -236,8 +236,10 @@ struct mbox_msghdr *otx2_mbox_get_rsp(struct otx2_mbox *mbox, int devid,struct otx2_mbox_dev *mdev = &mbox->dev[devid];u16 msgs; +spin_lock (&mdev->mbox_lock); +if (mdev->num_msgs != mdev->msgs_acked) -return ERR_PTR (-ENODEV ); + goto error;for (msgs =0 ; msgs < mdev->msgs_acked; msgs++) {struct mbox_msghdr *pmsg = mdev->mbase + imsg;
@@ -245,18 +247,55 @@ struct mbox_msghdr *otx2_mbox_get_rsp(struct otx2_mbox *mbox, int devid,if (msg == pmsg) {if (pmsg->id != prsp->id) -return ERR_PTR (-ENODEV ); + goto error; +spin_unlock (&mdev->mbox_lock);return prsp; } - imsg = pmsg->next_msgoff; - irsp = prsp->next_msgoff; + imsg = mbox->tx_start + pmsg->next_msgoff; + irsp = mbox->rx_start + prsp->next_msgoff; } +error: +spin_unlock (&mdev->mbox_lock);return ERR_PTR (-ENODEV ); }EXPORT_SYMBOL (otx2_mbox_get_rsp); +int otx2_mbox_check_rsp_msgs (struct otx2_mbox *mbox,int devid) +{ +unsigned long ireq = mbox->tx_start + msgs_offset; +unsigned long irsp = mbox->rx_start + msgs_offset; +struct otx2_mbox_dev *mdev = &mbox->dev[devid]; +int rc = -ENODEV ; +u16 msgs; + +spin_lock (&mdev->mbox_lock); + +if (mdev->num_msgs != mdev->msgs_acked) + goto exit; + +for (msgs =0 ; msgs < mdev->msgs_acked; msgs++) { +struct mbox_msghdr *preq = mdev->mbase + ireq; +struct mbox_msghdr *prsp = mdev->mbase + irsp; + +if (preq->id != prsp->id) + goto exit; +if (prsp->rc) { + rc = prsp->rc; + goto exit; + } + + ireq = mbox->tx_start + preq->next_msgoff; + irsp = mbox->rx_start + prsp->next_msgoff; + } + rc =0 ; +exit: +spin_unlock (&mdev->mbox_lock); +return rc; +} +EXPORT_SYMBOL (otx2_mbox_check_rsp_msgs); +int otx2_reply_invalid_msg (struct otx2_mbox *mbox,int devid,u16 pcifunc,u16 id) {
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +1 -0
@@ -103,6 +103,7 @@ struct mbox_msghdr *otx2_mbox_alloc_msg_rsp(struct otx2_mbox *mbox, int devid, int size, int size_rsp);struct mbox_msghdr *otx2_mbox_get_rsp (struct otx2_mbox *mbox,int devid,struct mbox_msghdr *msg); +int otx2_mbox_check_rsp_msgs (struct otx2_mbox *mbox,int devid);int otx2_reply_invalid_msg (struct otx2_mbox *mbox,int devid,u16 pcifunc,u16 id);bool otx2_mbox_nonempty (struct otx2_mbox *mbox,int devid);
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +24 -8
@@ -1440,12 +1440,12 @@ static void __rvu_mbox_handler(struct rvu_work *mwork, int type)/* Process received mbox messages */ req_hdr = mdev->mbase + mbox->rx_start; -if (req_hdr->num_msgs ==0 ) +if (mw->mbox_wrk[devid].num_msgs ==0 )return ; offset = mbox->rx_start +ALIGN (sizeof (*req_hdr),MBOX_MSG_ALIGN ); -for (id =0 ; id < req_hdr->num_msgs; id++) { +for (id =0 ; id < mw->mbox_wrk[devid].num_msgs; id++) { msg = mdev->mbase + offset;/* Set which PF/VF sent this message based on mbox IRQ */
@@ -1471,13 +1471,14 @@ static void __rvu_mbox_handler(struct rvu_work *mwork, int type)if (msg->pcifunc &RVU_PFVF_FUNC_MASK )dev_warn (rvu->dev,"Error %d when processing message %s (0x%x) from PF%d:VF%d\n" , err,otx2_mbox_id2name (msg->id), - msg->id, devid, + msg->id,rvu_get_pf (msg->pcifunc), (msg->pcifunc &RVU_PFVF_FUNC_MASK ) -1 );else dev_warn (rvu->dev,"Error %d when processing message %s (0x%x) from PF%d\n" , err,otx2_mbox_id2name (msg->id), msg->id, devid); } + mw->mbox_wrk[devid].num_msgs =0 ;/* Send mbox responses to VF/PF */ otx2_mbox_msg_send (mbox, devid);
@@ -1523,14 +1524,14 @@ static void __rvu_mbox_up_handler(struct rvu_work *mwork, int type) mdev = &mbox->dev[devid]; rsp_hdr = mdev->mbase + mbox->rx_start; -if (rsp_hdr->num_msgs ==0 ) { +if (mw->mbox_wrk_up[devid].up_num_msgs ==0 ) {dev_warn (rvu->dev,"mbox up handler: num_msgs = 0\n" );return ; } offset = mbox->rx_start +ALIGN (sizeof (*rsp_hdr),MBOX_MSG_ALIGN ); -for (id =0 ; id < rsp_hdr->num_msgs; id++) { +for (id =0 ; id < mw->mbox_wrk_up[devid].up_num_msgs; id++) { msg = mdev->mbase + offset;if (msg->id >=MBOX_MSG_MAX ) {
@@ -1560,6 +1561,7 @@ static void __rvu_mbox_up_handler(struct rvu_work *mwork, int type) offset = mbox->rx_start + msg->next_msgoff; mdev->msgs_acked++; } + mw->mbox_wrk_up[devid].up_num_msgs =0 ;otx2_mbox_reset (mbox, devid); }
@@ -1697,14 +1699,28 @@ static void rvu_queue_work(struct mbox_wq_info *mw, int first, mbox = &mw->mbox; mdev = &mbox->dev[i]; hdr = mdev->mbase + mbox->rx_start; -if (hdr->num_msgs) -queue_work (mw->mbox_wq, &mw->mbox_wrk[i].work); +/*The hdr->num_msgs is set to zero immediately in the interrupt +* handler to ensure that it holds a correct value next time +* when the interrupt handler is called. +* pf->mbox.num_msgs holds the data for use in pfaf_mbox_handler +* pf>mbox.up_num_msgs holds the data for use in +* pfaf_mbox_up_handler. +*/ + +if (hdr->num_msgs) { + mw->mbox_wrk[i].num_msgs = hdr->num_msgs; + hdr->num_msgs =0 ; +queue_work (mw->mbox_wq, &mw->mbox_wrk[i].work); + } mbox = &mw->mbox_up; mdev = &mbox->dev[i]; hdr = mdev->mbase + mbox->rx_start; -if (hdr->num_msgs) +if (hdr->num_msgs) { + mw->mbox_wrk_up[i].up_num_msgs = hdr->num_msgs; + hdr->num_msgs =0 ;queue_work (mw->mbox_wq, &mw->mbox_wrk_up[i].work); + } } }
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
@@ -63,6 +63,8 @@ struct rvu_debugfs {struct rvu_work {struct work_struct work;struct rvu *rvu; +int num_msgs; +int up_num_msgs; };struct rsrc_bmap {
Signature · 1 line
2.7.4
PATCH v2 9/18 octeontx2-af: Sync hw mbox with bounce buffer.
In reply to [email protected]From: Geetha sowjanya <[email protected]>
If mailbox client has a bounce buffer or a intermediate buffer where mbox messages are framed then copy them from there to HW buffer. If 'mbase' and 'hw_mbase' are not same then assume 'mbase' points to bounce buffer.
This patch also adds msg_size field to mbox header to copy only valid data instead of whole buffer.
--- drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 40 +++++++++++++++++------- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 3 +- 2 files changed, 30 insertions(+), 13 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.c +28 -12
@@ -19,17 +19,20 @@ static const u16 msgs_offset = ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);void otx2_mbox_reset (struct otx2_mbox *mbox,int devid) { +void *hw_mbase = mbox->hwbase + (devid *MBOX_SIZE );struct otx2_mbox_dev *mdev = &mbox->dev[devid];struct mbox_hdr *tx_hdr, *rx_hdr; - tx_hdr = mdev->mbase + mbox->tx_start; - rx_hdr = mdev->mbase + mbox->rx_start; + tx_hdr = hw_mbase + mbox->tx_start; + rx_hdr = hw_mbase + mbox->rx_start;spin_lock (&mdev->mbox_lock); mdev->msg_size =0 ; mdev->rsp_size =0 ; tx_hdr->num_msgs =0 ; + tx_hdr->msg_size =0 ; rx_hdr->num_msgs =0 ; + rx_hdr->msg_size =0 ;spin_unlock (&mdev->mbox_lock); }EXPORT_SYMBOL (otx2_mbox_reset);
@@ -133,16 +136,17 @@ EXPORT_SYMBOL(otx2_mbox_init);int otx2_mbox_wait_for_rsp (struct otx2_mbox *mbox,int devid) { +unsigned long timeout = jiffies +msecs_to_jiffies (MBOX_RSP_TIMEOUT );struct otx2_mbox_dev *mdev = &mbox->dev[devid]; -int timeout =0 , sleep =1 ; +struct device *sender = &mbox->pdev->dev; -while (mdev->num_msgs != mdev->msgs_acked) { -msleep (sleep); - timeout += sleep; -if (timeout >=MBOX_RSP_TIMEOUT ) -return -EIO ; +while (!time_after (jiffies, timeout)) { +if (mdev->num_msgs == mdev->msgs_acked) +return 0 ; +usleep_range (800 ,1000 ); } -return 0 ; +dev_dbg (sender,"timed out while waiting for rsp\n" ); +return -EIO ; }EXPORT_SYMBOL (otx2_mbox_wait_for_rsp);
@@ -162,13 +166,25 @@ EXPORT_SYMBOL(otx2_mbox_busy_poll_for_rsp);void otx2_mbox_msg_send (struct otx2_mbox *mbox,int devid) { +void *hw_mbase = mbox->hwbase + (devid *MBOX_SIZE );struct otx2_mbox_dev *mdev = &mbox->dev[devid];struct mbox_hdr *tx_hdr, *rx_hdr; - tx_hdr = mdev->mbase + mbox->tx_start; - rx_hdr = mdev->mbase + mbox->rx_start; + tx_hdr = hw_mbase + mbox->tx_start; + rx_hdr = hw_mbase + mbox->rx_start; + +/* If bounce buffer is implemented copy mbox messages from +* bounce buffer to hw mbox memory. +*/ +if (mdev->mbase != hw_mbase) +memcpy (hw_mbase + mbox->tx_start + msgs_offset, + mdev->mbase + mbox->tx_start + msgs_offset, + mdev->msg_size);spin_lock (&mdev->mbox_lock); + + tx_hdr->msg_size = mdev->msg_size; +/* Reset header for next messages */ mdev->msg_size =0 ; mdev->rsp_size =0 ;
@@ -215,7 +231,7 @@ struct mbox_msghdr *otx2_mbox_alloc_msg_rsp(struct otx2_mbox *mbox, int devid, msghdr = mdev->mbase + mbox->tx_start + msgs_offset + mdev->msg_size;/* Clear the whole msg region */ -memset (msghdr,0 ,sizeof (*msghdr) + size); +memset (msghdr,0 , size);/* Init message header with reset values */ msghdr->ver =OTX2_MBOX_VERSION ; mdev->msg_size += size;
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2 -1
@@ -36,7 +36,7 @@#define INTR_MASK (pfvfs) ((pfvfs < 64) ? (BIT_ULL(pfvfs) - 1) : (~0ull)) -#define MBOX_RSP_TIMEOUT 1000/* in ms, Time to wait for mbox response */ +#define MBOX_RSP_TIMEOUT 2000/* Time(ms) to wait for mbox response */ #define MBOX_MSG_ALIGN 16/* Align mbox msg start to 16bytes */
@@ -75,6 +75,7 @@ struct otx2_mbox {/* Header which preceeds all mbox messages */ struct mbox_hdr { +u64 msg_size;/* Total msgs size embedded */ u16 num_msgs;/* No of msgs embedded */ };
Signature · 1 line
2.7.4
PATCH v2 10/18 octeontx2-af: Add macro to generate mbox handlers declarations
In reply to [email protected]From: Subbaraya Sundeep <[email protected]>
For every mailbox handler added to rvu, we are adding a function declaration in rvu header file. Cleaned this up by adding a macro to generate these declarations automatically.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 24 ++--- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 127 +----------------------- 2 files changed, 17 insertions(+), 134 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +12 -12
@@ -877,8 +877,8 @@ int rvu_aq_alloc(struct rvu *rvu, struct admin_queue **ad_queue,return 0 ; } -static int rvu_mbox_handler_ready (struct rvu *rvu,struct msg_req *req, -struct ready_msg_rsp *rsp) +int rvu_mbox_handler_ready (struct rvu *rvu,struct msg_req *req, +struct ready_msg_rsp *rsp) {return 0 ; }
@@ -1023,9 +1023,9 @@ static int rvu_detach_rsrcs(struct rvu *rvu, struct rsrc_detach *detach,return 0 ; } -static int rvu_mbox_handler_detach_resources (struct rvu *rvu, -struct rsrc_detach *detach, -struct msg_rsp *rsp) +int rvu_mbox_handler_detach_resources (struct rvu *rvu, +struct rsrc_detach *detach, +struct msg_rsp *rsp) {return rvu_detach_rsrcs (rvu, detach, detach->hdr.pcifunc); }
@@ -1171,9 +1171,9 @@ static int rvu_check_rsrc_availability(struct rvu *rvu,return -ENOSPC ; } -static int rvu_mbox_handler_attach_resources (struct rvu *rvu, -struct rsrc_attach *attach, -struct msg_rsp *rsp) +int rvu_mbox_handler_attach_resources (struct rvu *rvu, +struct rsrc_attach *attach, +struct msg_rsp *rsp) {u16 pcifunc = attach->hdr.pcifunc;int err;
@@ -1294,8 +1294,8 @@ static void rvu_clear_msix_offset(struct rvu *rvu, struct rvu_pfvf *pfvf,rvu_free_rsrc_contig (&pfvf->msix, nvecs, offset); } -static int rvu_mbox_handler_msix_offset (struct rvu *rvu,struct msg_req *req, -struct msix_offset_rsp *rsp) +int rvu_mbox_handler_msix_offset (struct rvu *rvu,struct msg_req *req, +struct msix_offset_rsp *rsp) {struct rvu_hwinfo *hw = rvu->hw;u16 pcifunc = req->hdr.pcifunc;
@@ -1343,8 +1343,8 @@ static int rvu_mbox_handler_msix_offset(struct rvu *rvu, struct msg_req *req,return 0 ; } -static int rvu_mbox_handler_vf_flr (struct rvu *rvu,struct msg_req *req, -struct msg_rsp *rsp) +int rvu_mbox_handler_vf_flr (struct rvu *rvu,struct msg_req *req, +struct msg_rsp *rsp) {u16 pcifunc = req->hdr.pcifunc;u16 vf, numvfs;
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +5 -122
157 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 11/18 octeontx2-af: Update NPC KPU packet parsing profile
In reply to [email protected]From: Hao Zheng <[email protected]>
Updated NPC KPU packet parsing profile with support for following
- Fragmentation support for IPv4 IPv6 outer header
- NIX instruction header support
- QinQ with TPID of 0x8100 as non inner most vlan tag, as legacy network equipments still generate QinQ packets with this configuration.
- To better support RSS for tunnelled packets, udp based tunnel protocols such as vxlan, vxlan-gpe, geneve and gtpu are now captured into a separate layer E. Consequently, the inner packet headers are pushed one layer down to LF, LG, and LH accordingly.
- Support for rfc7510 mpls in udp. Up to 4 MPLS labels can be parsed and captured in one layer LE.
- Parser support for DSA, extended DSA and eDSA tags right after ethernet header by Marvell SOHO and Falcon switches. For extended DSA and eDSA tags, a special PKIND of 62 is used, as these tags don't contain a tpid field.
- Higig2 protocol header parsing support, added a NPC_LT_LA_HIGIG2_ETHER for a combined header of HIGIG2 and Ethernet. Add a NPC_LT_LA_IH_NIX_HIGIG2_ETHER for a combined header of nix_ih, HIGIG2 and Ethernet on egress side. Also added 2 upper flags in LA to indicate the presence of nix_ih and HIGIG2.
Other changes include
- IPv4.TTL==0 IPv6.HLIM==0 check
- Per RFC 1858, mark fragment offset == 1 as error
- TCP invalid flags check
- Separate error codes for outer and inner IPv4 checksum errors.
- Fix a parser error when KPU parses incoming IPSec ESP and AH packets
- NPC vtag capture/strip hardware expect tag pointer to point to tpid/ethertype instead of tci. So move lb_ptr to point to tpid/ethertype.
- Fix npc parser error when parsing udp packets that don't have any payload.
- For a single MCAM entry to match on packets with one or stacked vlan tags combine NPC_LT_LB_STAG and NPC_LT_LB_QINQ to NPC_LT_LB_STAG_QINQ.
- NVGRE to have a separate ltype LD_NVGRE instead of combined with LD_GRE.
- Reserve top LD/LTYPEs to support custom KPU profile fields.
--- drivers/net/ethernet/marvell/octeontx2/af/npc.h | 95 +- .../ethernet/marvell/octeontx2/af/npc_profile.h | 14946 ++++++++++++++----- .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 10 +- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 9 +- 4 files changed, 11252 insertions(+), 3808 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/npc.h +66 -29
@@ -27,26 +27,45 @@ enum NPC_LID_E {enum npc_kpu_la_ltype {NPC_LT_LA_8023 =1 ,NPC_LT_LA_ETHER , +NPC_LT_LA_IH_NIX_ETHER , +NPC_LT_LA_IH_8_ETHER , +NPC_LT_LA_IH_4_ETHER , +NPC_LT_LA_IH_2_ETHER , +NPC_LT_LA_HIGIG2_ETHER , +NPC_LT_LA_IH_NIX_HIGIG2_ETHER , +NPC_LT_LA_CUSTOM0 =0xE , +NPC_LT_LA_CUSTOM1 =0xF , };enum npc_kpu_lb_ltype {NPC_LT_LB_ETAG =1 ,NPC_LT_LB_CTAG , -NPC_LT_LB_STAG , +NPC_LT_LB_STAG_QINQ ,NPC_LT_LB_BTAG , -NPC_LT_LB_QINQ ,NPC_LT_LB_ITAG , +NPC_LT_LB_DSA , +NPC_LT_LB_DSA_VLAN , +NPC_LT_LB_EDSA , +NPC_LT_LB_EDSA_VLAN , +NPC_LT_LB_EXDSA , +NPC_LT_LB_EXDSA_VLAN , +NPC_LT_LB_CUSTOM0 =0xE , +NPC_LT_LB_CUSTOM1 =0xF , };enum npc_kpu_lc_ltype {NPC_LT_LC_IP =1 , +NPC_LT_LC_IP_OPT ,NPC_LT_LC_IP6 , +NPC_LT_LC_IP6_EXT ,NPC_LT_LC_ARP ,NPC_LT_LC_RARP ,NPC_LT_LC_MPLS ,NPC_LT_LC_NSH ,NPC_LT_LC_PTP ,NPC_LT_LC_FCOE , +NPC_LT_LC_CUSTOM0 =0xE , +NPC_LT_LC_CUSTOM1 =0xF , };/* Don't modify Ltypes upto SCTP, otherwise it will
@@ -57,49 +76,67 @@ enum npc_kpu_ld_ltype {NPC_LT_LD_UDP ,NPC_LT_LD_ICMP ,NPC_LT_LD_SCTP , -NPC_LT_LD_IGMP ,NPC_LT_LD_ICMP6 , +NPC_LT_LD_IGMP =8 ,NPC_LT_LD_ESP ,NPC_LT_LD_AH ,NPC_LT_LD_GRE , -NPC_LT_LD_GRE_MPLS , -NPC_LT_LD_GRE_NSH , - NPC_LT_LD_TU_MPLS, +NPC_LT_LD_NVGRE , +NPC_LT_LD_NSH , +NPC_LT_LD_TU_MPLS_IN_NSH , +NPC_LT_LD_TU_MPLS_IN_IP , +NPC_LT_LD_CUSTOM0 =0xE , + NPC_LT_LD_CUSTOM1 = 0xF, };enum npc_kpu_le_ltype { -NPC_LT_LE_TU_ETHER =1 , -NPC_LT_LE_TU_PPP , -NPC_LT_LE_TU_MPLS_IN_NSH , -NPC_LT_LE_TU_3RD_NSH , +NPC_LT_LE_VXLAN =1 , +NPC_LT_LE_GENEVE , +NPC_LT_LE_GTPU =4 , +NPC_LT_LE_VXLANGPE , +NPC_LT_LE_GTPC , +NPC_LT_LE_NSH , +NPC_LT_LE_TU_MPLS_IN_GRE , +NPC_LT_LE_TU_NSH_IN_GRE , +NPC_LT_LE_TU_MPLS_IN_UDP , +NPC_LT_LE_CUSTOM0 =0xE , +NPC_LT_LE_CUSTOM1 =0xF , };enum npc_kpu_lf_ltype { -NPC_LT_LF_TU_IP =1 , -NPC_LT_LF_TU_IP6 , -NPC_LT_LF_TU_ARP , -NPC_LT_LF_TU_MPLS_IP , -NPC_LT_LF_TU_MPLS_IP6 , -NPC_LT_LF_TU_MPLS_ETHER , +NPC_LT_LF_TU_ETHER =1 , +NPC_LT_LF_TU_PPP , +NPC_LT_LF_TU_MPLS_IN_VXLANGPE , +NPC_LT_LF_TU_NSH_IN_VXLANGPE , +NPC_LT_LF_TU_MPLS_IN_NSH , +NPC_LT_LF_TU_3RD_NSH , +NPC_LT_LF_CUSTOM0 =0xE , +NPC_LT_LF_CUSTOM1 =0xF , };enum npc_kpu_lg_ltype { -NPC_LT_LG_TU_TCP =1 , -NPC_LT_LG_TU_UDP , -NPC_LT_LG_TU_SCTP , -NPC_LT_LG_TU_ICMP , -NPC_LT_LG_TU_IGMP , -NPC_LT_LG_TU_ICMP6 , -NPC_LT_LG_TU_ESP , -NPC_LT_LG_TU_AH , +NPC_LT_LG_TU_IP =1 , +NPC_LT_LG_TU_IP6 , +NPC_LT_LG_TU_ARP , +NPC_LT_LG_TU_ETHER_IN_NSH , +NPC_LT_LG_CUSTOM0 =0xE , +NPC_LT_LG_CUSTOM1 =0xF , }; +/* Don't modify Ltypes upto SCTP, otherwise it will +* effect flow tag calculation and thus RSS. +*/ enum npc_kpu_lh_ltype { -NPC_LT_LH_TCP_DATA =1 , -NPC_LT_LH_HTTP_DATA , -NPC_LT_LH_HTTPS_DATA , -NPC_LT_LH_PPTP_DATA , -NPC_LT_LH_UDP_DATA , +NPC_LT_LH_TU_TCP =1 , +NPC_LT_LH_TU_UDP , +NPC_LT_LH_TU_ICMP , +NPC_LT_LH_TU_SCTP , +NPC_LT_LH_TU_ICMP6 , +NPC_LT_LH_TU_IGMP =8 , +NPC_LT_LH_TU_ESP , +NPC_LT_LH_TU_AH , +NPC_LT_LH_CUSTOM0 =0xE , +NPC_LT_LH_CUSTOM1 =0xF , }; struct npc_kpu_profile_cam {
drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h +11177 -3769
2,859 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +4 -5
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.7.4
Part of the diff is not shown here. View the raw message.
PATCH v2 12/18 octeontx2-af: Clear NPC MCAM entries before update
In reply to [email protected]From: Nithin Dabilpuram <[email protected]>
Writing into NPC MCAM1 and MCAM0 registers are suppressed if they happened to form a reserved combination. Hence clear and disable MCAM entries before update.
For HRM:
[CAM(1)]<n>=1, [CAM(0)]<n>=1: Reserved.
The reserved combination is not allowed. Hardware suppresses any write to CAM(0) or CAM(1) that would result in the reserved combination for any CAM bit.
--- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +31 -2
@@ -120,6 +120,31 @@ static void npc_enable_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, } } +static void npc_clear_mcam_entry (struct rvu *rvu,struct npc_mcam *mcam, +int blkaddr,int index) +{ +int bank =npc_get_bank (mcam, index); +int actbank = bank; + + index &= (mcam->banksize -1 ); +for (; bank < (actbank + mcam->banks_per_entry); bank++) { +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_CAMX_INTF (index, bank,1 ),0 ); +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_CAMX_INTF (index, bank,0 ),0 ); + +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_CAMX_W0 (index, bank,1 ),0 ); +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_CAMX_W0 (index, bank,0 ),0 ); + +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_CAMX_W1 (index, bank,1 ),0 ); +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_CAMX_W1 (index, bank,0 ),0 ); + } +} +static void npc_get_keyword (struct mcam_entry *entry,int idx,u64 *cam0,u64 *cam1) {
@@ -211,6 +236,12 @@ static void npc_config_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam, actindex = index; index &= (mcam->banksize -1 ); +/* Disable before mcam entry update */ +npc_enable_mcam_entry (rvu, mcam, blkaddr, actindex, false); + +/* Clear mcam entry to avoid writes being suppressed by NPC */ +npc_clear_mcam_entry (rvu, mcam, blkaddr, actindex); +/* CAM1 takes the comparison value and * CAM0 specifies match for a bit in key being '0' or '1' or 'dontcare'. * CAM1<n> = 0 & CAM0<n> = 1 => match if key<n> = 0
@@ -251,8 +282,6 @@ static void npc_config_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,/* Enable the entry */ if (enable)npc_enable_mcam_entry (rvu, mcam, blkaddr, actindex, true); -else -npc_enable_mcam_entry (rvu, mcam, blkaddr, actindex, false); } static void npc_copy_mcam_entry(struct rvu *rvu, struct npc_mcam *mcam,
Signature · 1 line
2.7.4
PATCH v2 13/18 octeontx2-af: Add more RSS algorithms
In reply to [email protected]From: Kiran Kumar K <[email protected]>
This patch adds support for few more RSS key types for flow key algorithm to compute rss hash index.
Following flow key types have been added.
- Tunnel types like NVGRE, VXLAN, GENEVE.
- L2 offload type ETH_DMAC, Here we will consider only DMAC 6 bytes.
- And extension header IPV6_EXT (1 byte followed by IPV6 header
- Hashing inner protocol fields for inner DMAC, IPv4/v6, TCP, UDP, SCTP.
--- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 12 +++ .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 113 +++++++++++++++++++-- 2 files changed, 114 insertions(+), 11 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +12 -0
@@ -580,6 +580,18 @@ struct nix_rss_flowkey_cfg {#define NIX_FLOW_KEY_TYPE_TCP BIT(3)#define NIX_FLOW_KEY_TYPE_UDP BIT(4)#define NIX_FLOW_KEY_TYPE_SCTP BIT(5) +#define NIX_FLOW_KEY_TYPE_NVGRE BIT(6) +#define NIX_FLOW_KEY_TYPE_VXLAN BIT(7) +#define NIX_FLOW_KEY_TYPE_GENEVE BIT(8) +#define NIX_FLOW_KEY_TYPE_ETH_DMAC BIT(9) +#define NIX_FLOW_KEY_TYPE_IPV6_EXT BIT(10) +#define NIX_FLOW_KEY_TYPE_GTPU BIT(11) +#define NIX_FLOW_KEY_TYPE_INNR_IPV4 BIT(12) +#define NIX_FLOW_KEY_TYPE_INNR_IPV6 BIT(13) +#define NIX_FLOW_KEY_TYPE_INNR_TCP BIT(14) +#define NIX_FLOW_KEY_TYPE_INNR_UDP BIT(15) +#define NIX_FLOW_KEY_TYPE_INNR_SCTP BIT(16) +#define NIX_FLOW_KEY_TYPE_INNR_ETH_DMAC BIT(17)u32 flowkey_cfg;/* Flowkey types selected */ u8 group;/* RSS context or group */ };
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +102 -11
166 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 14/18 octeontx2-af: Support fixed transmit scheduler topology
In reply to [email protected]From: Sunil Goutham <[email protected]>
CN96xx initial silicon doesn't support all features pertaining to NIX transmit scheduling and shaping.
- It supports a fixed topology of 1:1 mapped transmit limiters at all levels.
- Supports DWRR only at SMQ/MDQ and TL1.
- Doesn't support shaping and coloring.
This patch adds HW capability structure by which each variant and skew of silicon can be differentiated by their supported features. And adds support for A0 silicon's transmit scheduler capabilities or rather limitations.
--- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 50 ++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h | 7 + drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 10 + drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 35 +- drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 33 +- .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 18 + .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 612 ++++++++++++--------- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 6 +- .../net/ethernet/marvell/octeontx2/af/rvu_reg.h | 1 + 9 files changed, 513 insertions(+), 259 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +50 -0
@@ -291,6 +291,35 @@ void cgx_lmac_promisc_config(int cgx_id, int lmac_id, bool enable) }EXPORT_SYMBOL (cgx_lmac_promisc_config); +/* Enable or disable forwarding received pause frames to Tx block */ +void cgx_lmac_enadis_rx_pause_fwding (void *cgxd,int lmac_id,bool enable) +{ +struct cgx *cgx = cgxd; +u64 cfg; + +if (!cgx) +return ; + +if (enable) { + cfg =cgx_read (cgx, lmac_id,CGXX_GMP_GMI_RXX_FRM_CTL ); + cfg |=CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK ; +cgx_write (cgx, lmac_id,CGXX_GMP_GMI_RXX_FRM_CTL , cfg); + + cfg =cgx_read (cgx, lmac_id,CGXX_SMUX_RX_FRM_CTL ); + cfg |=CGX_SMUX_RX_FRM_CTL_CTL_BCK ; +cgx_write (cgx, lmac_id,CGXX_SMUX_RX_FRM_CTL , cfg); + }else { + cfg =cgx_read (cgx, lmac_id,CGXX_GMP_GMI_RXX_FRM_CTL ); + cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK ; +cgx_write (cgx, lmac_id,CGXX_GMP_GMI_RXX_FRM_CTL , cfg); + + cfg =cgx_read (cgx, lmac_id,CGXX_SMUX_RX_FRM_CTL ); + cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK ; +cgx_write (cgx, lmac_id,CGXX_SMUX_RX_FRM_CTL , cfg); + } +} +EXPORT_SYMBOL (cgx_lmac_enadis_rx_pause_fwding); +int cgx_get_rx_stats (void *cgxd,int lmac_id,int idx,u64 *rx_stat) {struct cgx *cgx = cgxd;
@@ -331,6 +360,27 @@ int cgx_lmac_rx_tx_enable(void *cgxd, int lmac_id, bool enable) }EXPORT_SYMBOL (cgx_lmac_rx_tx_enable); +int cgx_lmac_tx_enable (void *cgxd,int lmac_id,bool enable) +{ +struct cgx *cgx = cgxd; +u64 cfg, last; + +if (!cgx || lmac_id >= cgx->lmac_count) +return -ENODEV ; + + cfg =cgx_read (cgx, lmac_id,CGXX_CMRX_CFG ); + last = cfg; +if (enable) + cfg |=DATA_PKT_TX_EN ; +else + cfg &= ~DATA_PKT_TX_EN ; + +if (cfg != last) +cgx_write (cgx, lmac_id,CGXX_CMRX_CFG , cfg); +return !!(last &DATA_PKT_TX_EN ); +} +EXPORT_SYMBOL (cgx_lmac_tx_enable); +/* CGX Firmware interface low level support */ static int cgx_fwi_cmd_send (u64 req,u64 *resp,struct lmac *lmac) {
drivers/net/ethernet/marvell/octeontx2/af/cgx.h +7 -0
@@ -56,6 +56,11 @@#define CGXX_GMP_PCS_MRX_CTL 0x30000#define CGXX_GMP_PCS_MRX_CTL_LBK BIT_ULL(14) +#define CGXX_SMUX_RX_FRM_CTL 0x20020 +#define CGX_SMUX_RX_FRM_CTL_CTL_BCK BIT_ULL(3) +#define CGXX_GMP_GMI_RXX_FRM_CTL 0x38028 +#define CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK BIT_ULL(3) +#define CGX_COMMAND_REG CGXX_SCRATCH1_REG#define CGX_EVENT_REG CGXX_SCRATCH0_REG#define CGX_CMD_TIMEOUT 2200/* msecs */
@@ -110,9 +115,11 @@ int cgx_lmac_evh_unregister(void *cgxd, int lmac_id);int cgx_get_tx_stats (void *cgxd,int lmac_id,int idx,u64 *tx_stat);int cgx_get_rx_stats (void *cgxd,int lmac_id,int idx,u64 *rx_stat);int cgx_lmac_rx_tx_enable (void *cgxd,int lmac_id,bool enable); +int cgx_lmac_tx_enable (void *cgxd,int lmac_id,bool enable);int cgx_lmac_addr_set (u8 cgx_id,u8 lmac_id,u8 *mac_addr);u64 cgx_lmac_addr_get (u8 cgx_id,u8 lmac_id);void cgx_lmac_promisc_config (int cgx_id,int lmac_id,bool enable); +void cgx_lmac_enadis_rx_pause_fwding (void *cgxd,int lmac_id,bool enable);int cgx_lmac_internal_loopback (void *cgxd,int lmac_id,bool enable);int cgx_get_link_info (void *cgxd,int lmac_id,struct cgx_link_user_info *linfo);
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +10 -0
@@ -127,6 +127,7 @@ M(ATTACH_RESOURCES, 0x002, attach_resources, rsrc_attach, msg_rsp) \ M(DETACH_RESOURCES, 0x003, detach_resources, rsrc_detach, msg_rsp) \ M(MSIX_OFFSET, 0x004, msix_offset, msg_req, msix_offset_rsp) \ M(VF_FLR, 0x006, vf_flr, msg_req, msg_rsp) \ +M (GET_HW_CAP ,0x008 , get_hw_cap, msg_req, get_hw_cap_rsp) \ /* CGX mbox IDs (range 0x200 - 0x3FF) */ \ M(CGX_START_RXTX, 0x200, cgx_start_rxtx, msg_req, msg_rsp) \M (CGX_STOP_RXTX ,0x201 , cgx_stop_rxtx, msg_req, msg_rsp) \
@@ -302,6 +303,12 @@ struct msix_offset_rsp {u16 cptlf_msixoff[MAX_RVU_BLKLF_CNT ]; }; +struct get_hw_cap_rsp { +struct mbox_msghdr hdr; +u8 nix_fixed_txschq_mapping;/* Schq mapping fixed or flexible */ +u8 nix_shaping;/* Is shaping and coloring supported */ +}; +/* CGX mbox message formats */ struct cgx_stats_rsp {
@@ -514,6 +521,9 @@ struct nix_txsch_alloc_rsp {/* Scheduler queue list allocated at each level */ u16 schq_contig_list[NIX_TXSCH_LVL_CNT ][MAX_TXSCHQ_PER_FUNC ];u16 schq_list[NIX_TXSCH_LVL_CNT ][MAX_TXSCHQ_PER_FUNC ]; +u8 aggr_level;/* Traffic aggregation scheduler level */ +u8 aggr_lvl_rr_prio;/* Aggregation lvl's RR_PRIO config */ +u8 link_cfg_lvl;/* LINKX_CFG CSRs mapped to TL3 or TL2's index ? */ };struct nix_txsch_free_req {
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +33 -2
@@ -56,12 +56,31 @@ static char *mkex_profile; /* MKEX profile name */module_param (mkex_profile, charp,0000 );MODULE_PARM_DESC (mkex_profile,"MKEX profile name string" ); +static void rvu_setup_hw_capabilities (struct rvu *rvu) +{ +struct rvu_hwinfo *hw = rvu->hw; + + hw->cap.nix_tx_aggr_lvl =NIX_TXSCH_LVL_TL1 ; + hw->cap.nix_fixed_txschq_mapping = false; + hw->cap.nix_shaping = true; + hw->cap.nix_tx_link_bp = true; + +if (is_rvu_96xx_B0 (rvu)) { + hw->cap.nix_fixed_txschq_mapping = true; + hw->cap.nix_txsch_per_cgx_lmac =4 ; + hw->cap.nix_txsch_per_lbk_lmac =132 ; + hw->cap.nix_txsch_per_sdp_lmac =76 ; + hw->cap.nix_shaping = false; + hw->cap.nix_tx_link_bp = false; + } +} +/* Poll a RVU block's register 'offset', for a 'zero' * or 'nonzero' at bits specified by 'mask' */ int rvu_poll_reg (struct rvu *rvu,u64 block,u64 offset,u64 mask,bool zero) { -unsigned long timeout = jiffies +usecs_to_jiffies (100 ); +unsigned long timeout = jiffies +usecs_to_jiffies (10000 );void __iomem *reg;u64 reg_val;
@@ -73,7 +92,6 @@ int rvu_poll_reg(struct rvu *rvu, u64 block, u64 offset, u64 mask, bool zero)if (!zero && (reg_val & mask))return 0 ;usleep_range (1 ,5 ); - timeout--; }return -EBUSY ; }
@@ -1363,6 +1381,17 @@ int rvu_mbox_handler_vf_flr(struct rvu *rvu, struct msg_req *req,return 0 ; } +int rvu_mbox_handler_get_hw_cap (struct rvu *rvu,struct msg_req *req, +struct get_hw_cap_rsp *rsp) +{ +struct rvu_hwinfo *hw = rvu->hw; + + rsp->nix_fixed_txschq_mapping = hw->cap.nix_fixed_txschq_mapping; + rsp->nix_shaping = hw->cap.nix_shaping; + +return 0 ; +} +static int rvu_process_mbox_msg (struct otx2_mbox *mbox,int devid,struct mbox_msghdr *req) {
@@ -2448,6 +2477,8 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)rvu_reset_all_blocks (rvu); +rvu_setup_hw_capabilities (rvu); + err =rvu_setup_hw_resources (rvu);if (err) goto err_release_regions;
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +30 -3
@@ -184,10 +184,12 @@ struct rvu_pfvf {struct nix_txsch {struct rsrc_bmap schq;u8 lvl; -#define NIX_TXSCHQ_TL1_CFG_DONE BIT_ULL(0) +#define NIX_TXSCHQ_FREE BIT_ULL(1) +#define NIX_TXSCHQ_CFG_DONE BIT_ULL(0)#define TXSCH_MAP_FUNC (__pfvf_map) ((__pfvf_map) & 0xFFFF)#define TXSCH_MAP_FLAGS (__pfvf_map) ((__pfvf_map) >> 16)#define TXSCH_MAP (__func, __flags) (((__func) & 0xFFFF) | ((__flags) << 16)) +#define TXSCH_SET_FLAG (__pfvf_map, flag) ((__pfvf_map) | ((flag) << 16))u32 *pfvf_map; };
@@ -221,6 +223,20 @@ struct nix_hw {struct nix_lso lso; }; +/* RVU block's capabilities or functionality, +* which vary by silicon version/skew. +*/ +struct hw_cap { +/* Transmit side supported functionality */ +u8 nix_tx_aggr_lvl;/* Tx link's traffic aggregation level */ +u16 nix_txsch_per_cgx_lmac;/* Max Q's transmitting to CGX LMAC */ +u16 nix_txsch_per_lbk_lmac;/* Max Q's transmitting to LBK LMAC */ +u16 nix_txsch_per_sdp_lmac;/* Max Q's transmitting to SDP LMAC */ +bool nix_fixed_txschq_mapping;/* Schq mapping fixed or flexible */ +bool nix_shaping;/* Is shaping and coloring supported */ +bool nix_tx_link_bp;/* Can link backpressure TL queues ? */ +}; +struct rvu_hwinfo {u8 total_pfs;/* MAX RVU PFs HW supports */ u16 total_vfs;/* Max RVU VFs HW supports */
@@ -232,7 +248,7 @@ struct rvu_hwinfo {u8 sdp_links;u8 npc_kpus;/* No of parser units */ - +struct hw_cap cap;struct rvu_block block[BLK_COUNT ];/* Block info */ struct nix_hw *nix0;struct npc_pkind pkind;
@@ -317,7 +333,8 @@ static inline u64 rvupf_read64(struct rvu *rvu, u64 offset)return readq (rvu->pfreg_base + offset); } -static inline bool is_rvu_9xxx_A0 (struct rvu *rvu) +/* Silicon revisions */ +static inline bool is_rvu_96xx_A0 (struct rvu *rvu) {struct pci_dev *pdev = rvu->pdev;
@@ -325,6 +342,14 @@ static inline bool is_rvu_9xxx_A0(struct rvu *rvu) (pdev->subsystem_device ==PCI_SUBSYS_DEVID_96XX ); } +static inline bool is_rvu_96xx_B0 (struct rvu *rvu) +{ +struct pci_dev *pdev = rvu->pdev; + +return ((pdev->revision ==0x00 ) || (pdev->revision ==0x01 )) && + (pdev->subsystem_device ==PCI_SUBSYS_DEVID_96XX ); +} +/* Function Prototypes * RVU */
@@ -383,6 +408,7 @@ int rvu_cgx_init(struct rvu *rvu);int rvu_cgx_exit (struct rvu *rvu);void *rvu_cgx_pdata (u8 cgx_id,struct rvu *rvu);int rvu_cgx_config_rxtx (struct rvu *rvu,u16 pcifunc,bool start); +void rvu_cgx_enadis_rx_bp (struct rvu *rvu,int pf,bool enable);int rvu_cgx_nix_cuml_stats (struct rvu *rvu,void *cgxd,int lmac_id,int index,int rxtxflag,u64 *stat);/* NPA APIs */
@@ -400,6 +426,7 @@ int rvu_nix_reserve_mark_format(struct rvu *rvu, struct nix_hw *nix_hw,void rvu_nix_freemem (struct rvu *rvu);int rvu_get_nixlf_count (struct rvu *rvu);void rvu_nix_lf_teardown (struct rvu *rvu,u16 pcifunc,int blkaddr,int npalf); +int nix_get_nixlf (struct rvu *rvu,u16 pcifunc,int *nixlf);/* NPC APIs */ int rvu_npc_init (struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +18 -0
@@ -348,6 +348,24 @@ int rvu_cgx_exit(struct rvu *rvu)return 0 ; } +void rvu_cgx_enadis_rx_bp (struct rvu *rvu,int pf,bool enable) +{ +u8 cgx_id, lmac_id; +void *cgxd; + +if (!is_pf_cgxmapped (rvu, pf)) +return ; + +rvu_get_cgx_lmac_id (rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id); + cgxd =rvu_cgx_pdata (cgx_id, rvu); + +/* Set / clear CTL_BCK to control pause frame forwarding to NIX */ +if (enable) +cgx_lmac_enadis_rx_pause_fwding (cgxd, lmac_id, true); +else +cgx_lmac_enadis_rx_pause_fwding (cgxd, lmac_id, false); +} +int rvu_cgx_config_rxtx (struct rvu *rvu,u16 pcifunc,bool start) {int pf =rvu_get_pf (pcifunc);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +361 -251
864 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +3 -3
@@ -834,11 +834,11 @@ static void npc_load_mkex_profile(struct rvu *rvu, int blkaddr)/* Compare with mkex mod_param name string */ if (mcam_kex->mkex_sign ==MKEX_SIGN && !strncmp (mcam_kex->name, mkex_profile,MKEX_NAME_LEN )) { -/* Due to an errata (35786) in A0 pass silicon, +/* Due to an errata (35786) in A0/B0 pass silicon, * parse nibble enable configuration has to be * identical for both Rx and Tx interfaces. */ -if (is_rvu_9xxx_A0 (rvu) && +if (is_rvu_96xx_B0 (rvu) && mcam_kex->keyx_cfg[NIX_INTF_RX ] != mcam_kex->keyx_cfg[NIX_INTF_TX ]) goto load_default;
@@ -1201,7 +1201,7 @@ int rvu_npc_init(struct rvu *rvu)/* Due to an errata (35786) in A0 pass silicon, parse nibble enable * configuration has to be identical for both Rx and Tx interfaces. */ -if (!is_rvu_9xxx_A0 (rvu)) +if (!is_rvu_96xx_B0 (rvu)) nibble_ena = (1ULL <<19 ) -1 ;rvu_write64 (rvu, blkaddr,NPC_AF_INTFX_KEX_CFG (NIX_INTF_TX ), ((keyz &0x3 ) <<32 ) | nibble_ena);
drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h +1 -0
@@ -246,6 +246,7 @@#define NIX_AF_DEBUG_NPC_RESP_DATAX (a) (0x680 | (a) << 3)#define NIX_AF_SMQX_CFG (a) (0x700 | (a) << 16) +#define NIX_AF_SQM_DBG_CTL_STATUS (0x750)#define NIX_AF_PSE_CHANNEL_LEVEL (0x800)#define NIX_AF_PSE_SHAPER_CFG (0x810)#define NIX_AF_TX_EXPR_CREDIT (0x830)
Signature · 1 line
2.7.4
PATCH v2 15/18 octeontx2-af: Enable broadcast packet replication
In reply to [email protected]From: Sunil Goutham <[email protected]>
Ingress packet replication support has been added to 96xx B0 silicon. This patch enables using that feature to replicate ingress broadcast packets to PF and it's VFs.
Also fixed below issues
- VFs can also install NPC MCAM entry to forward broadcast pkts. Otherwise, unless PF's interface is UP, VFs will not receive bcast packets.
- NPC MCAM entry is disabled when PF and all it's VFs are down.
- Few corner cases in installing multicast entry list.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 3 + drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 36 +++++---- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 87 ++++++++++++---------- 4 files changed, 69 insertions(+), 59 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +3 -0
@@ -64,6 +64,7 @@ static void rvu_setup_hw_capabilities(struct rvu *rvu) hw->cap.nix_fixed_txschq_mapping = false; hw->cap.nix_shaping = true; hw->cap.nix_tx_link_bp = true; + hw->cap.nix_rx_multicast = true;if (is_rvu_96xx_B0 (rvu)) { hw->cap.nix_fixed_txschq_mapping = true;
@@ -72,6 +73,8 @@ static void rvu_setup_hw_capabilities(struct rvu *rvu) hw->cap.nix_txsch_per_sdp_lmac =76 ; hw->cap.nix_shaping = false; hw->cap.nix_tx_link_bp = false; +if (is_rvu_96xx_A0 (rvu)) + hw->cap.nix_rx_multicast = false; } }
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
@@ -235,6 +235,7 @@ struct hw_cap {bool nix_fixed_txschq_mapping;/* Schq mapping fixed or flexible */ bool nix_shaping;/* Is shaping and coloring supported */ bool nix_tx_link_bp;/* Can link backpressure TL queues ? */ +bool nix_rx_multicast;/* Rx packet replication support */ };struct rvu_hwinfo {
@@ -441,6 +442,7 @@ void rvu_npc_disable_promisc_entry(struct rvu *rvu, u16 pcifunc, int nixlf);void rvu_npc_enable_promisc_entry (struct rvu *rvu,u16 pcifunc,int nixlf);void rvu_npc_install_bcast_match_entry (struct rvu *rvu,u16 pcifunc,int nixlf,u64 chan); +void rvu_npc_disable_bcast_entry (struct rvu *rvu,u16 pcifunc);int rvu_npc_update_rxvlan (struct rvu *rvu,u16 pcifunc,int nixlf);void rvu_npc_disable_mcam_entries (struct rvu *rvu,u16 pcifunc,int nixlf);void rvu_npc_disable_default_entries (struct rvu *rvu,u16 pcifunc,int nixlf);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +17 -19
@@ -64,7 +64,6 @@ enum nix_makr_fmt_indexes {struct mce {struct hlist_node node; -u16 idx;u16 pcifunc; };
@@ -1754,7 +1753,7 @@ static int nix_setup_mce(struct rvu *rvu, int mce, u8 op, }static int nix_update_mce_list (struct nix_mce_list *mce_list, -u16 pcifunc,int idx,bool add) +u16 pcifunc,bool add) {struct mce *mce, *tail =NULL ;bool delete = false;
@@ -1783,7 +1782,6 @@ static int nix_update_mce_list(struct nix_mce_list *mce_list, mce =kzalloc (sizeof (*mce),GFP_KERNEL );if (!mce)return -ENOMEM ; - mce->idx = idx; mce->pcifunc = pcifunc;if (!tail)hlist_add_head (&mce->node, &mce_list->head);
@@ -1795,12 +1793,12 @@ static int nix_update_mce_list(struct nix_mce_list *mce_list,static int nix_update_bcast_mce_list (struct rvu *rvu,u16 pcifunc,bool add) { -int err =0 , idx, next_idx, count; +int err =0 , idx, next_idx, last_idx;struct nix_mce_list *mce_list; -struct mce *mce, *next_mce;struct nix_mcast *mcast;struct nix_hw *nix_hw;struct rvu_pfvf *pfvf; +struct mce *mce;int blkaddr;/* Broadcast pkt replication is not needed for AF's VFs, hence skip */
@@ -1832,31 +1830,31 @@ static int nix_update_bcast_mce_list(struct rvu *rvu, u16 pcifunc, bool add)mutex_lock (&mcast->mce_lock); - err =nix_update_mce_list (mce_list, pcifunc, idx, add); + err =nix_update_mce_list (mce_list, pcifunc, add);if (err) goto end;/* Disable MCAM entry in NPC */ - -if (!mce_list->count) +if (!mce_list->count) { +rvu_npc_disable_bcast_entry (rvu, pcifunc); goto end; - count = mce_list->count; + }/* Dump the updated list to HW */ + idx = pfvf->bcast_mce_idx; + last_idx = idx + mce_list->count -1 ;hlist_for_each_entry (mce, &mce_list->head, node) { - next_idx =0 ; - count--; -if (count) { - next_mce =hlist_entry (mce->node.next, - struct mce, node); - next_idx = next_mce->idx; - } +if (idx > last_idx) +break ; + + next_idx = idx +1 ;/* EOL should be set in last MCE */ - err =nix_setup_mce (rvu, mce->idx, -NIX_AQ_INSTOP_WRITE , mce->pcifunc, - next_idx, count ? false : true); + err =nix_setup_mce (rvu, idx,NIX_AQ_INSTOP_WRITE , + mce->pcifunc, next_idx, + (next_idx > last_idx) ? true : false);if (err) goto end; + idx++; } end:
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +47 -40
115 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 16/18 octeontx2-af: Support configurable NDC cache way_mask
In reply to [email protected]From: Geetha sowjanya <[email protected]>
Each of the NIX/NPA LFs can choose which ways of their respective NDC caches should be used to cache their contexts. This enables flexible configurations like disabling caching for a LF, limiting it's context to a certain set of ways etc etc. Separate way_mask for NIX-TX and NIX-RX is not supported.
--- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 2 ++ .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 28 +++++++++++++++------- .../net/ethernet/marvell/octeontx2/af/rvu_npa.c | 9 +++++-- 3 files changed, 28 insertions(+), 11 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2 -0
@@ -361,6 +361,7 @@ struct npa_lf_alloc_req {int node;int aura_sz;/* No of auras */ u32 nr_pools;/* No of pools */ +u64 way_mask; };struct npa_lf_alloc_rsp {
@@ -451,6 +452,7 @@ struct nix_lf_alloc_req {u16 npa_func;u16 sso_func;u64 rx_cfg;/* See NIX_AF_LF(0..127)_RX_CFG */ +u64 way_mask; };struct nix_lf_alloc_rsp {
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +19 -9
@@ -378,7 +378,8 @@ static void nix_ctx_free(struct rvu *rvu, struct rvu_pfvf *pfvf)static int nixlf_rss_ctx_init (struct rvu *rvu,int blkaddr,struct rvu_pfvf *pfvf,int nixlf, -int rss_sz,int rss_grps,int hwctx_size) +int rss_sz,int rss_grps,int hwctx_size, +u64 way_mask) {int err, grp, num_indices;
@@ -398,7 +399,8 @@ static int nixlf_rss_ctx_init(struct rvu *rvu, int blkaddr,/* Config full RSS table size, enable RSS and caching */ rvu_write64 (rvu, blkaddr,NIX_AF_LFX_RSS_CFG (nixlf),BIT_ULL (36 ) |BIT_ULL (4 ) | -ilog2 (num_indices /MAX_RSS_INDIR_TBL_SIZE )); +ilog2 (num_indices /MAX_RSS_INDIR_TBL_SIZE ) | + way_mask <<20 );/* Config RSS group offset and sizes */ for (grp =0 ; grp < rss_grps; grp++) rvu_write64(rvu, blkaddr, NIX_AF_LFX_RSS_GRPX(nixlf, grp),
@@ -741,6 +743,9 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,if (!req->rq_cnt || !req->sq_cnt || !req->cq_cnt)return NIX_AF_ERR_PARAM ; +if (req->way_mask) + req->way_mask &=0xFFFF ; + pfvf =rvu_get_pfvf (rvu, pcifunc); blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_NIX , pcifunc);if (!pfvf->nixlf || blkaddr <0 )
@@ -806,7 +811,7 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu, (u64)pfvf->rq_ctx->iova);/* Set caching and queue count in HW */ - cfg =BIT_ULL (36 ) | (req->rq_cnt -1 ); + cfg =BIT_ULL (36 ) | (req->rq_cnt -1 ) | req->way_mask <<20 ;rvu_write64 (rvu, blkaddr,NIX_AF_LFX_RQS_CFG (nixlf), cfg);/* Alloc NIX SQ HW context memory and config the base */
@@ -821,7 +826,8 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,rvu_write64 (rvu, blkaddr,NIX_AF_LFX_SQS_BASE (nixlf), (u64 )pfvf->sq_ctx->iova); - cfg =BIT_ULL (36 ) | (req->sq_cnt -1 ); + + cfg =BIT_ULL (36 ) | (req->sq_cnt -1 ) | req->way_mask <<20 ;rvu_write64 (rvu, blkaddr,NIX_AF_LFX_SQS_CFG (nixlf), cfg);/* Alloc NIX CQ HW context memory and config the base */
@@ -836,13 +842,14 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,rvu_write64 (rvu, blkaddr,NIX_AF_LFX_CQS_BASE (nixlf), (u64 )pfvf->cq_ctx->iova); - cfg =BIT_ULL (36 ) | (req->cq_cnt -1 ); + + cfg =BIT_ULL (36 ) | (req->cq_cnt -1 ) | req->way_mask <<20 ;rvu_write64 (rvu, blkaddr,NIX_AF_LFX_CQS_CFG (nixlf), cfg);/* Initialize receive side scaling (RSS) */ hwctx_size =1UL << ((ctx_cfg >>12 ) &0xF ); - err =nixlf_rss_ctx_init (rvu, blkaddr, pfvf, nixlf, - req->rss_sz, req->rss_grps, hwctx_size); + err =nixlf_rss_ctx_init (rvu, blkaddr, pfvf, nixlf, req->rss_sz, + req->rss_grps, hwctx_size, req->way_mask);if (err) goto free_mem;
@@ -856,7 +863,9 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,rvu_write64 (rvu, blkaddr,NIX_AF_LFX_CINTS_BASE (nixlf), (u64 )pfvf->cq_ints_ctx->iova); -rvu_write64 (rvu, blkaddr,NIX_AF_LFX_CINTS_CFG (nixlf),BIT_ULL (36 )); + +rvu_write64 (rvu, blkaddr,NIX_AF_LFX_CINTS_CFG (nixlf), +BIT_ULL (36 ) | req->way_mask <<20 );/* Alloc memory for QINT's HW contexts */ cfg =rvu_read64 (rvu, blkaddr,NIX_AF_CONST2 );
@@ -868,7 +877,8 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,rvu_write64 (rvu, blkaddr,NIX_AF_LFX_QINTS_BASE (nixlf), (u64 )pfvf->nix_qints_ctx->iova); -rvu_write64 (rvu, blkaddr,NIX_AF_LFX_QINTS_CFG (nixlf),BIT_ULL (36 )); +rvu_write64 (rvu, blkaddr,NIX_AF_LFX_QINTS_CFG (nixlf), +BIT_ULL (36 ) | req->way_mask <<20 );/* Setup VLANX TPID's. * Use VLAN1 for 802.1Q
drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c +7 -2
@@ -289,6 +289,9 @@ int rvu_mbox_handler_npa_lf_alloc(struct rvu *rvu, req->aura_sz == NPA_AURA_SZ_0 || !req->nr_pools)return NPA_AF_ERR_PARAM ; +if (req->way_mask) + req->way_mask &=0xFFFF ; + pfvf =rvu_get_pfvf (rvu, pcifunc); blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_NPA , pcifunc);if (!pfvf->npalf || blkaddr <0 )
@@ -345,7 +348,8 @@ int rvu_mbox_handler_npa_lf_alloc(struct rvu *rvu,/* Clear way partition mask and set aura offset to '0' */ cfg &= ~(BIT_ULL (34 ) -1 );/* Set aura size & enable caching of contexts */ - cfg |= (req->aura_sz <<16 ) |BIT_ULL (34 ); + cfg |= (req->aura_sz <<16 ) |BIT_ULL (34 ) | req->way_mask; +rvu_write64 (rvu, blkaddr,NPA_AF_LFX_AURAS_CFG (npalf), cfg);/* Configure aura HW context's base */
@@ -353,7 +357,8 @@ int rvu_mbox_handler_npa_lf_alloc(struct rvu *rvu, (u64)pfvf->aura_ctx->iova);/* Enable caching of qints hw context */ -rvu_write64 (rvu, blkaddr,NPA_AF_LFX_QINTS_CFG (npalf),BIT_ULL (36 )); +rvu_write64 (rvu, blkaddr,NPA_AF_LFX_QINTS_CFG (npalf), +BIT_ULL (36 ) | req->way_mask <<20 );rvu_write64 (rvu, blkaddr,NPA_AF_LFX_QINTS_BASE (npalf), (u64 )pfvf->npa_qints_ctx->iova);
Signature · 1 line
2.7.4
PATCH v2 17/18 octeontx2-af: Add option to disable dynamic entry caching in NDC
In reply to [email protected]From: Sunil Goutham <[email protected]>
A config option is added to disable caching of dynamic entries like SQEs and stack pages. Also locks down all HW contexts in NDC, preventing them from being evicted.
This option is useful when the queue count is large and there are huge NDC cache misses. It's trade off between SQ context misses and dynamically changing entries like SQE and stack page pointers.
--- drivers/net/ethernet/marvell/octeontx2/Kconfig | 10 ++++ .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 64 +++++++++++++++++++++- .../net/ethernet/marvell/octeontx2/af/rvu_npa.c | 42 ++++++++++++++ 3 files changed, 113 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/Kconfig +10 -0
@@ -16,3 +16,13 @@ config OCTEONTX2_AF Unit's admin function manager which manages all RVU HW resources and provides a medium to other PF/VFs to configure HW. Should be enabled for other RVU device drivers to work. + +config NDC_DIS_DYNAMIC_CACHING + bool "Disable caching of dynamic entries in NDC" + depends on OCTEONTX2_AF + default n + ---help--- + This config option disables caching of dynamic entries such as NIX SQEs + , NPA stack pages etc in NDC. Also locks down NIX SQ/CQ/RQ/RSS and + NPA Aura/Pool contexts. +
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +61 -3
94 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c +42 -0
60 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 18/18 octeontx2-af: Start/Stop traffic in CGX along with NPC
In reply to [email protected]From: Subbaraya Sundeep <[email protected]>
Traffic for a CGX mapped NIXLF can be stopped by disabling entries in NPC MCAM or by configuring CGX and mailbox messages exist for the two options. If traffic is stopped at CGX then VFs of that PF are also effected hence CGX traffic should be started/stopped by tracking all the users of it. This patch implements that CGX users tracking. CGX is also configured along with NPC if required.
Also removed a check which mandates even number of LBK VFs.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 12 ------ drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 5 +++ .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 49 ++++++++++++++++++++++ .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 13 +++++- 4 files changed, 65 insertions(+), 14 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +0 -12
@@ -2364,18 +2364,6 @@ static int rvu_enable_sriov(struct rvu *rvu)if (vfs > chans) vfs = chans; -/* AF's VFs work in pairs and talk over consecutive loopback channels. -* Thus we want to enable maximum even number of VFs. In case -* odd number of VFs are available then the last VF on the list -* remains disabled. -*/ -if (vfs &0x1 ) { -dev_warn (&pdev->dev, -"Number of VFs should be even. Enabling %d out of %d.\n" , - vfs -1 , vfs); - vfs--; - } -if (!vfs)return 0 ;
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +5 -0
@@ -179,6 +179,9 @@ struct rvu_pfvf {struct mcam_entry entry;int rxvlan_index;bool rxvlan; + +bool cgx_in_use;/* this PF/VF using CGX? */ +int cgx_users;/* number of cgx users - used only by PFs */ };struct nix_txsch {
@@ -306,6 +309,7 @@ struct rvu {struct workqueue_struct *cgx_evh_wq;spinlock_t cgx_evq_lock;/* cgx event queue lock */ struct list_head cgx_evq_head;/* cgx event queue head */ +struct mutex cgx_cfg_lock;/* serialize cgx configuration */ char mkex_pfl_name[MKEX_NAME_LEN ];/* Configured MKEX profile name */
@@ -410,6 +414,7 @@ int rvu_cgx_exit(struct rvu *rvu);void *rvu_cgx_pdata (u8 cgx_id,struct rvu *rvu);int rvu_cgx_config_rxtx (struct rvu *rvu,u16 pcifunc,bool start);void rvu_cgx_enadis_rx_bp (struct rvu *rvu,int pf,bool enable); +int rvu_cgx_start_stop_io (struct rvu *rvu,u16 pcifunc,bool start);int rvu_cgx_nix_cuml_stats (struct rvu *rvu,void *cgxd,int lmac_id,int index,int rxtxflag,u64 *stat);/* NPA APIs */
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +49 -0
58 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +11 -2
@@ -194,6 +194,11 @@ static int nix_interface_init(struct rvu *rvu, u16 pcifunc, int type, int nixlf)break ;case NIX_INTF_TYPE_LBK : vf = (pcifunc &RVU_PFVF_FUNC_MASK ) -1 ; + +/* Note that AF's VFs work in pairs and talk over consecutive +* loopback channels.Therefore if odd number of AF VFs are +* enabled then the last VF remains with no pair. +*/ pfvf->rx_chan_base =NIX_CHAN_LBK_CHX (0 , vf); pfvf->tx_chan_base = vf &0x1 ?NIX_CHAN_LBK_CHX (0 , vf -1 ) :NIX_CHAN_LBK_CHX (0 , vf +1 );
@@ -3120,7 +3125,8 @@ int rvu_mbox_handler_nix_lf_start_rx(struct rvu *rvu, struct msg_req *req,return err;rvu_npc_enable_default_entries (rvu, pcifunc, nixlf); -return 0 ; + +return rvu_cgx_start_stop_io (rvu, pcifunc, true); } int rvu_mbox_handler_nix_lf_stop_rx(struct rvu *rvu, struct msg_req *req,
@@ -3134,7 +3140,8 @@ int rvu_mbox_handler_nix_lf_stop_rx(struct rvu *rvu, struct msg_req *req,return err;rvu_npc_disable_default_entries (rvu, pcifunc, nixlf); -return 0 ; + +return rvu_cgx_start_stop_io (rvu, pcifunc, false); }void rvu_nix_lf_teardown (struct rvu *rvu,u16 pcifunc,int blkaddr,int nixlf)
@@ -3150,6 +3157,8 @@ void rvu_nix_lf_teardown(struct rvu *rvu, u16 pcifunc, int blkaddr, int nixlf)nix_rx_sync (rvu, blkaddr);nix_txschq_free (rvu, pcifunc); +rvu_cgx_start_stop_io (rvu, pcifunc, false); +if (pfvf->sq_ctx) { ctx_req.ctype =NIX_AQ_CTYPE_SQ ; err =nix_lf_hwctx_disable (rvu, &ctx_req);
Signature · 1 line
2.7.4
David Miller
maintainerFrom: [email protected]
Date: Thu, 14 Nov 2019 10:56:15 +0530
Quoted 19 lines
From: Sunil Goutham <[email protected]>
This patchset adds debugfs support to dump various HW state machine info which helps in debugging issues. Info includes
- Current queue context, stats, resource utilization etc
- MCAM entry utilization, miss and pkt drop counter
- CGX ingress and egress stats
- Current RVU block allocation status
- etc.Rest patches has changes wrt
- Updated packet parsing profile for parsing more protocols.
- RSS algorithms to include inner protocols while generating hash
- Handle current version of silicon's limitations wrt shaping, coloring and fixed mapping of transmit limiter queue's configuration.
- Enable broadcast packet replication to PF and it's VFs.
- Support for configurable NDC cache waymask
- etc
Quoted 3 lines
Changes from v1:
Removed inline keyword for newly introduced APIs in few patches.
- Suggested by David Miller.
Series applied to net-next, thanks.