Skip to content

Commit a8e8fbe

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: fix flow type handling for RSS filters
The FLOW_RSS flag was causing us to insert UDP filters when TCP was wanted. Fixes: 42356d9 ("sfc: support RSS spreading of ethtool ntuple filters") Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0a65e3 commit a8e8fbe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/net/ethernet/sfc/ethtool.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
10881088
struct ethtool_tcpip6_spec *ip6_mask = &rule->m_u.tcp_ip6_spec;
10891089
struct ethtool_usrip6_spec *uip6_entry = &rule->h_u.usr_ip6_spec;
10901090
struct ethtool_usrip6_spec *uip6_mask = &rule->m_u.usr_ip6_spec;
1091+
u32 flow_type = rule->flow_type & ~(FLOW_EXT | FLOW_RSS);
10911092
struct ethhdr *mac_entry = &rule->h_u.ether_spec;
10921093
struct ethhdr *mac_mask = &rule->m_u.ether_spec;
10931094
enum efx_filter_flags flags = 0;
@@ -1121,14 +1122,14 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
11211122
if (rule->flow_type & FLOW_RSS)
11221123
spec.rss_context = rss_context;
11231124

1124-
switch (rule->flow_type & ~(FLOW_EXT | FLOW_RSS)) {
1125+
switch (flow_type) {
11251126
case TCP_V4_FLOW:
11261127
case UDP_V4_FLOW:
11271128
spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE |
11281129
EFX_FILTER_MATCH_IP_PROTO);
11291130
spec.ether_type = htons(ETH_P_IP);
1130-
spec.ip_proto = ((rule->flow_type & ~FLOW_EXT) == TCP_V4_FLOW ?
1131-
IPPROTO_TCP : IPPROTO_UDP);
1131+
spec.ip_proto = flow_type == TCP_V4_FLOW ? IPPROTO_TCP
1132+
: IPPROTO_UDP;
11321133
if (ip_mask->ip4dst) {
11331134
if (ip_mask->ip4dst != IP4_ADDR_FULL_MASK)
11341135
return -EINVAL;
@@ -1162,8 +1163,8 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
11621163
spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE |
11631164
EFX_FILTER_MATCH_IP_PROTO);
11641165
spec.ether_type = htons(ETH_P_IPV6);
1165-
spec.ip_proto = ((rule->flow_type & ~FLOW_EXT) == TCP_V6_FLOW ?
1166-
IPPROTO_TCP : IPPROTO_UDP);
1166+
spec.ip_proto = flow_type == TCP_V6_FLOW ? IPPROTO_TCP
1167+
: IPPROTO_UDP;
11671168
if (!ip6_mask_is_empty(ip6_mask->ip6dst)) {
11681169
if (!ip6_mask_is_full(ip6_mask->ip6dst))
11691170
return -EINVAL;

0 commit comments

Comments
 (0)