From: Dimitris Michailidis <dm@chelsio.com>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [ethtool PATCH 4/4] v5 Add RX packet classification interface
Date: Tue, 03 May 2011 18:35:55 -0700 [thread overview]
Message-ID: <4DC0AD7B.7070009@chelsio.com> (raw)
In-Reply-To: <4DC09DE0.8070102@intel.com>
On 05/03/2011 05:29 PM, Alexander Duyck wrote:
> On 5/3/2011 4:34 PM, Ben Hutchings wrote:
>> On Tue, 2011-05-03 at 16:23 -0700, Dimitris Michailidis wrote:
>>> On 05/03/2011 09:12 AM, Alexander Duyck wrote:
>> [...]
>>>> +int rxclass_rule_ins(int fd, struct ifreq *ifr,
>>>> + struct ethtool_rx_flow_spec *fsp)
>>>> +{
>>>> + struct ethtool_rxnfc nfccmd;
>>>> + __u32 loc = fsp->location;
>>>> + int err;
>>>> +
>>>> + /*
>>>> + * if location is unspecified pull rules from device
>>>> + * and allocate a free rule for our use
>>>> + */
>>>> + if (loc == RX_CLS_LOC_UNSPEC) {
>>>> + /* init table of available rules */
>>>> + err = rmgr_init(fd, ifr);
>>>> + if (err< 0)
>>>> + return err;
>>>> +
>>>> + /* verify rule location */
>>>> + err = rmgr_add(fsp);
>>>> + if (err< 0)
>>>> + return err;
>>>> +
>>>> + /* cleanup table and free resources */
>>>> + rmgr_cleanup();
>>>> + }
>>>
>>> This logic where ethtool tries to select a filter slot when a user
>>> provides
>>> RX_CLS_LOC_UNSPEC does not work in general. It assumes that all
>>> slots are
>>> equal and a new filter can go into any available slot. But a device
>>> may have
>>> restrictions on where a filter may go that ethtool doesn't know.
>>
>> I agree. And if filter lookup is largely hash-based (as it is in
>> Solarflare hardware) the user will also find it very difficult to
>> specify the right location!
>
> The thing to keep in mind is that the index doesn't have to be a
> hardware index. In ixgbe we have a field in the hardware which is meant
> to just be a unique software index and that is what I am using as the
> location field for our filters. All the location information in the
> rules really provides is a logical way of tracking rules. It doesn't
> necessarily have to represent the physical location of the rule in
> hardware.
I appreciate the intent but there are couple problems.
a) ethtool.h documents location as
* @location: Index of filter in hardware table
i.e., physical location. But we could change that.
b) for TCAMs physical location is important and if ethtool offers to provide
only a logical index and massages the original user input to do so where
will a driver get the physical location it ultimately needs? For a device
with physical indices a multiple of 4 the logical index ethtool picks will
very frequently be illegal as physical location. E.g., if location 1 is
available ethtool will keep selecting it and the driver will need to deal
with these requests without the benefit of knowing what the user really
asked for.
Another problem with ethtool selecting locations is it assumes it's the sole
allocator (I think there's a comment in the code pointing this out). But
this isn't a valid assumption, e.g., HW RFS comes to mind as another allocator.
next prev parent reply other threads:[~2011-05-04 1:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 16:12 [ethtool PATCH 0/4] Add support for network flow classifier Alexander Duyck
2011-05-03 16:12 ` [ethtool PATCH 1/4] ethtool: remove strings based approach for displaying n-tuple Alexander Duyck
2011-05-03 16:12 ` [ethtool PATCH 2/4] Cleanup defines and header includes to address several issues Alexander Duyck
2011-05-03 16:12 ` [ethtool PATCH 3/4] Add support for __be64 and bitops, centralize several needed macros Alexander Duyck
2011-05-03 16:12 ` [ethtool PATCH 4/4] v5 Add RX packet classification interface Alexander Duyck
2011-05-03 23:23 ` Dimitris Michailidis
2011-05-03 23:34 ` Ben Hutchings
2011-05-04 0:29 ` Alexander Duyck
2011-05-04 1:35 ` Dimitris Michailidis [this message]
2011-05-04 3:10 ` Alexander Duyck
2011-05-04 17:09 ` Dimitris Michailidis
2011-05-04 17:24 ` Ben Hutchings
2011-05-04 17:33 ` Dimitris Michailidis
2011-05-04 17:41 ` Alexander Duyck
2011-05-04 18:05 ` Ben Hutchings
2011-05-04 18:21 ` Alexander Duyck
2011-05-04 18:45 ` Ben Hutchings
2011-05-04 21:07 ` Alexander Duyck
2011-05-04 21:54 ` Ben Hutchings
2011-05-04 19:06 ` Dimitris Michailidis
2011-05-04 18:18 ` Dimitris Michailidis
2011-05-04 18:35 ` Alexander Duyck
2011-05-04 18:50 ` 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=4DC0AD7B.7070009@chelsio.com \
--to=dm@chelsio.com \
--cc=alexander.h.duyck@intel.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--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 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.