Skip to content

Commit 050eb2c

Browse files
danobikuba-moo
authored andcommitted
bnxt_en: ethtool: Remove ip4/ip6 ntuple support for IPPROTO_RAW
Commit 9ba0e56 ("bnxt_en: Enhance ethtool ntuple support for ip flows besides TCP/UDP") added support for ip4/ip6 ntuple rules. However, if you wanted to wildcard over l4proto, you had to provide 0xFF. The choice of 0xFF is non-standard and non-intuitive. Delete support for it in this commit. Next commit we will introduce a cleaner way to wildcard l4proto. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Reviewed-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/a5ba0d3bd926d27977c317efa7fdfbc8a704d2b8.1730778566.git.dxu@dxuuu.xyz Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 4f19c82 commit 050eb2c

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,14 +1124,10 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
11241124
fkeys = &fltr->fkeys;
11251125
fmasks = &fltr->fmasks;
11261126
if (fkeys->basic.n_proto == htons(ETH_P_IP)) {
1127-
if (fkeys->basic.ip_proto == IPPROTO_ICMP ||
1128-
fkeys->basic.ip_proto == IPPROTO_RAW) {
1127+
if (fkeys->basic.ip_proto == IPPROTO_ICMP) {
11291128
fs->flow_type = IP_USER_FLOW;
11301129
fs->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
1131-
if (fkeys->basic.ip_proto == IPPROTO_ICMP)
1132-
fs->h_u.usr_ip4_spec.proto = IPPROTO_ICMP;
1133-
else
1134-
fs->h_u.usr_ip4_spec.proto = IPPROTO_RAW;
1130+
fs->h_u.usr_ip4_spec.proto = IPPROTO_ICMP;
11351131
fs->m_u.usr_ip4_spec.proto = BNXT_IP_PROTO_FULL_MASK;
11361132
} else if (fkeys->basic.ip_proto == IPPROTO_TCP) {
11371133
fs->flow_type = TCP_V4_FLOW;
@@ -1153,13 +1149,9 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
11531149
fs->m_u.tcp_ip4_spec.pdst = fmasks->ports.dst;
11541150
}
11551151
} else {
1156-
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6 ||
1157-
fkeys->basic.ip_proto == IPPROTO_RAW) {
1152+
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6) {
11581153
fs->flow_type = IPV6_USER_FLOW;
1159-
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6)
1160-
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_ICMPV6;
1161-
else
1162-
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_RAW;
1154+
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_ICMPV6;
11631155
fs->m_u.usr_ip6_spec.l4_proto = BNXT_IP_PROTO_FULL_MASK;
11641156
} else if (fkeys->basic.ip_proto == IPPROTO_TCP) {
11651157
fs->flow_type = TCP_V6_FLOW;
@@ -1285,7 +1277,7 @@ static bool bnxt_verify_ntuple_ip4_flow(struct ethtool_usrip4_spec *ip_spec,
12851277
if (ip_mask->l4_4_bytes || ip_mask->tos ||
12861278
ip_spec->ip_ver != ETH_RX_NFC_IP4 ||
12871279
ip_mask->proto != BNXT_IP_PROTO_FULL_MASK ||
1288-
(ip_spec->proto != IPPROTO_RAW && ip_spec->proto != IPPROTO_ICMP))
1280+
ip_spec->proto != IPPROTO_ICMP)
12891281
return false;
12901282
return true;
12911283
}
@@ -1295,8 +1287,7 @@ static bool bnxt_verify_ntuple_ip6_flow(struct ethtool_usrip6_spec *ip_spec,
12951287
{
12961288
if (ip_mask->l4_4_bytes || ip_mask->tclass ||
12971289
ip_mask->l4_proto != BNXT_IP_PROTO_FULL_MASK ||
1298-
(ip_spec->l4_proto != IPPROTO_RAW &&
1299-
ip_spec->l4_proto != IPPROTO_ICMPV6))
1290+
ip_spec->l4_proto != IPPROTO_ICMPV6)
13001291
return false;
13011292
return true;
13021293
}

0 commit comments

Comments
 (0)