octeontx2-af: NIX and NPC enhancements
v2 cover octeontx2-af: NIX and NPC enhancements
This patchset is a continuation to earlier submitted four patch series to add a new driver for Marvell's OcteonTX2 SOC's Resource virtualization unit (RVU) admin function driver.
1. octeontx2-af: Add RVU Admin Function driver
https://www.spinics.net/lists/netdev/msg528272.html
2. octeontx2-af: NPA and NIX blocks initialization
https://www.spinics.net/lists/netdev/msg529163.html
3. octeontx2-af: NPC parser and NIX blocks initialization
https://www.spinics.net/lists/netdev/msg530252.html
4. octeontx2-af: NPC MCAM support and FLR handling
https://www.spinics.net/lists/netdev/msg534392.html
This patch series adds support for below
NPC block:
- Add NPC(mkex) profile support for various Key extraction configurations
NIX block:
- Enable dynamic RSS flow key algorithm configuration
- Enhancements on Rx checksum and error checks
- Add support for Tx packet marking support
- TL1 schedule queue allocation enhancements
- Add LSO format configuration mbox
- VLAN TPID configuration
- Skip multicast entry init for broadcast tables
v2:
- Rename FLOW_* to NIX_FLOW_* to avoid serious global namespace collisions, as we have various FLOW_* definitions coming from include/uapi/linux/pkt_cls.h for example.(David Miller)
- Pack the arguments of rvu_get_tl1_schqs() function
as 80 columns allows.(David Miller)
Jerin Jacob (5):
octeontx2-af: Add response for RSS flow key cfg message
octeontx2-af: Add support for dynamic flow cfg to RSS field generation
octeontx2-af: Add support for runtime RSS algo index reservation
octeontx2-af: Enable inner IPv4 checksum and its error code
octeontx2-af: Define all NIX_AF_RX_DEF_* registers
Krzysztof Kanas (1):
octeontx2-af: Add support for Tx packet marking
Nithin Dabilpuram (4):
octeontx2-af: Restrict TL1 allocation and configuration
octeontx2-af: Allow freeing single TLx Tx schedule queue
octeontx2-af: Configure VLAN TPIDs
octeontx2-af: Add LSO format configuration mailbox
Sunil Goutham (1):
octeontx2-af: Skip NIXLF check for bcast MCE entry
Vamsi Attunuru (2):
octeontx2-af: Enable RSS with promiscuous mode
octeontx2-af: Enable mkex profile
Vidhya Raman (1):
octeontx2-af: Add L3 and L4 packet verification mailbox
.../net/ethernet/marvell/octeontx2/af/cgx.c | 54 ++ .../net/ethernet/marvell/octeontx2/af/cgx.h | 1 + .../ethernet/marvell/octeontx2/af/cgx_fw_if.h | 12 + .../ethernet/marvell/octeontx2/af/common.h | 25 +- .../net/ethernet/marvell/octeontx2/af/mbox.h | 62 +- .../net/ethernet/marvell/octeontx2/af/npc.h | 18 + .../net/ethernet/marvell/octeontx2/af/rvu.c | 15 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 40 +- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 895 +++++++++++++++--- .../ethernet/marvell/octeontx2/af/rvu_npc.c | 157 ++- 10 files changed, 1095 insertions(+), 184 deletions(-)
Signature · 1 line
2.19.2
PATCH v2 1/14 octeontx2-af: Skip NIXLF check for bcast MCE entry
From: Sunil Goutham <[email protected]>
At the time of initial broadcast packet replication table init, NIXLFs are not yet attached to PF_FUNCs. Hence skipped checking NIXLF while submitting MCE entry init instruction to NIX admin queue.
Also did a minor cleanup while installing bcast match entry in packet parser unit i.e NPC.
--- .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 14 +++++++++----- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +9 -5
@@ -431,9 +431,8 @@ static int rvu_nix_aq_enq_inst(struct rvu *rvu, struct nix_aq_enq_req *req,bool ena;u64 cfg; - pfvf =rvu_get_pfvf (rvu, pcifunc); blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_NIX , pcifunc); -if (!pfvf->nixlf || blkaddr <0 ) +if (blkaddr <0 )return NIX_AF_ERR_AF_LF_INVALID ; block = &hw->block[blkaddr];
@@ -443,9 +442,14 @@ static int rvu_nix_aq_enq_inst(struct rvu *rvu, struct nix_aq_enq_req *req,return NIX_AF_ERR_AQ_ENQUEUE ; } + pfvf =rvu_get_pfvf (rvu, pcifunc); nixlf =rvu_get_lf (rvu, block, pcifunc,0 ); -if (nixlf <0 ) -return NIX_AF_ERR_AF_LF_INVALID ; + +/* Skip NIXLF check for broadcast MCE entry init */ +if (!(!rsp && req->ctype ==NIX_AQ_CTYPE_MCE )) { +if (!pfvf->nixlf || nixlf <0 ) +return NIX_AF_ERR_AF_LF_INVALID ; + }switch (req->ctype) {case NIX_AQ_CTYPE_RQ :
@@ -1295,7 +1299,7 @@ static int nix_setup_mce(struct rvu *rvu, int mce, u8 op,struct nix_aq_enq_req aq_req;int err; - aq_req.hdr.pcifunc = pcifunc; + aq_req.hdr.pcifunc =0 ; aq_req.ctype =NIX_AQ_CTYPE_MCE ; aq_req.op = op; aq_req.qidx = mce;
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +1 -1
@@ -476,7 +476,7 @@ void rvu_npc_install_bcast_match_entry(struct rvu *rvu, u16 pcifunc,* */ entry.kw[0 ] =BIT_ULL (13 ) | chan; - entry.kw_mask[0 ] = ~entry.kw[0 ] & (BIT_ULL (13 ) |0xFFFULL ); + entry.kw_mask[0 ] =BIT_ULL (13 ) |0xFFFULL ; *(u64 *)&action =0x00 ;#ifdef MCAST_MCE
Signature · 1 line
2.19.2
PATCH v2 2/14 octeontx2-af: Add response for RSS flow key cfg message
In reply to Jerin JacobAdded response for nix_rss_flowkey_cfg message to return selected RSS algorithm index.
The FLOW_KEY_TYPE* definition is part of the mbox message and it will be used by the other consumers of AF driver hence moving to mbox.h.
Also renamed FLOW_* definitions to NIX_FLOW_* to avoid global name space collisions, as we have various coming from include/uapi/linux/pkt_cls.h for example.
---
v2:
- Rename FLOW_* to NIX_FLOW_* to avoid serious global namespace collisions, as we have various FLOW_* definitions coming from include/uapi/linux/pkt_cls.h for example.(David Miller)
--- .../ethernet/marvell/octeontx2/af/common.h | 28 ++--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 14 ++- .../net/ethernet/marvell/octeontx2/af/rvu.h | 2 +- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 113 ++++++++++-------- 4 files changed, 85 insertions(+), 72 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/common.h +10 -18
@@ -193,26 +193,18 @@ enum nix_scheduler {#define DEFAULT_RSS_CONTEXT_GROUP 0#define MAX_RSS_INDIR_TBL_SIZE 256/* 1 << Max adder bits */ -/* NIX flow tag, key type flags */ -#define FLOW_KEY_TYPE_PORT BIT(0) -#define FLOW_KEY_TYPE_IPV4 BIT(1) -#define FLOW_KEY_TYPE_IPV6 BIT(2) -#define FLOW_KEY_TYPE_TCP BIT(3) -#define FLOW_KEY_TYPE_UDP BIT(4) -#define FLOW_KEY_TYPE_SCTP BIT(5) -/* NIX flow tag algorithm indices, max is 31 */ enum { -FLOW_KEY_ALG_PORT , -FLOW_KEY_ALG_IP , -FLOW_KEY_ALG_TCP , -FLOW_KEY_ALG_UDP , -FLOW_KEY_ALG_SCTP , -FLOW_KEY_ALG_TCP_UDP , -FLOW_KEY_ALG_TCP_SCTP , -FLOW_KEY_ALG_UDP_SCTP , -FLOW_KEY_ALG_TCP_UDP_SCTP , -FLOW_KEY_ALG_MAX , +NIX_FLOW_KEY_ALG_PORT , +NIX_FLOW_KEY_ALG_IP , +NIX_FLOW_KEY_ALG_TCP , +NIX_FLOW_KEY_ALG_UDP , +NIX_FLOW_KEY_ALG_SCTP , +NIX_FLOW_KEY_ALG_TCP_UDP , +NIX_FLOW_KEY_ALG_TCP_SCTP , +NIX_FLOW_KEY_ALG_UDP_SCTP , +NIX_FLOW_KEY_ALG_TCP_UDP_SCTP , +NIX_FLOW_KEY_ALG_MAX , };#endif /* COMMON_H */
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +13 -1
@@ -193,7 +193,8 @@ M(NIX_TXSCHQ_CFG, 0x8006, nix_txschq_cfg, nix_txschq_config, msg_rsp) \ M(NIX_STATS_RST, 0x8007, nix_stats_rst, msg_req, msg_rsp) \ M(NIX_VTAG_CFG, 0x8008, nix_vtag_cfg, nix_vtag_config, msg_rsp) \M (NIX_RSS_FLOWKEY_CFG ,0x8009 , nix_rss_flowkey_cfg, \ - nix_rss_flowkey_cfg, msg_rsp) \ + nix_rss_flowkey_cfg, \ + nix_rss_flowkey_cfg_rsp) \ M(NIX_SET_MAC_ADDR, 0x800a, nix_set_mac_addr, nix_set_mac_addr, msg_rsp) \ M(NIX_SET_RX_MODE, 0x800b, nix_set_rx_mode, nix_rx_mode, msg_rsp) \M (NIX_SET_HW_FRS ,0x800c , nix_set_hw_frs, nix_frs_cfg, msg_rsp) \
@@ -560,10 +561,21 @@ struct nix_vtag_config {struct nix_rss_flowkey_cfg {struct mbox_msghdr hdr;int mcam_index;/* MCAM entry index to modify */ +#define NIX_FLOW_KEY_TYPE_PORT BIT(0) +#define NIX_FLOW_KEY_TYPE_IPV4 BIT(1) +#define NIX_FLOW_KEY_TYPE_IPV6 BIT(2) +#define NIX_FLOW_KEY_TYPE_TCP BIT(3) +#define NIX_FLOW_KEY_TYPE_UDP BIT(4) +#define NIX_FLOW_KEY_TYPE_SCTP BIT(5)u32 flowkey_cfg;/* Flowkey types selected */ u8 group;/* RSS context or group */ }; +struct nix_rss_flowkey_cfg_rsp { +struct mbox_msghdr hdr; +u8 alg_idx;/* Selected algo index */ +}; +struct nix_set_mac_addr {struct mbox_msghdr hdr;u8 mac_addr[ETH_ALEN ];/* MAC address to be set for this pcifunc */
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +1 -1
@@ -398,7 +398,7 @@ int rvu_mbox_handler_nix_rxvlan_alloc(struct rvu *rvu, struct msg_req *req, struct msg_rsp *rsp);int rvu_mbox_handler_nix_rss_flowkey_cfg (struct rvu *rvu,struct nix_rss_flowkey_cfg *req, -struct msg_rsp *rsp); +struct nix_rss_flowkey_cfg_rsp *rsp);int rvu_mbox_handler_nix_set_mac_addr (struct rvu *rvu,struct nix_set_mac_addr *req,struct msg_rsp *rsp);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +61 -52
193 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 3/14 octeontx2-af: Add support for dynamic flow cfg to RSS field generation
In reply to Jerin JacobIntroduce state-based algorithm to convert the flow_key value to RSS algo field used by NIX_AF_RX_FLOW_KEY_ALGX_FIELDX register.
The outer for loop goes over _all_ protocol field and the following variables depict the state machine forward progress logic.
a) keyoff_marker - Enabled when hash byte length needs to be accounted in field->key_offset update.
b) field_marker - Enabled when a new field needs to be selected.
c) group_member - Enabled when a protocol is part of a group.
This would remove the existing hard coding and enable to add new protocol support seamlessly.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 1 + .../ethernet/marvell/octeontx2/af/rvu_nix.c | 113 +++++++++++++----- 2 files changed, 87 insertions(+), 27 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +1 -0
@@ -414,6 +414,7 @@ enum nix_af_status {NIX_AF_INVAL_TXSCHQ_CFG =-412 ,NIX_AF_SMQ_FLUSH_FAILED =-413 ,NIX_AF_ERR_LF_RESET =-414 , +NIX_AF_ERR_RSS_NOSPC_FIELD =-415 ,NIX_AF_INVAL_NPA_PF_FUNC =-419 , NIX_AF_INVAL_SSO_PF_FUNC = -420, };
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +86 -27
166 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 4/14 octeontx2-af: Add support for runtime RSS algo index reservation
In reply to Jerin JacobIntroduced reserve_flowkey_alg_idx()to reserve RSS algorithm index, it would internally use set_flowkey_fields() to generate fields based on the flow key dynamically.
On AF driver init, it would reserve a predefined set RSS algo indexes, which will be available all the time for all the AF driver consumers. The leftover algo indexes can be reserved at runtime through exiting nix_rss_flowkey_cfg mailbox message.
The NIX_FLOW_KEY_TYPE_PORT is removed from predefined a set of RSS flow type as it is not used by any consumer.
--- .../ethernet/marvell/octeontx2/af/common.h | 14 -- .../net/ethernet/marvell/octeontx2/af/mbox.h | 1 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 7 + .../ethernet/marvell/octeontx2/af/rvu_nix.c | 193 ++++++++++-------- 4 files changed, 120 insertions(+), 95 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/common.h +0 -14
@@ -193,18 +193,4 @@ enum nix_scheduler {#define DEFAULT_RSS_CONTEXT_GROUP 0#define MAX_RSS_INDIR_TBL_SIZE 256/* 1 << Max adder bits */ -/* NIX flow tag algorithm indices, max is 31 */ -enum { -NIX_FLOW_KEY_ALG_PORT , -NIX_FLOW_KEY_ALG_IP , -NIX_FLOW_KEY_ALG_TCP , -NIX_FLOW_KEY_ALG_UDP , -NIX_FLOW_KEY_ALG_SCTP , -NIX_FLOW_KEY_ALG_TCP_UDP , -NIX_FLOW_KEY_ALG_TCP_SCTP , -NIX_FLOW_KEY_ALG_UDP_SCTP , -NIX_FLOW_KEY_ALG_TCP_UDP_SCTP , -NIX_FLOW_KEY_ALG_MAX , -}; -#endif /* COMMON_H */
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +1 -0
@@ -415,6 +415,7 @@ enum nix_af_status {NIX_AF_SMQ_FLUSH_FAILED =-413 ,NIX_AF_ERR_LF_RESET =-414 ,NIX_AF_ERR_RSS_NOSPC_FIELD =-415 , +NIX_AF_ERR_RSS_NOSPC_ALGO =-416 ,NIX_AF_INVAL_NPA_PF_FUNC =-419 , NIX_AF_INVAL_SSO_PF_FUNC = -420, };
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +7 -0
@@ -164,9 +164,16 @@ struct npc_pkind {u32 *pfchan_map; }; +struct nix_flowkey { +#define NIX_FLOW_KEY_ALG_MAX 32 +u32 flowkey[NIX_FLOW_KEY_ALG_MAX ]; +int in_use; +}; +struct nix_hw {struct nix_txsch txsch[NIX_TXSCH_LVL_CNT ];/* Tx schedulers */ struct nix_mcast mcast; +struct nix_flowkey flowkey; };struct rvu_hwinfo {
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +112 -81
247 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 5/14 octeontx2-af: Restrict TL1 allocation and configuration
In reply to Jerin JacobFrom: Nithin Dabilpuram <[email protected]>
TL1 is the root node in the scheduling hierarchy and it is a global resource with a limited number.
This patch introduces restriction and validation on the allocation of the TL1 nodes for the effective resource sharing across the AF consumers.
- Limit TL1 allocation to 2 per lmac.
One could be for the normal link and one for IEEE802.3br express link (Express Send DMA).
Effectively all the VF's of an RVU PF(lmac) share the two TL1 schqs.
- TL1 cannot be freed once allocated.
- Allow VF's to only apply default config to TL1 if not already applied. PF's can always overwrite the TL1 config.
- Consider NIX_AQ_INSTOP_WRITE while validating txschq
when sq.ena is set.
---
v2:
- Pack the arguments of rvu_get_tl1_schqs() function as 80 columns allows.(David Miller)
--- .../ethernet/marvell/octeontx2/af/common.h | 3 + .../net/ethernet/marvell/octeontx2/af/rvu.h | 6 +- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 227 ++++++++++++++++-- 3 files changed, 218 insertions(+), 18 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/common.h +3 -0
@@ -143,6 +143,9 @@ enum nix_scheduler { NIX_TXSCH_LVL_CNT = 0x5, }; +#define TXSCH_TL1_DFLT_RR_QTM ((1 << 24) - 1) +#define TXSCH_TL1_DFLT_RR_PRIO (0x1ull) +/* Min/Max packet sizes, excluding FCS */ #define NIC_HW_MIN_FRS 40#define NIC_HW_MAX_FRS 9212
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +5 -1
@@ -156,7 +156,11 @@ struct rvu_pfvf {struct nix_txsch {struct rsrc_bmap schq;u8 lvl; -u16 *pfvf_map; +#define NIX_TXSCHQ_TL1_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)) +u32 *pfvf_map; };struct npc_pkind {
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +210 -17
349 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 6/14 octeontx2-af: Allow freeing single TLx Tx schedule queue
In reply to Jerin JacobFrom: Nithin Dabilpuram <[email protected]>
The default behavior was to free all the TLx Tx schedule queues. This patch adds support for freeing a single Tx schedule queue if TXSCHQ_FREE_ALL flag is not set.
--- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +71 -1
@@ -1252,11 +1252,81 @@ static int nix_txschq_free(struct rvu *rvu, u16 pcifunc)return 0 ; } +static int nix_txschq_free_one (struct rvu *rvu, +struct nix_txsch_free_req *req) +{ +int lvl, schq, nixlf, blkaddr, rc; +struct rvu_hwinfo *hw = rvu->hw; +u16 pcifunc = req->hdr.pcifunc; +struct nix_txsch *txsch; +struct nix_hw *nix_hw; +u32 *pfvf_map; +u64 cfg; + + blkaddr =rvu_get_blkaddr (rvu,BLKTYPE_NIX , pcifunc); +if (blkaddr <0 ) +return NIX_AF_ERR_AF_LF_INVALID ; + + nix_hw =get_nix_hw (rvu->hw, blkaddr); +if (!nix_hw) +return -EINVAL ; + + nixlf =rvu_get_lf (rvu, &hw->block[blkaddr], pcifunc,0 ); +if (nixlf <0 ) +return NIX_AF_ERR_AF_LF_INVALID ; + + lvl = req->schq_lvl; + schq = req->schq; + txsch = &nix_hw->txsch[lvl]; + +/* Don't allow freeing TL1 */ +if (lvl >NIX_TXSCH_LVL_TL2 || + schq >= txsch->schq.max) + goto err; + + pfvf_map = txsch->pfvf_map; +mutex_lock (&rvu->rsrc_lock); + +if (TXSCH_MAP_FUNC (pfvf_map[schq]) != pcifunc) { +mutex_unlock (&rvu->rsrc_lock); + goto err; + } + +/* Flush if it is a SMQ. Onus of disabling +* TL2/3 queue links before SMQ flush is on user +*/ +if (lvl ==NIX_TXSCH_LVL_SMQ ) { + cfg =rvu_read64 (rvu, blkaddr,NIX_AF_SMQX_CFG (schq)); +/* Do SMQ flush and set enqueue xoff */ + cfg |=BIT_ULL (50 ) |BIT_ULL (49 ); +rvu_write64 (rvu, blkaddr,NIX_AF_SMQX_CFG (schq), cfg); + +/* Wait for flush to complete */ + rc =rvu_poll_reg (rvu, blkaddr, +NIX_AF_SMQX_CFG (schq),BIT_ULL (49 ), true); +if (rc) { +dev_err (rvu->dev, +"NIXLF%d: SMQ%d flush failed\n" , nixlf, schq); + } + } + +/* Free the resource */ +rvu_free_rsrc (&txsch->schq, schq); + txsch->pfvf_map[schq] =0 ; +mutex_unlock (&rvu->rsrc_lock); +return 0 ; +err: +return NIX_AF_ERR_TLX_INVALID ; +} +int rvu_mbox_handler_nix_txsch_free (struct rvu *rvu,struct nix_txsch_free_req *req,struct msg_rsp *rsp) { -return nix_txschq_free (rvu, req->hdr.pcifunc); +if (req->flags &TXSCHQ_FREE_ALL ) +return nix_txschq_free (rvu, req->hdr.pcifunc); +else +return nix_txschq_free_one (rvu, req); } static bool is_txschq_config_valid(struct rvu *rvu, u16 pcifunc, int blkaddr,
Signature · 1 line
2.19.2
PATCH v2 7/14 octeontx2-af: Enable inner IPv4 checksum and its error code
In reply to Jerin JacobThis patch enables the inner IPv4 checksum and defines the error code for Rx inner and outer checksum errors. Setting ERRCODE as 1 so that CQE descriptor can be embedded valid checksum error code and the driver can interpret checksum error as ERRLEV = LID + 1 and ERRCODE = 1.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +8 -1
@@ -1008,13 +1008,20 @@ int rvu_npc_init(struct rvu *rvu)rvu_write64 (rvu, blkaddr,NPC_AF_PCK_DEF_OIP4 , (NPC_LID_LC <<8 ) | (NPC_LT_LC_IP <<4 ) |0x0F ); +/* Config Inner IPV4 NPC layer info */ +rvu_write64 (rvu, blkaddr,NPC_AF_PCK_DEF_IIP4 , + (NPC_LID_LF <<8 ) | (NPC_LT_LF_TU_IP <<4 ) |0x0F ); +/* Enable below for Rx pkts. * - Outer IPv4 header checksum validation. * - Detect outer L2 broadcast address and set NPC_RESULT_S[L2M]. +* - Inner IPv4 header checksum validation. +* - Set non zero checksum error code value */ rvu_write64 (rvu, blkaddr,NPC_AF_PCK_CFG ,rvu_read64 (rvu, blkaddr,NPC_AF_PCK_CFG ) | -BIT_ULL (6 ) |BIT_ULL (2 )); +BIT_ULL (32 ) |BIT_ULL (24 ) |BIT_ULL (6 ) | +BIT_ULL (2 ) |BIT_ULL (1 ));/* Set RX and TX side MCAM search key size. * LA..LD (ltype only) + Channel
Signature · 1 line
2.19.2
PATCH v2 8/14 octeontx2-af: Define all NIX_AF_RX_DEF_* registers
In reply to Jerin JacobIn order to support all NIX specific valid length errors and checksum errors on Rx, Update all NIX_AF_RX_DEF_* registers.
Also sorted all registers in HRM definition order.
--- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +20 -5
@@ -2593,18 +2593,33 @@ int rvu_nix_init(struct rvu *rvu)if (err)return err; -/* Config Outer L2, IP, TCP and UDP's NPC layer info. +/* Config Outer/Inner L2, IP, TCP, UDP and SCTP NPC layer info. * This helps HW protocol checker to identify headers * and validate length and checksums. */ rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OL2 , (NPC_LID_LA <<8 ) | (NPC_LT_LA_ETHER <<4 ) |0x0F ); -rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OUDP , - (NPC_LID_LD <<8 ) | (NPC_LT_LD_UDP <<4 ) |0x0F ); -rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OTCP , - (NPC_LID_LD <<8 ) | (NPC_LT_LD_TCP <<4 ) |0x0F );rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OIP4 , (NPC_LID_LC <<8 ) | (NPC_LT_LC_IP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_IIP4 , + (NPC_LID_LF <<8 ) | (NPC_LT_LF_TU_IP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OIP6 , + (NPC_LID_LC <<8 ) | (NPC_LT_LC_IP6 <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_IIP6 , + (NPC_LID_LF <<8 ) | (NPC_LT_LF_TU_IP6 <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OTCP , + (NPC_LID_LD <<8 ) | (NPC_LT_LD_TCP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_ITCP , + (NPC_LID_LG <<8 ) | (NPC_LT_LG_TU_TCP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OUDP , + (NPC_LID_LD <<8 ) | (NPC_LT_LD_UDP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_IUDP , + (NPC_LID_LG <<8 ) | (NPC_LT_LG_TU_UDP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_OSCTP , + (NPC_LID_LD <<8 ) | (NPC_LT_LD_SCTP <<4 ) |0x0F ); +rvu_write64 (rvu, blkaddr,NIX_AF_RX_DEF_ISCTP , + (NPC_LID_LG <<8 ) | (NPC_LT_LG_TU_SCTP <<4 ) | +0x0F ); err =nix_rx_flowkey_alg_cfg (rvu, blkaddr);if (err)
Signature · 1 line
2.19.2
PATCH v2 9/14 octeontx2-af: Enable RSS with promiscuous mode
In reply to Jerin JacobFrom: Vamsi Attunuru <[email protected]>
This patch adds support for enabling RSS in promiscuous mode if RSS is already requested by the AF client.
--- .../ethernet/marvell/octeontx2/af/rvu_npc.c | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +31 -4
@@ -368,9 +368,9 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, int nixlf, u64 chan, bool allmulti) { struct npc_mcam *mcam = &rvu->hw->mcam; +int blkaddr, ucast_idx, index, kwi;struct mcam_entry entry = { {0 } };struct nix_rx_action action = { }; -int blkaddr, index, kwi;/* Only PF or AF VF can add a promiscuous entry */ if ((pcifunc &RVU_PFVF_FUNC_MASK ) && !is_afvf (pcifunc))
@@ -392,9 +392,21 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, entry.kw_mask[kwi] =BIT_ULL (40 ); } - *(u64 *)&action =0x00 ; - action.op =NIX_RX_ACTIONOP_UCAST ; - action.pf_func = pcifunc; + ucast_idx =npc_get_nixlf_mcam_index (mcam, pcifunc, + nixlf,NIXLF_UCAST_ENTRY ); + +/* If the corresponding PF's ucast action is RSS, +* use the same action for promisc also +*/ +if (is_mcam_entry_enabled (rvu, mcam, blkaddr, ucast_idx)) + *(u64 *)&action =npc_get_mcam_action (rvu, mcam, + blkaddr, ucast_idx); + +if (action.op !=NIX_RX_ACTIONOP_RSS ) { + *(u64 *)&action =0x00 ; + action.op =NIX_RX_ACTIONOP_UCAST ; + action.pf_func = pcifunc; + } entry.action = *(u64 *)&action; npc_config_mcam_entry(rvu, mcam, blkaddr, index,
@@ -539,6 +551,21 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf,rvu_write64 (rvu, blkaddr,NPC_AF_MCAMEX_BANKX_ACTION (index, bank), *(u64 *)&action); + index =npc_get_nixlf_mcam_index (mcam, pcifunc, + nixlf,NIXLF_PROMISC_ENTRY ); + +/* If PF's promiscuous entry is enabled, +* Set RSS action for that entry as well +*/ +if (is_mcam_entry_enabled (rvu, mcam, blkaddr, index)) { + bank =npc_get_bank (mcam, index); + index &= (mcam->banksize -1 ); + +rvu_write64 (rvu, blkaddr, +NPC_AF_MCAMEX_BANKX_ACTION (index, bank), + *(u64 *)&action); + } +rvu_npc_update_rxvlan (rvu, pcifunc, nixlf); }
Signature · 1 line
2.19.2
PATCH v2 10/14 octeontx2-af: Add support for Tx packet marking
In reply to Jerin JacobFrom: Krzysztof Kanas <[email protected]>
NIX_AF_MARK_FORMAT(0..127)_CTL register enables an SW defined means to mark/insert various data in the packet based on final packet color from traffic shaping HW.
0..127 works as an index to choose the algorithm. On success, the mailbox returns the index to the client.
Add NIX_MARK_FORMAT_CFG mailbox which reserves mark format based on tuple (offset, y_mask, y_val, r_mask, r_val)
If the tuple is requested again for mark format that was already reserved, then it will be reused. If not it will reserve a new entry if space is available.
Also on AF init commonly used marker format such as VLAN DEI, IPv4 ECN, IPv4 DSCP are reserved for AF consumers.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 18 +++ .../net/ethernet/marvell/octeontx2/af/rvu.h | 12 ++ .../ethernet/marvell/octeontx2/af/rvu_nix.c | 103 ++++++++++++++++++ 3 files changed, 133 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +18 -0
@@ -200,6 +200,9 @@ M(NIX_SET_RX_MODE, 0x800b, nix_set_rx_mode, nix_rx_mode, msg_rsp) \ M(NIX_SET_HW_FRS, 0x800c, nix_set_hw_frs, nix_frs_cfg, msg_rsp) \ M(NIX_LF_START_RX, 0x800d, nix_lf_start_rx, msg_req, msg_rsp) \ M(NIX_LF_STOP_RX, 0x800e, nix_lf_stop_rx, msg_req, msg_rsp) \ +M (NIX_MARK_FORMAT_CFG ,0x800f , nix_mark_format_cfg, \ + nix_mark_format_cfg, \ + nix_mark_format_cfg_rsp) \M (NIX_RXVLAN_ALLOC ,0x8012 , nix_rxvlan_alloc, msg_req, msg_rsp)/* Messages initiated by AF (range 0xC00 - 0xDFF) */
@@ -416,6 +419,7 @@ enum nix_af_status {NIX_AF_ERR_LF_RESET =-414 ,NIX_AF_ERR_RSS_NOSPC_FIELD =-415 ,NIX_AF_ERR_RSS_NOSPC_ALGO =-416 , +NIX_AF_ERR_MARK_CFG_FAIL =-417 ,NIX_AF_INVAL_NPA_PF_FUNC =-419 , NIX_AF_INVAL_SSO_PF_FUNC = -420, };
@@ -583,6 +587,20 @@ struct nix_set_mac_addr {u8 mac_addr[ETH_ALEN ];/* MAC address to be set for this pcifunc */ }; +struct nix_mark_format_cfg { +struct mbox_msghdr hdr; +u8 offset; +u8 y_mask; +u8 y_val; +u8 r_mask; +u8 r_val; +}; + +struct nix_mark_format_cfg_rsp { +struct mbox_msghdr hdr; +u8 mark_format_idx; +}; +struct nix_rx_mode {struct mbox_msghdr hdr;#define NIX_RX_MODE_UCAST BIT(0)
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +12 -0
@@ -163,6 +163,12 @@ struct nix_txsch {u32 *pfvf_map; }; +struct nix_mark_format { +u8 total; +u8 in_use; +u32 *cfg; +}; +struct npc_pkind {struct rsrc_bmap rsrc;u32 *pfchan_map;
@@ -178,6 +184,7 @@ struct nix_hw {struct nix_txsch txsch[NIX_TXSCH_LVL_CNT ];/* Tx schedulers */ struct nix_mcast mcast;struct nix_flowkey flowkey; +struct nix_mark_format mark_format; };struct rvu_hwinfo {
@@ -377,6 +384,8 @@ int rvu_mbox_handler_npa_lf_free(struct rvu *rvu, struct msg_req *req,/* NIX APIs */ bool is_nixlf_attached (struct rvu *rvu,u16 pcifunc);int rvu_nix_init (struct rvu *rvu); +int rvu_nix_reserve_mark_format (struct rvu *rvu,struct nix_hw *nix_hw, +int blkaddr,u32 cfg);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);
@@ -421,6 +430,9 @@ int rvu_mbox_handler_nix_lf_start_rx(struct rvu *rvu, struct msg_req *req, struct msg_rsp *rsp);int rvu_mbox_handler_nix_lf_stop_rx (struct rvu *rvu,struct msg_req *req,struct msg_rsp *rsp); +int rvu_mbox_handler_nix_mark_format_cfg (struct rvu *rvu, +struct nix_mark_format_cfg *req, +struct nix_mark_format_cfg_rsp *rsp);/* NPC APIs */ int rvu_npc_init (struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +103 -0
127 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 11/14 octeontx2-af: Configure VLAN TPIDs
In reply to Jerin JacobFrom: Nithin Dabilpuram <[email protected]>
Setup TPID's for vlan0 and vlan1 for Tx VLAN insertion offloads.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +7 -0
@@ -865,6 +865,13 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu, (u64)pfvf->nix_qints_ctx->iova);rvu_write64 (rvu, blkaddr,NIX_AF_LFX_QINTS_CFG (nixlf),BIT_ULL (36 )); +/* Setup VLANX TPID's. +* Use VLAN1 for 802.1Q +* and VLAN0 for 802.1AD. +*/ + cfg = (0x8100ULL <<16 ) |0x88A8ULL ; +rvu_write64 (rvu, blkaddr,NIX_AF_LFX_TX_CFG (nixlf), cfg); +/* Enable LMTST for this NIX LF */ rvu_write64 (rvu, blkaddr,NIX_AF_LFX_TX_CFG2 (nixlf),BIT_ULL (0 ));
Signature · 1 line
2.19.2
PATCH v2 12/14 octeontx2-af: Add L3 and L4 packet verification mailbox
In reply to Jerin JacobFrom: Vidhya Raman <[email protected]>
Adds mailbox support for L4 checksum verification
and L3 and L4 length verification configuration.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 10 +++++ .../net/ethernet/marvell/octeontx2/af/rvu.h | 3 ++ .../ethernet/marvell/octeontx2/af/rvu_nix.c | 42 +++++++++++++++++++ 3 files changed, 55 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +10 -0
@@ -203,6 +203,7 @@ M(NIX_LF_STOP_RX, 0x800e, nix_lf_stop_rx, msg_req, msg_rsp) \M (NIX_MARK_FORMAT_CFG ,0x800f , nix_mark_format_cfg, \ nix_mark_format_cfg, \ nix_mark_format_cfg_rsp) \ +M(NIX_SET_RX_CFG, 0x8010, nix_set_rx_cfg, nix_rx_cfg, msg_rsp) \M (NIX_RXVLAN_ALLOC ,0x8012 , nix_rxvlan_alloc, msg_req, msg_rsp)/* Messages initiated by AF (range 0xC00 - 0xDFF) */
@@ -609,6 +610,15 @@ struct nix_rx_mode {u16 mode; }; +struct nix_rx_cfg { +struct mbox_msghdr hdr; +#define NIX_RX_OL3_VERIFY BIT(0) +#define NIX_RX_OL4_VERIFY BIT(1) +u8 len_verify;/* Outer L3/L4 len check */ +#define NIX_RX_CSUM_OL4_VERIFY BIT(0) +u8 csum_verify;/* Outer L4 checksum verification */ +}; +struct nix_frs_cfg {struct mbox_msghdr hdr;u8 update_smq;/* Update SMQ's min/max lens */
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +3 -0
@@ -433,6 +433,9 @@ int rvu_mbox_handler_nix_lf_stop_rx(struct rvu *rvu, struct msg_req *req,int rvu_mbox_handler_nix_mark_format_cfg (struct rvu *rvu,struct nix_mark_format_cfg *req,struct nix_mark_format_cfg_rsp *rsp); +int rvu_mbox_handler_nix_set_rx_cfg (struct rvu *rvu,struct nix_rx_cfg *req, +struct msg_rsp *rsp); +/* NPC APIs */ int rvu_npc_init (struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +42 -0
48 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 13/14 octeontx2-af: Add LSO format configuration mailbox
In reply to Jerin JacobFrom: Nithin Dabilpuram <[email protected]>
NIX_AF_LSO_FORMAT(0..31)_FIELD(0..7) register enables an SW defined means to define LSO packet modification formats.
0..31 works as an index to choose the algorithm, On success, the mailbox returns the index to the client of chosen LSO algorithm selection. This index will be used in configuring the transmit descriptors.
Add mailbox interface to dynamically reserve and configure LSO format.
This commit also fixes 'sizem1' for NIX_LSOALG_TCP_FLAGS to '1' i.e 2 Bytes.
--- .../net/ethernet/marvell/octeontx2/af/mbox.h | 16 +++++ .../net/ethernet/marvell/octeontx2/af/rvu.h | 10 ++- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 72 +++++++++++++++++-- 3 files changed, 91 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +16 -0
@@ -204,6 +204,9 @@ M(NIX_MARK_FORMAT_CFG, 0x800f, nix_mark_format_cfg, \ nix_mark_format_cfg, \ nix_mark_format_cfg_rsp) \ M(NIX_SET_RX_CFG, 0x8010, nix_set_rx_cfg, nix_rx_cfg, msg_rsp) \ +M(NIX_LSO_FORMAT_CFG, 0x8011, nix_lso_format_cfg, \ + nix_lso_format_cfg, \ + nix_lso_format_cfg_rsp) \M (NIX_RXVLAN_ALLOC ,0x8012 , nix_rxvlan_alloc, msg_req, msg_rsp)/* Messages initiated by AF (range 0xC00 - 0xDFF) */
@@ -421,6 +424,7 @@ enum nix_af_status {NIX_AF_ERR_RSS_NOSPC_FIELD =-415 ,NIX_AF_ERR_RSS_NOSPC_ALGO =-416 ,NIX_AF_ERR_MARK_CFG_FAIL =-417 , +NIX_AF_ERR_LSO_CFG_FAIL =-418 ,NIX_AF_INVAL_NPA_PF_FUNC =-419 , NIX_AF_INVAL_SSO_PF_FUNC = -420, };
@@ -628,6 +632,18 @@ struct nix_frs_cfg {u16 minlen; }; +struct nix_lso_format_cfg { +struct mbox_msghdr hdr; +u64 field_mask; +#define NIX_LSO_FIELD_MAX 8 +u64 fields[NIX_LSO_FIELD_MAX ]; +}; + +struct nix_lso_format_cfg_rsp { +struct mbox_msghdr hdr; +u8 lso_format_idx; +}; +/* NPC mbox message structs */ #define NPC_MCAM_ENTRY_INVALID 0xFFFF
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +9 -1
@@ -180,11 +180,17 @@ struct nix_flowkey {int in_use; }; +struct nix_lso { +u8 total; +u8 in_use; +}; +struct nix_hw {struct nix_txsch txsch[NIX_TXSCH_LVL_CNT ];/* Tx schedulers */ struct nix_mcast mcast;struct nix_flowkey flowkey;struct nix_mark_format mark_format; +struct nix_lso lso; };struct rvu_hwinfo {
@@ -435,7 +441,9 @@ int rvu_mbox_handler_nix_mark_format_cfg(struct rvu *rvu, struct nix_mark_format_cfg_rsp *rsp);int rvu_mbox_handler_nix_set_rx_cfg (struct rvu *rvu,struct nix_rx_cfg *req,struct msg_rsp *rsp); - +int rvu_mbox_handler_nix_lso_format_cfg (struct rvu *rvu, +struct nix_lso_format_cfg *req, +struct nix_lso_format_cfg_rsp *rsp);/* NPC APIs */ int rvu_npc_init (struct rvu *rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +66 -6
120 lines not on this page · raw message
Signature · 1 line
2.19.2
PATCH v2 14/14 octeontx2-af: Enable mkex profile
In reply to Jerin JacobFrom: Vamsi Attunuru <[email protected]>
The following set of NPC registers allow the driver to configure NPC to generate different key value schemes to compare against packet payload in MCAM search.
NPC_AF_INTF(0..1)_KEX_CFG NPC_AF_KEX_LDATA(0..1)_FLAGS_CFG NPC_AF_INTF(0..1)_LID(0..7)_LT(0..15)_LD(0..1)_CFG NPC_AF_INTF(0..1)_LDATA(0..1)_FLAGS(0..15)_CFG
Currently, the AF driver populates these registers to configure the default values to address the most common use cases such as key generation for channel number + DMAC.
The secure firmware stores different configuration value of these registers to enable different NPC use case along with the name for the lookup.
Patch loads profile binary from secure firmware over the exiting CGX mailbox interface and apply the profile.
AF driver shall fall back to the default configuration in case of any errors.
The AF consumer driver can know the selected profile on response to NPC_GET_KEX_CFG mailbox by introducing mkex_pfl_name in the struct npc_get_kex_cfg_rsp.
--- .../net/ethernet/marvell/octeontx2/af/cgx.c | 54 +++++++++ .../net/ethernet/marvell/octeontx2/af/cgx.h | 1 + .../ethernet/marvell/octeontx2/af/cgx_fw_if.h | 12 ++ .../net/ethernet/marvell/octeontx2/af/mbox.h | 2 + .../net/ethernet/marvell/octeontx2/af/npc.h | 18 +++ .../net/ethernet/marvell/octeontx2/af/rvu.c | 15 +++ .../net/ethernet/marvell/octeontx2/af/rvu.h | 2 + .../ethernet/marvell/octeontx2/af/rvu_npc.c | 111 +++++++++++++++++- 8 files changed, 213 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +54 -0
@@ -498,6 +498,60 @@ static inline bool cgx_event_is_linkevent(u64 event)return false; } +static inline int cgx_fwi_get_mkex_prfl_sz (u64 *prfl_sz, +struct cgx *cgx) +{ +u64 req =0 ; +u64 resp; +int err; + + req =FIELD_SET (CMDREG_ID ,CGX_CMD_GET_MKEX_PRFL_SIZE , req); + err =cgx_fwi_cmd_generic (req, &resp, cgx,0 ); +if (!err) + *prfl_sz =FIELD_GET (RESP_MKEX_PRFL_SIZE , resp); + +return err; +} + +static inline int cgx_fwi_get_mkex_prfl_addr (u64 *prfl_addr, +struct cgx *cgx) +{ +u64 req =0 ; +u64 resp; +int err; + + req =FIELD_SET (CMDREG_ID ,CGX_CMD_GET_MKEX_PRFL_ADDR , req); + err =cgx_fwi_cmd_generic (req, &resp, cgx,0 ); +if (!err) + *prfl_addr =FIELD_GET (RESP_MKEX_PRFL_ADDR , resp); + +return err; +} + +int cgx_get_mkex_prfl_info (u64 *addr,u64 *size) +{ +struct cgx *cgx_dev; +int err; + +if (!addr || !size) +return -EINVAL ; + + cgx_dev = list_first_entry(&cgx_list, struct cgx, cgx_list); +if (!cgx_dev) +return -ENXIO ; + + err =cgx_fwi_get_mkex_prfl_sz (size, cgx_dev); +if (err) +return -EIO ; + + err =cgx_fwi_get_mkex_prfl_addr (addr, cgx_dev); +if (err) +return -EIO ; + +return 0 ; +} +EXPORT_SYMBOL (cgx_get_mkex_prfl_info); +static irqreturn_t cgx_fwi_event_handler (int irq,void *data) {struct lmac *lmac = data;
drivers/net/ethernet/marvell/octeontx2/af/cgx.h +1 -0
@@ -111,4 +111,5 @@ 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);int cgx_lmac_linkup_start (void *cgxd); +int cgx_get_mkex_prfl_info (u64 *addr,u64 *size);#endif /* CGX_H */
drivers/net/ethernet/marvell/octeontx2/af/cgx_fw_if.h +12 -0
@@ -78,6 +78,8 @@ enum cgx_cmd_id {CGX_CMD_LINK_STATE_CHANGE ,CGX_CMD_MODE_CHANGE ,/* hot plug support */ CGX_CMD_INTF_SHUTDOWN , +CGX_CMD_GET_MKEX_PRFL_SIZE , + CGX_CMD_GET_MKEX_PRFL_ADDR };/* async event ids */
@@ -137,6 +139,16 @@ enum cgx_cmd_own {*/ #define RESP_MAC_ADDR GENMASK_ULL(56, 9) +/* Response to cmd ID as CGX_CMD_GET_MKEX_PRFL_SIZE with cmd status as +* CGX_STAT_SUCCESS +*/ +#define RESP_MKEX_PRFL_SIZE GENMASK_ULL(63, 9) + +/* Response to cmd ID as CGX_CMD_GET_MKEX_PRFL_ADDR with cmd status as +* CGX_STAT_SUCCESS +*/ +#define RESP_MKEX_PRFL_ADDR GENMASK_ULL(63, 9) +/* Response to cmd ID - CGX_CMD_LINK_BRING_UP/DOWN, event ID CGX_EVT_LINK_CHANGE * status can be either CGX_STAT_FAIL or CGX_STAT_SUCCESS *
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +2 -0
@@ -788,6 +788,8 @@ struct npc_get_kex_cfg_rsp {u64 intf_lid_lt_ld[NPC_MAX_INTF ][NPC_MAX_LID ][NPC_MAX_LT ][NPC_MAX_LD ];/* NPC_AF_INTF(0..1)_LDATA(0..1)_FLAGS(0..15)_CFG */ u64 intf_ld_flags[NPC_MAX_INTF ][NPC_MAX_LD ][NPC_MAX_LFL ]; +#define MKEX_NAME_LEN 128 + u8 mkex_pfl_name[MKEX_NAME_LEN]; };#endif /* MBOX_H */
drivers/net/ethernet/marvell/octeontx2/af/npc.h +18 -0
@@ -265,4 +265,22 @@ struct nix_rx_action {#define VTAG0_LID_MASK GENMASK_ULL(10, 8)#define VTAG0_RELPTR_MASK GENMASK_ULL(7, 0) +struct npc_mcam_kex { +/* MKEX Profle Header */ +u64 mkex_sign;/* "mcam-kex-profile" (8 bytes/ASCII characters) */ +u8 name[MKEX_NAME_LEN ];/* MKEX Profile name */ +u64 cpu_model;/* Format as profiled by CPU hardware */ +u64 kpu_version;/* KPU firmware/profile version */ +u64 reserved;/* Reserved for extension */ + +/* MKEX Profle Data */ +u64 keyx_cfg[NPC_MAX_INTF ];/* NPC_AF_INTF(0..1)_KEX_CFG */ +/* NPC_AF_KEX_LDATA(0..1)_FLAGS_CFG */ +u64 kex_ld_flags[NPC_MAX_LD ]; +/* NPC_AF_INTF(0..1)_LID(0..7)_LT(0..15)_LD(0..1)_CFG */ +u64 intf_lid_lt_ld[NPC_MAX_INTF ][NPC_MAX_LID ][NPC_MAX_LT ][NPC_MAX_LD ]; +/* NPC_AF_INTF(0..1)_LDATA(0..1)_FLAGS(0..15)_CFG */ +u64 intf_ld_flags[NPC_MAX_INTF ][NPC_MAX_LD ][NPC_MAX_LFL ]; +} __packed; +#endif /* NPC_H */
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +15 -0
@@ -52,6 +52,10 @@ MODULE_LICENSE("GPL v2");MODULE_VERSION (DRV_VERSION );MODULE_DEVICE_TABLE (pci, rvu_id_table); +static char *mkex_profile;/* MKEX profile name */ +module_param (mkex_profile, charp,0000 ); +MODULE_PARM_DESC (mkex_profile,"MKEX profile name string" ); +/* Poll a RVU block's register 'offset', for a 'zero' * or 'nonzero' at bits specified by 'mask' */
@@ -2359,6 +2363,14 @@ static void rvu_disable_sriov(struct rvu *rvu)pci_disable_sriov (rvu->pdev); } +static void rvu_update_module_params (struct rvu *rvu) +{ +const char *default_pfl_name ="default" ; + +strscpy (rvu->mkex_pfl_name, + mkex_profile ? mkex_profile : default_pfl_name,MKEX_NAME_LEN ); +} +static int rvu_probe (struct pci_dev *pdev,const struct pci_device_id *id) {struct device *dev = &pdev->dev;
@@ -2412,6 +2424,9 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err_release_regions; } +/* Store module params in rvu structure */ +rvu_update_module_params (rvu); +/* Check which blocks the HW supports */ rvu_check_block_implemented (rvu);
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -0
@@ -261,6 +261,8 @@ 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 */ + +char mkex_pfl_name[MKEX_NAME_LEN ];/* Configured MKEX profile name */ };static inline void rvu_write64 (struct rvu *rvu,u64 block,u64 offset,u64 val)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +109 -2
135 lines not on this page · raw message
Signature · 1 line
2.19.2
David Miller
maintainerFrom: Jerin Jacob <[email protected]>
Date: Sun, 2 Dec 2018 18:17:35 +0530
Quoted 18 lines
This patchset is a continuation to earlier submitted four patch series to add a new driver for Marvell's OcteonTX2 SOC's Resource virtualization unit (RVU) admin function driver.
1. octeontx2-af: Add RVU Admin Function driver
https://www.spinics.net/lists/netdev/msg528272.html
2. octeontx2-af: NPA and NIX blocks initialization
https://www.spinics.net/lists/netdev/msg529163.html
3. octeontx2-af: NPC parser and NIX blocks initialization
https://www.spinics.net/lists/netdev/msg530252.html
4. octeontx2-af: NPC MCAM support and FLR handling
https://www.spinics.net/lists/netdev/msg534392.htmlThis patch series adds support for below
NPC block:
- Add NPC(mkex) profile support for various Key extraction configurations
Quoted 8 lines
NIX block:
- Enable dynamic RSS flow key algorithm configuration
- Enhancements on Rx checksum and error checks
- Add support for Tx packet marking support
- TL1 schedule queue allocation enhancements
- Add LSO format configuration mbox
- VLAN TPID configuration
- Skip multicast entry init for broadcast tables
...
Series applied, thanks.