* [PATCH net-next] ethtool: allow flow-type ether without IP protocol field
@ 2020-08-18 18:55 Vishal Kulkarni
2020-08-19 23:27 ` David Miller
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vishal Kulkarni @ 2020-08-18 18:55 UTC (permalink / raw)
To: netdev, davem; +Cc: rahul.lakkireddy, Vishal Kulkarni
Set IP protocol mask only when IP protocol field is set.
This will allow flow-type ether with vlan rule which don't have
protocol field to apply.
ethtool -N ens5f4 flow-type ether proto 0x8100 vlan 0x600\
m 0x1FFF action 3 loc 16
Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
---
net/ethtool/ioctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 441794e0034f..e6f5cf52023c 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -3025,13 +3025,14 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
case TCP_V4_FLOW:
case TCP_V6_FLOW:
match->key.basic.ip_proto = IPPROTO_TCP;
+ match->mask.basic.ip_proto = 0xff;
break;
case UDP_V4_FLOW:
case UDP_V6_FLOW:
match->key.basic.ip_proto = IPPROTO_UDP;
+ match->mask.basic.ip_proto = 0xff;
break;
}
- match->mask.basic.ip_proto = 0xff;
match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
match->dissector.offset[FLOW_DISSECTOR_KEY_BASIC] =
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] ethtool: allow flow-type ether without IP protocol field
2020-08-18 18:55 [PATCH net-next] ethtool: allow flow-type ether without IP protocol field Vishal Kulkarni
@ 2020-08-19 23:27 ` David Miller
2020-08-20 19:34 ` Michal Kubecek
2020-08-20 23:26 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-08-19 23:27 UTC (permalink / raw)
To: vishal; +Cc: netdev, rahul.lakkireddy, mkubecek
From: Vishal Kulkarni <vishal@chelsio.com>
Date: Wed, 19 Aug 2020 00:25:03 +0530
> Set IP protocol mask only when IP protocol field is set.
> This will allow flow-type ether with vlan rule which don't have
> protocol field to apply.
>
> ethtool -N ens5f4 flow-type ether proto 0x8100 vlan 0x600\
> m 0x1FFF action 3 loc 16
>
> Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Michal, please review.
> ---
> net/ethtool/ioctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 441794e0034f..e6f5cf52023c 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -3025,13 +3025,14 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
> case TCP_V4_FLOW:
> case TCP_V6_FLOW:
> match->key.basic.ip_proto = IPPROTO_TCP;
> + match->mask.basic.ip_proto = 0xff;
> break;
> case UDP_V4_FLOW:
> case UDP_V6_FLOW:
> match->key.basic.ip_proto = IPPROTO_UDP;
> + match->mask.basic.ip_proto = 0xff;
> break;
> }
> - match->mask.basic.ip_proto = 0xff;
>
> match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
> match->dissector.offset[FLOW_DISSECTOR_KEY_BASIC] =
> --
> 2.21.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] ethtool: allow flow-type ether without IP protocol field
2020-08-18 18:55 [PATCH net-next] ethtool: allow flow-type ether without IP protocol field Vishal Kulkarni
2020-08-19 23:27 ` David Miller
@ 2020-08-20 19:34 ` Michal Kubecek
2020-08-20 23:26 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Michal Kubecek @ 2020-08-20 19:34 UTC (permalink / raw)
To: netdev; +Cc: Vishal Kulkarni, davem, rahul.lakkireddy
[-- Attachment #1: Type: text/plain, Size: 1539 bytes --]
On Wed, Aug 19, 2020 at 12:25:03AM +0530, Vishal Kulkarni wrote:
> Set IP protocol mask only when IP protocol field is set.
> This will allow flow-type ether with vlan rule which don't have
> protocol field to apply.
>
> ethtool -N ens5f4 flow-type ether proto 0x8100 vlan 0x600\
> m 0x1FFF action 3 loc 16
>
> Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
> ---
> net/ethtool/ioctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 441794e0034f..e6f5cf52023c 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -3025,13 +3025,14 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
> case TCP_V4_FLOW:
> case TCP_V6_FLOW:
> match->key.basic.ip_proto = IPPROTO_TCP;
> + match->mask.basic.ip_proto = 0xff;
> break;
> case UDP_V4_FLOW:
> case UDP_V6_FLOW:
> match->key.basic.ip_proto = IPPROTO_UDP;
> + match->mask.basic.ip_proto = 0xff;
> break;
> }
> - match->mask.basic.ip_proto = 0xff;
>
> match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
> match->dissector.offset[FLOW_DISSECTOR_KEY_BASIC] =
> --
> 2.21.1
>
This is certainly correct. We should also handle SCTP_V4_FLOW and
SCTP_V6_FLOW in the same way as {TCP,UDP}_V{4,6}_FLOW but that is an
unrelated problem which should be handled separately (and also needs to
be addressed in the switch statement above this one).
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] ethtool: allow flow-type ether without IP protocol field
2020-08-18 18:55 [PATCH net-next] ethtool: allow flow-type ether without IP protocol field Vishal Kulkarni
2020-08-19 23:27 ` David Miller
2020-08-20 19:34 ` Michal Kubecek
@ 2020-08-20 23:26 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-08-20 23:26 UTC (permalink / raw)
To: vishal; +Cc: netdev, rahul.lakkireddy
From: Vishal Kulkarni <vishal@chelsio.com>
Date: Wed, 19 Aug 2020 00:25:03 +0530
> Set IP protocol mask only when IP protocol field is set.
> This will allow flow-type ether with vlan rule which don't have
> protocol field to apply.
>
> ethtool -N ens5f4 flow-type ether proto 0x8100 vlan 0x600\
> m 0x1FFF action 3 loc 16
>
> Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-20 23:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 18:55 [PATCH net-next] ethtool: allow flow-type ether without IP protocol field Vishal Kulkarni
2020-08-19 23:27 ` David Miller
2020-08-20 19:34 ` Michal Kubecek
2020-08-20 23:26 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.