Netdev List
 help / color / mirror / Atom feed
From: "Vladislav Zolotarov" <vladz@broadcom.com>
To: "Ben Hutchings" <bhutchings@solarflare.com>
Cc: "Dimitris Michailidis" <dm@chelsio.com>,
	"Peter Waskiewicz" <peter.p.waskiewicz.jr@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David Miller" <davem@davemloft.net>
Subject: Re: (Lack of) specification for RX n-tuple filtering
Date: Wed, 8 Dec 2010 18:24:03 +0200	[thread overview]
Message-ID: <1291825443.31064.193.camel@lb-tlvb-vladz> (raw)
In-Reply-To: <1283870637.2270.10.camel@achroite.uk.solarflarecom.com>


> > It's a bit worse than that.  Currently one can only append filters, not
> > insert at a given position, as ethtool_rx_ntuple doesn't have an index
> > field.  For devices that use TCAMs, where position matters, it's quite an
> > obstacle.  It also means one cannot modify an existing filter by specifying
> > a new filter for the same index.
> 
> It looks like drivers for devices that use TCAMs should implement the
> RXNFC interface instead.
> 

Ben, from ethtool manpage it sounds like RXNFC option defines the way
the RSS hash should be calculated, while SRXNTUPLE is meant to control
the destination Rx queue for a stream specified by a filter/filters. The
semantics for a specification of the steam is also quite different. For
instance, how do u define a rule to drop all packets with source IP
address 192.168.10.200 by means of RXNFC? While with SRXNTUPLE it's
straight forward. So, if I understood the semantics of both interfaces
correctly, there is a very limited range of functionality where they may
replace one another. Pls., correct me if I'm wrong.

I also agree with Dimitris: what we have here is an offload of some
Netfilter functionality to HW. Regardless the HW implementation (TCAM or
not) if it's allowed to configure more than one rule for the same
protocol the ordering of filtering rules is important: for instance if u
change the order of applying the rules in the example below the result
of the filtering for the traffic with both VLAN 4 and destination port
3000 will be different.

ethtool -U ethX flow-type tcp4 vlan 4 action 0
ethtool -U ethX flow-type tcp4 dst-port 3000 action 3

By the way it's also unclear from the ethtool man page if it's allowed
to configure more than one rule for the same protocol. If it's not then
the above example is void... ;) However, if we want to define a proper
filtering interface I think we shouldn't restrict the driver
implementation from defining a set of rules for the same protocol,
allowing not to though.

So, I think that attaching an index to each rule could be a good idea -
this would allow us both inserting rules at the desired positions in the
filtering rule table and editing the existing rules.

It's also unclear what is the relation between RXNFC and SRXNTUPLE. The
last in general may override the decision made based on the hash result.
So, it sounds like applying rules of SRXNTUPLE should come before
applying the RSS logic and only if there was no match RSS should be
applied to that frame. Do I get it right?

Pls., comment.

thanks,
vlad



  reply	other threads:[~2010-12-08 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 21:02 (Lack of) specification for RX n-tuple filtering Ben Hutchings
2010-07-22 21:50 ` Dimitris Michailidis
2010-09-07 14:43   ` Ben Hutchings
2010-12-08 16:24     ` Vladislav Zolotarov [this message]
2010-12-08 16:39       ` David Miller
2010-12-08 17:29         ` Ben Hutchings
2010-12-08 17:31           ` David Miller
2010-12-09 10:31           ` Vladislav Zolotarov
2010-12-08 17:31         ` Vladislav Zolotarov
2010-12-08 17:22       ` Ben Hutchings
2010-12-08 18:39         ` Vladislav Zolotarov
2010-12-08 19:02           ` Ben Hutchings
2010-12-08 19:10             ` Vladislav Zolotarov
2010-12-08 19:14               ` Ben Hutchings
2010-12-08 19:39                 ` Ben Hutchings
2010-12-08 18:54         ` Dimitris Michailidis
2010-12-08 19:14           ` Ben Hutchings
2010-12-08 19:26             ` Dimitris Michailidis

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=1291825443.31064.193.camel@lb-tlvb-vladz \
    --to=vladz@broadcom.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=dm@chelsio.com \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.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