Skip to content

Commit e134df9

Browse files
committed
ice: add PF GTP-U RSS/FDIR configuration for VFs
Add support GTPoGRE inner L3/L4 & outer L3 fields matching for AVF FDIR. Add support to enable RSS and FDIR for GTPU and PPPoE. Add support GTPU with inner IPv4/UDP/TCP for AVF FDIR, including: ipv4 + gtpu/gtpu_eh + ipv4 + udp/tcp Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent 61baee2 commit e134df9

19 files changed

Lines changed: 2484 additions & 359 deletions

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2883,6 +2883,19 @@ static u32 ice_parse_hdrs(struct ethtool_rxnfc *nfc)
28832883
return hdrs;
28842884
}
28852885

2886+
#define ICE_FLOW_HASH_FLD_IPV4_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)
2887+
#define ICE_FLOW_HASH_FLD_IPV6_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)
2888+
#define ICE_FLOW_HASH_FLD_IPV4_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)
2889+
#define ICE_FLOW_HASH_FLD_IPV6_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)
2890+
#define ICE_FLOW_HASH_FLD_TCP_SRC_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT)
2891+
#define ICE_FLOW_HASH_FLD_TCP_DST_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT)
2892+
#define ICE_FLOW_HASH_FLD_UDP_SRC_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)
2893+
#define ICE_FLOW_HASH_FLD_UDP_DST_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)
2894+
#define ICE_FLOW_HASH_FLD_SCTP_SRC_PORT \
2895+
BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)
2896+
#define ICE_FLOW_HASH_FLD_SCTP_DST_PORT \
2897+
BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT)
2898+
28862899
/**
28872900
* ice_parse_hash_flds - parses hash fields from RSS hash input
28882901
* @nfc: ethtool rxnfc command
@@ -3033,7 +3046,7 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
30333046
cfg.hdr_type = ICE_RSS_ANY_HEADERS;
30343047
cfg.symm = symm;
30353048

3036-
status = ice_add_rss_cfg(&pf->hw, vsi, &cfg);
3049+
status = ice_add_rss_cfg(&pf->hw, vsi->idx, &cfg);
30373050
if (status) {
30383051
dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %d\n",
30393052
vsi->vsi_num, status);

drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ void ice_fdir_rem_adq_chnl(struct ice_hw *hw, u16 vsi_idx)
327327
/* find flow profile corresponding to prof_id and clear
328328
* vsi_idx from bitmap.
329329
*/
330-
status = ice_flow_rem_vsi_prof(hw, vsi_idx, prof_id);
330+
status = ice_flow_rem_vsi_prof(hw, ICE_BLK_FD, vsi_idx, prof_id);
331331
if (status) {
332332
dev_err(ice_hw_to_dev(hw), "ice_flow_rem_vsi_prof() failed status=%d\n",
333333
status);
@@ -449,7 +449,7 @@ void ice_fdir_replay_flows(struct ice_hw *hw)
449449
prof = hw->fdir_prof[flow];
450450
ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX,
451451
prof->fdir_seg[tun], TNL_SEG_CNT(tun),
452-
false, &hw_prof);
452+
NULL, 0, false, &hw_prof);
453453
for (j = 0; j < prof->cnt; j++) {
454454
enum ice_flow_priority prio;
455455
u64 entry_h = 0;
@@ -461,7 +461,8 @@ void ice_fdir_replay_flows(struct ice_hw *hw)
461461
prof->vsi_h[0],
462462
prof->vsi_h[j],
463463
prio, prof->fdir_seg,
464-
&entry_h);
464+
NULL, 0, &entry_h);
465+
465466
if (err) {
466467
dev_err(ice_hw_to_dev(hw), "Could not replay Flow Director, flow type %d\n",
467468
flow);
@@ -689,17 +690,20 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
689690
* actions (NULL) and zero actions 0.
690691
*/
691692
err = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, seg,
692-
TNL_SEG_CNT(tun), false, &prof);
693+
TNL_SEG_CNT(tun), NULL, 0, false, &prof);
694+
693695
if (err)
694696
return err;
697+
695698
err = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, main_vsi->idx,
696-
main_vsi->idx, ICE_FLOW_PRIO_NORMAL,
697-
seg, &entry1_h);
699+
main_vsi->idx, ICE_FLOW_PRIO_NORMAL, seg, NULL,
700+
0, &entry1_h);
698701
if (err)
699702
goto err_prof;
703+
700704
err = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id, main_vsi->idx,
701-
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL,
702-
seg, &entry2_h);
705+
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL, seg, NULL,
706+
0, &entry2_h);
703707
if (err)
704708
goto err_entry;
705709

@@ -724,7 +728,7 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
724728
err = ice_flow_add_entry(hw, ICE_BLK_FD, prof->id,
725729
main_vsi->idx, vsi_h,
726730
ICE_FLOW_PRIO_NORMAL, seg,
727-
&entry1_h);
731+
NULL, 0, &entry1_h);
728732
if (err) {
729733
dev_err(dev, "Could not add Channel VSI %d to flow group\n",
730734
idx);
@@ -1570,7 +1574,7 @@ ice_fdir_write_all_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input,
15701574
bool is_tun = tun == ICE_FD_HW_SEG_TUN;
15711575
int err;
15721576

1573-
if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num, TNL_ALL))
1577+
if (is_tun && !ice_get_open_tunnel_port(&pf->hw, TNL_ALL, &port_num))
15741578
continue;
15751579
err = ice_fdir_write_fltr(pf, input, add, is_tun);
15761580
if (err)
@@ -2026,7 +2030,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd)
20262030
}
20272031

20282032
/* return error if not an update and no available filters */
2029-
fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port, TNL_ALL) ? 2 : 1;
2033+
fltrs_needed = ice_get_open_tunnel_port(hw, TNL_ALL, &tunnel_port) ? 2 : 1;
20302034
if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) &&
20312035
ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) {
20322036
dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");

drivers/net/ethernet/intel/ice/ice_fdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
906906
memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len);
907907
loc = pkt;
908908
} else {
909-
if (!ice_get_open_tunnel_port(hw, &tnl_port, TNL_ALL))
909+
if (!ice_get_open_tunnel_port(hw, TNL_ALL, &tnl_port))
910910
return -ENOENT;
911911
if (!ice_fdir_pkt[idx].tun_pkt)
912912
return -EINVAL;

0 commit comments

Comments
 (0)