Skip to content

Commit 425652d

Browse files
committedJul 12, 2024
Merge branch 'octeontx2-cpt-rss-cfg-fixes' into main
Srujana Challa says: ==================== Fixes for CPT and RSS configuration This series of patches fixes various issues related to CPT configuration and RSS configuration. v1->v2: - Excluded the patch "octeontx2-af: reduce cpt flt interrupt vectors for cn10kb" to submit it to net-next. - Addressed the review comments. Kiran Kumar K (1): octeontx2-af: Fix issue with IPv6 ext match for RSS ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8b9b59e + 60795bb commit 425652d

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed
 

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ struct cpt_lf_alloc_req_msg {
17451745
u16 nix_pf_func;
17461746
u16 sso_pf_func;
17471747
u16 eng_grpmsk;
1748-
int blkaddr;
1748+
u8 blkaddr;
17491749
u8 ctx_ilen_valid : 1;
17501750
u8 ctx_ilen : 7;
17511751
};

‎drivers/net/ethernet/marvell/octeontx2/af/npc.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,20 @@ enum npc_kpu_lb_ltype {
6363
NPC_LT_LB_CUSTOM1 = 0xF,
6464
};
6565

66+
/* Don't modify ltypes up to IP6_EXT, otherwise length and checksum of IP
67+
* headers may not be checked correctly. IPv4 ltypes and IPv6 ltypes must
68+
* differ only at bit 0 so mask 0xE can be used to detect extended headers.
69+
*/
6670
enum npc_kpu_lc_ltype {
67-
NPC_LT_LC_IP = 1,
71+
NPC_LT_LC_PTP = 1,
72+
NPC_LT_LC_IP,
6873
NPC_LT_LC_IP_OPT,
6974
NPC_LT_LC_IP6,
7075
NPC_LT_LC_IP6_EXT,
7176
NPC_LT_LC_ARP,
7277
NPC_LT_LC_RARP,
7378
NPC_LT_LC_MPLS,
7479
NPC_LT_LC_NSH,
75-
NPC_LT_LC_PTP,
7680
NPC_LT_LC_FCOE,
7781
NPC_LT_LC_NGIO,
7882
NPC_LT_LC_CUSTOM0 = 0xE,

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

+16-7
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,8 @@ int rvu_mbox_handler_cpt_rd_wr_register(struct rvu *rvu,
696696
struct cpt_rd_wr_reg_msg *req,
697697
struct cpt_rd_wr_reg_msg *rsp)
698698
{
699-
int blkaddr;
699+
u64 offset = req->reg_offset;
700+
int blkaddr, lf;
700701

701702
blkaddr = validate_and_get_cpt_blkaddr(req->blkaddr);
702703
if (blkaddr < 0)
@@ -707,17 +708,25 @@ int rvu_mbox_handler_cpt_rd_wr_register(struct rvu *rvu,
707708
!is_cpt_vf(rvu, req->hdr.pcifunc))
708709
return CPT_AF_ERR_ACCESS_DENIED;
709710

710-
rsp->reg_offset = req->reg_offset;
711-
rsp->ret_val = req->ret_val;
712-
rsp->is_write = req->is_write;
713-
714711
if (!is_valid_offset(rvu, req))
715712
return CPT_AF_ERR_ACCESS_DENIED;
716713

714+
/* Translate local LF used by VFs to global CPT LF */
715+
lf = rvu_get_lf(rvu, &rvu->hw->block[blkaddr], req->hdr.pcifunc,
716+
(offset & 0xFFF) >> 3);
717+
718+
/* Translate local LF's offset to global CPT LF's offset */
719+
offset &= 0xFF000;
720+
offset += lf << 3;
721+
722+
rsp->reg_offset = offset;
723+
rsp->ret_val = req->ret_val;
724+
rsp->is_write = req->is_write;
725+
717726
if (req->is_write)
718-
rvu_write64(rvu, blkaddr, req->reg_offset, req->val);
727+
rvu_write64(rvu, blkaddr, offset, req->val);
719728
else
720-
rsp->val = rvu_read64(rvu, blkaddr, req->reg_offset);
729+
rsp->val = rvu_read64(rvu, blkaddr, offset);
721730

722731
return 0;
723732
}

‎drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -3864,6 +3864,11 @@ static int get_flowkey_alg_idx(struct nix_hw *nix_hw, u32 flow_cfg)
38643864
return -ERANGE;
38653865
}
38663866

3867+
/* Mask to match ipv6(NPC_LT_LC_IP6) and ipv6 ext(NPC_LT_LC_IP6_EXT) */
3868+
#define NPC_LT_LC_IP6_MATCH_MSK ((~(NPC_LT_LC_IP6 ^ NPC_LT_LC_IP6_EXT)) & 0xf)
3869+
/* Mask to match both ipv4(NPC_LT_LC_IP) and ipv4 ext(NPC_LT_LC_IP_OPT) */
3870+
#define NPC_LT_LC_IP_MATCH_MSK ((~(NPC_LT_LC_IP ^ NPC_LT_LC_IP_OPT)) & 0xf)
3871+
38673872
static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)
38683873
{
38693874
int idx, nr_field, key_off, field_marker, keyoff_marker;
@@ -3933,7 +3938,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)
39333938
field->hdr_offset = 9; /* offset */
39343939
field->bytesm1 = 0; /* 1 byte */
39353940
field->ltype_match = NPC_LT_LC_IP;
3936-
field->ltype_mask = 0xF;
3941+
field->ltype_mask = NPC_LT_LC_IP_MATCH_MSK;
39373942
break;
39383943
case NIX_FLOW_KEY_TYPE_IPV4:
39393944
case NIX_FLOW_KEY_TYPE_INNR_IPV4:
@@ -3960,8 +3965,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)
39603965
field->bytesm1 = 3; /* DIP, 4 bytes */
39613966
}
39623967
}
3963-
3964-
field->ltype_mask = 0xF; /* Match only IPv4 */
3968+
field->ltype_mask = NPC_LT_LC_IP_MATCH_MSK;
39653969
keyoff_marker = false;
39663970
break;
39673971
case NIX_FLOW_KEY_TYPE_IPV6:
@@ -3990,7 +3994,7 @@ static int set_flowkey_fields(struct nix_rx_flowkey_alg *alg, u32 flow_cfg)
39903994
field->bytesm1 = 15; /* DIP,16 bytes */
39913995
}
39923996
}
3993-
field->ltype_mask = 0xF; /* Match only IPv6 */
3997+
field->ltype_mask = NPC_LT_LC_IP6_MATCH_MSK;
39943998
break;
39953999
case NIX_FLOW_KEY_TYPE_TCP:
39964000
case NIX_FLOW_KEY_TYPE_UDP:

0 commit comments

Comments
 (0)
Please sign in to comment.