netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: davem@davemloft.net, Florian Fainelli <f.fainelli@gmail.com>,
	Jiri Pirko <jiri@mellanox.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	thomas.petazzoni@bootlin.com
Subject: Re: [PATCH net-next] net: ethtool: Allow parsing ETHER_FLOW types when using flow_rule
Date: Wed, 26 Jun 2019 11:23:55 +0200	[thread overview]
Message-ID: <20190626112355.73a1e74f@bootlin.com> (raw)
In-Reply-To: <20190626085846.ax277ojvyp5k3abt@salvia>

Hi Pablo,

On Wed, 26 Jun 2019 10:58:46 +0200
Pablo Neira Ayuso <pablo@netfilter.org> wrote:

>On Wed, Jun 26, 2019 at 10:44:03AM +0200, Maxime Chevallier wrote:
>> When parsing an ethtool_rx_flow_spec, users can specify an ethernet flow
>> which could contain matches based on the ethernet header, such as the
>> MAC address, the VLAN tag or the ethertype.
>> 
>> Only the ethtype field is specific to the ether flow, the MAC and vlan
>> fields are processed using the special FLOW_EXT and FLOW_MAC_EXT flags.
>> 
>> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
>> ---
>>  net/core/ethtool.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>> 
>> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
>> index 4d1011b2e24f..01ceba556341 100644
>> --- a/net/core/ethtool.c
>> +++ b/net/core/ethtool.c
>> @@ -2883,6 +2883,18 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
>>  	match->mask.basic.n_proto = htons(0xffff);
>>  
>>  	switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT | FLOW_RSS)) {
>> +	case ETHER_FLOW: {
>> +		const struct ethhdr *ether_spec, *ether_m_spec;
>> +
>> +		ether_spec = &fs->h_u.ether_spec;
>> +		ether_m_spec = &fs->m_u.ether_spec;
>> +
>> +		if (ether_m_spec->h_proto) {
>> +			match->key.basic.n_proto = ether_spec->h_proto;
>> +			match->mask.basic.n_proto = ether_m_spec->h_proto;
>> +		}  
>
>I see some drivers in the tree also interpret the h_source and h_dest
>fields?

Ah yes you're right. I assumed these fields were specific to the
FLOW_MAC_EXT flags, but by looking into the ethtool code, it seems we
do need to handle the h_source and h_dest fields.

I'll respin with these fields added.

Thanks for the review,

Maxime

      reply	other threads:[~2019-06-26  9:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  8:44 [PATCH net-next] net: ethtool: Allow parsing ETHER_FLOW types when using flow_rule Maxime Chevallier
2019-06-26  8:58 ` Pablo Neira Ayuso
2019-06-26  9:23   ` Maxime Chevallier [this message]

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=20190626112355.73a1e74f@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).