Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: vishal@chelsio.com
Cc: netdev@vger.kernel.org, rahul.lakkireddy@chelsio.com, mkubecek@suse.cz
Subject: Re: [PATCH net-next] ethtool: allow flow-type ether without IP protocol field
Date: Wed, 19 Aug 2020 16:27:49 -0700 (PDT)	[thread overview]
Message-ID: <20200819.162749.429169729481879920.davem@davemloft.net> (raw)
In-Reply-To: <20200818185503.664-1-vishal@chelsio.com>

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
> 

  reply	other threads:[~2020-08-19 23:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 18:55 Vishal Kulkarni
2020-08-19 23:27 ` David Miller [this message]
2020-08-20 19:34 ` Michal Kubecek
2020-08-20 23:26 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200819.162749.429169729481879920.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=vishal@chelsio.com \
    --subject='Re: [PATCH net-next] ethtool: allow flow-type ether without IP protocol field' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).