mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
bnxt_en: ethtool: Remove ip4/ip6 ntuple support for IPPROTO_RAW
Commit 9ba0e56199 ("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>
This commit is contained in:
parent
4f19c82402
commit
050eb2cebb
|
|
@ -1124,14 +1124,10 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
|
|||
fkeys = &fltr->fkeys;
|
||||
fmasks = &fltr->fmasks;
|
||||
if (fkeys->basic.n_proto == htons(ETH_P_IP)) {
|
||||
if (fkeys->basic.ip_proto == IPPROTO_ICMP ||
|
||||
fkeys->basic.ip_proto == IPPROTO_RAW) {
|
||||
if (fkeys->basic.ip_proto == IPPROTO_ICMP) {
|
||||
fs->flow_type = IP_USER_FLOW;
|
||||
fs->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
|
||||
if (fkeys->basic.ip_proto == IPPROTO_ICMP)
|
||||
fs->h_u.usr_ip4_spec.proto = IPPROTO_ICMP;
|
||||
else
|
||||
fs->h_u.usr_ip4_spec.proto = IPPROTO_RAW;
|
||||
fs->h_u.usr_ip4_spec.proto = IPPROTO_ICMP;
|
||||
fs->m_u.usr_ip4_spec.proto = BNXT_IP_PROTO_FULL_MASK;
|
||||
} else if (fkeys->basic.ip_proto == IPPROTO_TCP) {
|
||||
fs->flow_type = TCP_V4_FLOW;
|
||||
|
|
@ -1153,13 +1149,9 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
|
|||
fs->m_u.tcp_ip4_spec.pdst = fmasks->ports.dst;
|
||||
}
|
||||
} else {
|
||||
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6 ||
|
||||
fkeys->basic.ip_proto == IPPROTO_RAW) {
|
||||
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6) {
|
||||
fs->flow_type = IPV6_USER_FLOW;
|
||||
if (fkeys->basic.ip_proto == IPPROTO_ICMPV6)
|
||||
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_ICMPV6;
|
||||
else
|
||||
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_RAW;
|
||||
fs->h_u.usr_ip6_spec.l4_proto = IPPROTO_ICMPV6;
|
||||
fs->m_u.usr_ip6_spec.l4_proto = BNXT_IP_PROTO_FULL_MASK;
|
||||
} else if (fkeys->basic.ip_proto == IPPROTO_TCP) {
|
||||
fs->flow_type = TCP_V6_FLOW;
|
||||
|
|
@ -1285,7 +1277,7 @@ static bool bnxt_verify_ntuple_ip4_flow(struct ethtool_usrip4_spec *ip_spec,
|
|||
if (ip_mask->l4_4_bytes || ip_mask->tos ||
|
||||
ip_spec->ip_ver != ETH_RX_NFC_IP4 ||
|
||||
ip_mask->proto != BNXT_IP_PROTO_FULL_MASK ||
|
||||
(ip_spec->proto != IPPROTO_RAW && ip_spec->proto != IPPROTO_ICMP))
|
||||
ip_spec->proto != IPPROTO_ICMP)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1295,8 +1287,7 @@ static bool bnxt_verify_ntuple_ip6_flow(struct ethtool_usrip6_spec *ip_spec,
|
|||
{
|
||||
if (ip_mask->l4_4_bytes || ip_mask->tclass ||
|
||||
ip_mask->l4_proto != BNXT_IP_PROTO_FULL_MASK ||
|
||||
(ip_spec->l4_proto != IPPROTO_RAW &&
|
||||
ip_spec->l4_proto != IPPROTO_ICMPV6))
|
||||
ip_spec->l4_proto != IPPROTO_ICMPV6)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user