Skip to content

Commit e59b495

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-04-16 (ice) This series contains updates to ice driver only. Michal fixes a couple of issues with TC filter parsing; always add match for src_vsi and remove flag check that could prevent addition of valid filters. Marcin adds additional checks for unsupported flower filters. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Fix checking for unsupported keys on non-tunnel device ice: tc: allow zero flags in parsing tc flower ice: tc: check src_vsi in case of traffic from VF ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents caed8eb + 2cca35f commit e59b495

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ ice_tc_count_lkups(u32 flags, struct ice_tc_flower_lyr_2_4_hdrs *headers,
2828
* - ICE_TC_FLWR_FIELD_VLAN_TPID (present if specified)
2929
* - Tunnel flag (present if tunnel)
3030
*/
31+
if (fltr->direction == ICE_ESWITCH_FLTR_EGRESS)
32+
lkups_cnt++;
3133

3234
if (flags & ICE_TC_FLWR_FIELD_TENANT_ID)
3335
lkups_cnt++;
@@ -363,6 +365,11 @@ ice_tc_fill_rules(struct ice_hw *hw, u32 flags,
363365
/* Always add direction metadata */
364366
ice_rule_add_direction_metadata(&list[ICE_TC_METADATA_LKUP_IDX]);
365367

368+
if (tc_fltr->direction == ICE_ESWITCH_FLTR_EGRESS) {
369+
ice_rule_add_src_vsi_metadata(&list[i]);
370+
i++;
371+
}
372+
366373
rule_info->tun_type = ice_sw_type_from_tunnel(tc_fltr->tunnel_type);
367374
if (tc_fltr->tunnel_type != TNL_LAST) {
368375
i = ice_tc_fill_tunnel_outer(flags, tc_fltr, list, i);
@@ -772,7 +779,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
772779
int ret;
773780
int i;
774781

775-
if (!flags || (flags & ICE_TC_FLWR_FIELD_ENC_SRC_L4_PORT)) {
782+
if (flags & ICE_TC_FLWR_FIELD_ENC_SRC_L4_PORT) {
776783
NL_SET_ERR_MSG_MOD(fltr->extack, "Unsupported encap field(s)");
777784
return -EOPNOTSUPP;
778785
}
@@ -820,6 +827,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
820827

821828
/* specify the cookie as filter_rule_id */
822829
rule_info.fltr_rule_id = fltr->cookie;
830+
rule_info.src_vsi = vsi->idx;
823831

824832
ret = ice_add_adv_rule(hw, list, lkups_cnt, &rule_info, &rule_added);
825833
if (ret == -EEXIST) {
@@ -1481,7 +1489,10 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
14811489
(BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
14821490
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
14831491
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
1484-
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS))) {
1492+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) |
1493+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
1494+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS) |
1495+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL))) {
14851496
NL_SET_ERR_MSG_MOD(fltr->extack, "Tunnel key used, but device isn't a tunnel");
14861497
return -EOPNOTSUPP;
14871498
} else {

0 commit comments

Comments
 (0)