Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Govindarajulu Varadarajan <_govind@gmx.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: query: ethtool --show-nfc mask interpretation
Date: Mon, 07 Jul 2014 02:36:50 +0100	[thread overview]
Message-ID: <1404697010.2902.85.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <alpine.LNX.2.03.1407042034540.7230@ws.cisco>

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]

On Fri, 2014-07-04 at 21:43 +0530, Govindarajulu Varadarajan wrote:
> I was working on ethtool --show-nfc implementation for enic.
> 
> While displaying, ethtool displays the 1's compliment of
> ethtool_rx_flow_spec->m_u.tcp_ip4_spec.psrc

The code in ethtool was originally written to work with the n-tuple
ethtool operations (which no longer exist) in which the mask fields
specify bits to be ignored in the packet.  For NFC rule operations, the
semantics are the opposite: the mask fields specify bits to be matched
in the packet.  So ethtool inverts the mask fields as necessary.

> I could not understand how to interpret the mask output
> 
> For eg.
> [root@a163 linux-next]# ethtool -n enp9s0
> 8 RX rings available
> Total 2 rules
> 
> Filter: 0
>          Rule Type: TCP over IPv4
>          Src IP addr: 10.65.79.1 mask: 255.255.0.0
>          Dest IP addr: 10.106.186.163 mask: 255.255.255.255
>          TOS: 0x0 mask: 0x0
>          Src port: 51331 mask: 0xff
>          Dest port: 22 mask: 0xffff
>          Action: Direct to queue 4
> 
> 
> The mask for src port is 0x00ff. Does that mean 8 bits in lsb should match and
> the other 8 bits in msb should be ignored? Or is it the other way?

It means the 8 least significant bits are ignored.

Ben.

-- 
Ben Hutchings
Quantity is no substitute for quality, but it's the only one we've got.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

      reply	other threads:[~2014-07-07  1:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 16:13 query: ethtool --show-nfc mask interpretation Govindarajulu Varadarajan
2014-07-07  1:36 ` Ben Hutchings [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=1404697010.2902.85.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=_govind@gmx.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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