Quantcast

Adding Flow Director sysctls to ixgbe(4)

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Adding Flow Director sysctls to ixgbe(4)

syuu1228
Hi,

I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:

- Adding removing signature filter
On linux version of ixgbe driver, it has ability to set/remove perfect
filter from userland using ethtool command.
I implemented similar feature, but on sysctl, and not perfect filter
but signature filter(which means hash collision may occurs).

Following command adds a signature filter on ix0 for
10.0.0.2:47390/tcp -> 10.0.0.1:22/tcp, queueing Rx queue 10.
$ sysctl dev.ix.0.set_fdir_signature="tcpv4 10.0.0.2:47390 10.0.0.1:22 10"
Clearing a filter takes similar values but not includes queue number:
$ sysctl dev.ix.0.clear_fdir_signature="tcpv4 10.0.0.2:47390 10.0.0.1:22"

- Statistics of Flow Director
These sysctls poll fdir statistics register:
dev.ix.*.mac_stats.fdirfree_free
dev.ix.*.mac_stats.fdirfree_coll
dev.ix.*.mac_stats.fdirustat_add
dev.ix.*.mac_stats.fdirustat_remove
dev.ix.*.mac_stats.fdirfstat_fadd
dev.ix.*.mac_stats.fdirfstat_fremove
dev.ix.*.mac_stats.fdirmatch
dev.ix.*.mac_stats.fdirmiss

And I divided "#ifdef IXGBE_FDIR" to "#ifdef IXGBE_FDIR" and "#ifdef
IXGBE_FDIR_ATR".
If only IXGBE_FDIR is defined, only set_fdir_signature sysctl sets
signature filters.
If IXGBE_FDIR and IXGBE_FDIR_ATR are defined, ixgbe_atr also sets
signature filters automatically.
Which means even if you set a filter with specific queue number via
sysctl, ixgbe_atr will override the queue number.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"

ixgbe-head-signature.diff (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Ben Hutchings
On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> Hi,
>
> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
>
> - Adding removing signature filter
> On linux version of ixgbe driver, it has ability to set/remove perfect
> filter from userland using ethtool command.
> I implemented similar feature, but on sysctl, and not perfect filter
> but signature filter(which means hash collision may occurs).
[...]

Linux also has a generic interface to RX filtering and hashing
(ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
to support something like that?

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

syuu1228
Hi,

2011/9/5 Ben Hutchings <[hidden email]>:

> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
>> Hi,
>>
>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
>>
>> - Adding removing signature filter
>> On linux version of ixgbe driver, it has ability to set/remove perfect
>> filter from userland using ethtool command.
>> I implemented similar feature, but on sysctl, and not perfect filter
>> but signature filter(which means hash collision may occurs).
> [...]
>
> Linux also has a generic interface to RX filtering and hashing
> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> to support something like that?
>
> Ben.

Linux implement it on ethtool command, what should we do?
Maybe a new option for ifconfig, or provide new command for it?
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Vlad GALU-2
On Sep 8, 2011, at 10:11 AM, Takuya ASADA wrote:

> Hi,
>
> 2011/9/5 Ben Hutchings <[hidden email]>:
>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
>>> Hi,
>>>
>>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
>>>
>>> - Adding removing signature filter
>>> On linux version of ixgbe driver, it has ability to set/remove perfect
>>> filter from userland using ethtool command.
>>> I implemented similar feature, but on sysctl, and not perfect filter
>>> but signature filter(which means hash collision may occurs).
>> [...]
>>
>> Linux also has a generic interface to RX filtering and hashing
>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
>> to support something like that?
>>
>> Ben.
>
> Linux implement it on ethtool command, what should we do?
> Maybe a new option for ifconfig, or provide new command for it?

I for one would love to see this functionality built into ifconfig. Linux always seems to have one tool too many. There's ifconfig, iproute2, route, mii-tool and ethtool.


_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

John Baldwin
In reply to this post by Ben Hutchings
On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:

> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> > Hi,
> >
> > I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> >
> > - Adding removing signature filter
> > On linux version of ixgbe driver, it has ability to set/remove perfect
> > filter from userland using ethtool command.
> > I implemented similar feature, but on sysctl, and not perfect filter
> > but signature filter(which means hash collision may occurs).
> [...]
>
> Linux also has a generic interface to RX filtering and hashing
> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> to support something like that?

Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
both provide their own tools to manipulate filters, though they do not
provide explicit steering IIRC.

We would need to come up with some sort of standard interface (ioctls?) for
adding filters however.

--
John Baldwin
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Ben Hutchings
On Thu, 2011-09-08 at 08:34 -0400, John Baldwin wrote:

> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
> > On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> > > Hi,
> > >
> > > I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> > >
> > > - Adding removing signature filter
> > > On linux version of ixgbe driver, it has ability to set/remove perfect
> > > filter from userland using ethtool command.
> > > I implemented similar feature, but on sysctl, and not perfect filter
> > > but signature filter(which means hash collision may occurs).
> > [...]
> >
> > Linux also has a generic interface to RX filtering and hashing
> > (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> > to support something like that?
>
> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> both provide their own tools to manipulate filters, though they do not
> provide explicit steering IIRC.
>
> We would need to come up with some sort of standard interface (ioctls?) for
> adding filters however.

On Linux, filtering and steering are supported on the Freescale TSEC/FEC
(gianfar), Intel Niantic (ixgbe), Solarflare (sfc) and Sun Neptune (niu)
hardware.  The exact capabilities of the hardware are all quite
different and we're still recovering from the early mistake of defining
two subtly different interfaces.  I believe several other 10G Ethernet
vendors have implemented these sorts of hardware capabilities.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Ben Hutchings
In reply to this post by Vlad GALU-2
On Thu, 2011-09-08 at 10:55 +0200, Vlad Galu wrote:

> On Sep 8, 2011, at 10:11 AM, Takuya ASADA wrote:
> > Hi,
> >
> > 2011/9/5 Ben Hutchings <[hidden email]>:
> >> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> >>> Hi,
> >>>
> >>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> >>>
> >>> - Adding removing signature filter
> >>> On linux version of ixgbe driver, it has ability to set/remove perfect
> >>> filter from userland using ethtool command.
> >>> I implemented similar feature, but on sysctl, and not perfect filter
> >>> but signature filter(which means hash collision may occurs).
> >> [...]
> >>
> >> Linux also has a generic interface to RX filtering and hashing
> >> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> >> to support something like that?
> >>
> >> Ben.
> >
> > Linux implement it on ethtool command, what should we do?
> > Maybe a new option for ifconfig, or provide new command for it?
>
> I for one would love to see this functionality built into ifconfig.
> Linux always seems to have one tool too many. There's ifconfig,
> iproute2, route, mii-tool and ethtool.

The current tools are iproute2 (replacing ifconfig and route) and
ethtool.  mii-tool might still be useful for debugging a 10M or 100M
driver, but ethtool can display anything an administrator would be
interested in.

Now you could quite reasonably say that the improvements made in
iproute2 ought to have been done without creating a new command.  But it
is not true that all these different commands are required.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Vlad GALU-2
On Sep 8, 2011, at 4:35 PM, Ben Hutchings wrote:

> On Thu, 2011-09-08 at 10:55 +0200, Vlad Galu wrote:
>> On Sep 8, 2011, at 10:11 AM, Takuya ASADA wrote:
>>> Hi,
>>>
>>> 2011/9/5 Ben Hutchings <[hidden email]>:
>>>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
>>>> [...]
>>>>
>>>> Linux also has a generic interface to RX filtering and hashing
>>>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
>>>> to support something like that?
>>>>
>>>> Ben.
>>>
>>> Linux implement it on ethtool command, what should we do?
>>> Maybe a new option for ifconfig, or provide new command for it?
>>
>> I for one would love to see this functionality built into ifconfig.
>> Linux always seems to have one tool too many. There's ifconfig,
>> iproute2, route, mii-tool and ethtool.
>
> The current tools are iproute2 (replacing ifconfig and route) and
> ethtool.  mii-tool might still be useful for debugging a 10M or 100M
> driver, but ethtool can display anything an administrator would be
> interested in.
>
> Now you could quite reasonably say that the improvements made in
> iproute2 ought to have been done without creating a new command.  But it
> is not true that all these different commands are required.
>
> Ben.


You're right, I didn't mean that, only that, sometimes, diversity isn't necessarily a good thing.


_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

K. Macy
In reply to this post by John Baldwin
On Thu, Sep 8, 2011 at 2:34 PM, John Baldwin <[hidden email]> wrote:

> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
>> > Hi,
>> >
>> > I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
>> >
>> > - Adding removing signature filter
>> > On linux version of ixgbe driver, it has ability to set/remove perfect
>> > filter from userland using ethtool command.
>> > I implemented similar feature, but on sysctl, and not perfect filter
>> > but signature filter(which means hash collision may occurs).
>> [...]
>>
>> Linux also has a generic interface to RX filtering and hashing
>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
>> to support something like that?
>
> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> both provide their own tools to manipulate filters, though they do not
> provide explicit steering IIRC.
>
> We would need to come up with some sort of standard interface (ioctls?) for
> adding filters however.

I know this must sound like nitpicking, but please don't add more
ioctls if you can avoid it. If you want to add new interfaces try to
stick with sysctl as it tends to be less prone to breakage across
releases.


The biggest problem in defining a new API is the lack of anyone with a
global overview of the functionality provided by NIC vendors and their
near-term roadmaps. It doesn't make sense to add an API that we only
know works for one or two vendors.


Cheers
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

John Baldwin
On Thursday, September 08, 2011 10:48:25 am K. Macy wrote:

> On Thu, Sep 8, 2011 at 2:34 PM, John Baldwin <[hidden email]> wrote:
> > On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
> >> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> >> > Hi,
> >> >
> >> > I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> >> >
> >> > - Adding removing signature filter
> >> > On linux version of ixgbe driver, it has ability to set/remove perfect
> >> > filter from userland using ethtool command.
> >> > I implemented similar feature, but on sysctl, and not perfect filter
> >> > but signature filter(which means hash collision may occurs).
> >> [...]
> >>
> >> Linux also has a generic interface to RX filtering and hashing
> >> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> >> to support something like that?
> >
> > Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> > both provide their own tools to manipulate filters, though they do not
> > provide explicit steering IIRC.
> >
> > We would need to come up with some sort of standard interface (ioctls?) for
> > adding filters however.
>
> I know this must sound like nitpicking, but please don't add more
> ioctls if you can avoid it. If you want to add new interfaces try to
> stick with sysctl as it tends to be less prone to breakage across
> releases.

Passing strings in via sysctls isn't an ideal interface.  Passing in some sort
of structure via ioctl would be far more typical, and it is possible to provide
API compat since the size of the structure is encoded in the ioctl itself.

--
John Baldwin
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

George Neville-Neil
In reply to this post by K. Macy

On Sep 8, 2011, at 10:48 , K. Macy wrote:

> On Thu, Sep 8, 2011 at 2:34 PM, John Baldwin <[hidden email]> wrote:
>> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
>>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
>>>> Hi,
>>>>
>>>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
>>>>
>>>> - Adding removing signature filter
>>>> On linux version of ixgbe driver, it has ability to set/remove perfect
>>>> filter from userland using ethtool command.
>>>> I implemented similar feature, but on sysctl, and not perfect filter
>>>> but signature filter(which means hash collision may occurs).
>>> [...]
>>>
>>> Linux also has a generic interface to RX filtering and hashing
>>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
>>> to support something like that?
>>
>> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
>> both provide their own tools to manipulate filters, though they do not
>> provide explicit steering IIRC.
>>
>> We would need to come up with some sort of standard interface (ioctls?) for
>> adding filters however.
>
> I know this must sound like nitpicking, but please don't add more
> ioctls if you can avoid it. If you want to add new interfaces try to
> stick with sysctl as it tends to be less prone to breakage across
> releases.
>
>
> The biggest problem in defining a new API is the lack of anyone with a
> global overview of the functionality provided by NIC vendors and their
> near-term roadmaps. It doesn't make sense to add an API that we only
> know works for one or two vendors.
>

I think this is doable.  I've seen enough of these cards to know a bit
of what we'd want.  This is a subject we've covered in a few different
BSDCans but it's probably time for a straw man.  I'm not against the
sysctl approach but I'll have to give this a bit more thought.

The only real options are sockets, ioctls and sysctls, that I can see.

Best,
George

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Ben Hutchings
In reply to this post by John Baldwin
On Thu, 2011-09-08 at 11:06 -0400, John Baldwin wrote:

> On Thursday, September 08, 2011 10:48:25 am K. Macy wrote:
> > On Thu, Sep 8, 2011 at 2:34 PM, John Baldwin <[hidden email]> wrote:
> > > On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
> > >> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> > >> > Hi,
> > >> >
> > >> > I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> > >> >
> > >> > - Adding removing signature filter
> > >> > On linux version of ixgbe driver, it has ability to set/remove perfect
> > >> > filter from userland using ethtool command.
> > >> > I implemented similar feature, but on sysctl, and not perfect filter
> > >> > but signature filter(which means hash collision may occurs).
> > >> [...]
> > >>
> > >> Linux also has a generic interface to RX filtering and hashing
> > >> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> > >> to support something like that?
> > >
> > > Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> > > both provide their own tools to manipulate filters, though they do not
> > > provide explicit steering IIRC.
> > >
> > > We would need to come up with some sort of standard interface (ioctls?) for
> > > adding filters however.
> >
> > I know this must sound like nitpicking, but please don't add more
> > ioctls if you can avoid it. If you want to add new interfaces try to
> > stick with sysctl as it tends to be less prone to breakage across
> > releases.
>
> Passing strings in via sysctls isn't an ideal interface.  Passing in some sort
> of structure via ioctl would be far more typical, and it is possible to provide
> API compat since the size of the structure is encoded in the ioctl itself.

Whatever the mechanism is, the interface should allow for:

- Flexible matching on layer 2, 3 and 4 header fields
- Masking out some bits before matching (e.g. ignoring priority bits of
  VLAN tag or least significant bits of IPv4 address)
- Priority of rules in case several match a single flow.  This may
  need to be combined with location, since in a TCAM location may
  determine priority.
- Requesting packets to be dropped, steered to a single RX queue, or
  steered to a range of RX queues (using a flow hash and indirection
  table)
- Use of multiple hash indirection tables

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

K. Macy
> Whatever the mechanism is, the interface should allow for:
>
> - Flexible matching on layer 2, 3 and 4 header fields
> - Masking out some bits before matching (e.g. ignoring priority bits of
>  VLAN tag or least significant bits of IPv4 address)
> - Priority of rules in case several match a single flow.  This may
>  need to be combined with location, since in a TCAM location may
>  determine priority.
> - Requesting packets to be dropped, steered to a single RX queue, or
>  steered to a range of RX queues (using a flow hash and indirection
>  table)
> - Use of multiple hash indirection tables

Do you feel that the Linux API for this is the right place to start
looking?  Earlier you said: "The exact capabilities of the hardware
are all quite
different and we're still recovering from the early mistake of
defining two subtly different interfaces." Have the two APIs been
unified, if not which one do you believe is the "right" one?

Cheers
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Ben Hutchings
On Thu, 2011-09-08 at 18:28 +0200, K. Macy wrote:

> > Whatever the mechanism is, the interface should allow for:
> >
> > - Flexible matching on layer 2, 3 and 4 header fields
> > - Masking out some bits before matching (e.g. ignoring priority bits of
> >  VLAN tag or least significant bits of IPv4 address)
> > - Priority of rules in case several match a single flow.  This may
> >  need to be combined with location, since in a TCAM location may
> >  determine priority.
> > - Requesting packets to be dropped, steered to a single RX queue, or
> >  steered to a range of RX queues (using a flow hash and indirection
> >  table)
> > - Use of multiple hash indirection tables
>
> Do you feel that the Linux API for this is the right place to start
> looking?

You can certainly learn from the mistakes made in Linux. :-)

> Earlier you said: "The exact capabilities of the hardware
> are all quite
> different and we're still recovering from the early mistake of
> defining two subtly different interfaces." Have the two APIs been
> unified, if not which one do you believe is the "right" one?

RX NFC is the right one.  The other one (RX n-tuple) will be removed
once I've converted the sfc driver to use RX NFC.

It isn't flexible enough to cover the full matching capabilities and it
doesn't allow for requesting steering + hashing, although I'm hoping to
extend it to cover that later.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
np
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

np
In reply to this post by John Baldwin
On Thu, Sep 08, 2011 at 08:34:11AM -0400, John Baldwin wrote:

> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
> > On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> > > Hi,
> > >
> > > I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> > >
> > > - Adding removing signature filter
> > > On linux version of ixgbe driver, it has ability to set/remove perfect
> > > filter from userland using ethtool command.
> > > I implemented similar feature, but on sysctl, and not perfect filter
> > > but signature filter(which means hash collision may occurs).
> > [...]
> >
> > Linux also has a generic interface to RX filtering and hashing
> > (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> > to support something like that?
>
> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> both provide their own tools to manipulate filters, though they do not
> provide explicit steering IIRC.

Both of them can filter as well as steer (and the tools let you do that).
cxgbe(4) can do a lot more (rewrite + switch, replicate, etc.) but those
features are perhaps too specialized to be configurable via a general
purpose tool.

>
> We would need to come up with some sort of standard interface (ioctls?) for
> adding filters however.

+1 for a standard interface.

imho the kernel needs to be aware of the rx and tx queues of a NIC, and
not just for steering.  But that's a separate discussion.

Regards,
Navdeep
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

George Neville-Neil

On Sep 8, 2011, at 14:49 , Navdeep Parhar wrote:

> On Thu, Sep 08, 2011 at 08:34:11AM -0400, John Baldwin wrote:
>> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
>>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
>>>> Hi,
>>>>
>>>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
>>>>
>>>> - Adding removing signature filter
>>>> On linux version of ixgbe driver, it has ability to set/remove perfect
>>>> filter from userland using ethtool command.
>>>> I implemented similar feature, but on sysctl, and not perfect filter
>>>> but signature filter(which means hash collision may occurs).
>>> [...]
>>>
>>> Linux also has a generic interface to RX filtering and hashing
>>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
>>> to support something like that?
>>
>> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
>> both provide their own tools to manipulate filters, though they do not
>> provide explicit steering IIRC.
>
> Both of them can filter as well as steer (and the tools let you do that).
> cxgbe(4) can do a lot more (rewrite + switch, replicate, etc.) but those
> features are perhaps too specialized to be configurable via a general
> purpose tool.
>
>>
>> We would need to come up with some sort of standard interface (ioctls?) for
>> adding filters however.
>
> +1 for a standard interface.
>
> imho the kernel needs to be aware of the rx and tx queues of a NIC, and
> not just for steering.  But that's a separate discussion.
>

Well I do think this is actually all of a part.  Most of us realize by now that
high speed (e.g. 10G and higher) NICs only make sense if you can steer traffic and
pin queues to cores etc.  Without those pieces in place it's impossible to get
the full utilization out of the NIC because things like cache misses just kill
your performance.  Having looked at a few 10G NICs in the last couple of years the
one thing I notice is that everyone wants to do things like offload and steering
but that the specifics are quite different between different cards.  Some of that
has to do with the libraries that expose these things to the kernel and user programs,
but some has to do with how the device is modeled.  What this means is that we have
a failure of abstraction.  Abstraction has a cost, and some of the people who want
access to low level queues are not interested in paying an extra abstraction cost.

I think that some of the abstractions we need are tied up in the work that Takuya did
for SoC and some of it is in the work done by Luigi on netmap.  I'd go so far as to say
that what we should do is try to combine those two pieces of code into a set of
low level APIs for programs to interact with high speed NICs.  The one thing most
people do not talk about is extending our socket API to do two things that I think would
be a win for 80% of our users.  If a socket, and also a kqueue, could be pinned
to a CPU as well as a NIC queue that should improve overall bandwidth for a large
number of our users.  The API there is definitely an ioctl() and the hard part is
doing the tying together.  To do this we need to also work out our low level story.

Best,
George

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

Ben Hutchings
On Thu, 2011-09-08 at 20:13 -0400, George Neville-Neil wrote:

> On Sep 8, 2011, at 14:49 , Navdeep Parhar wrote:
>
> > On Thu, Sep 08, 2011 at 08:34:11AM -0400, John Baldwin wrote:
> >> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
> >>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> >>>> Hi,
> >>>>
> >>>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> >>>>
> >>>> - Adding removing signature filter
> >>>> On linux version of ixgbe driver, it has ability to set/remove perfect
> >>>> filter from userland using ethtool command.
> >>>> I implemented similar feature, but on sysctl, and not perfect filter
> >>>> but signature filter(which means hash collision may occurs).
> >>> [...]
> >>>
> >>> Linux also has a generic interface to RX filtering and hashing
> >>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> >>> to support something like that?
> >>
> >> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> >> both provide their own tools to manipulate filters, though they do not
> >> provide explicit steering IIRC.
> >
> > Both of them can filter as well as steer (and the tools let you do that).
> > cxgbe(4) can do a lot more (rewrite + switch, replicate, etc.) but those
> > features are perhaps too specialized to be configurable via a general
> > purpose tool.
> >
> >>
> >> We would need to come up with some sort of standard interface (ioctls?) for
> >> adding filters however.
> >
> > +1 for a standard interface.
> >
> > imho the kernel needs to be aware of the rx and tx queues of a NIC, and
> > not just for steering.  But that's a separate discussion.
> >
>
> Well I do think this is actually all of a part.  Most of us realize by now that
> high speed (e.g. 10G and higher) NICs only make sense if you can steer traffic and
> pin queues to cores etc.

Well, you can get way better than 1G performance without that.  And for
routers, flow hashing may be fine.  But for a host, of course, steering
packets properly can provide a major performance win.

[...]
> What this means is that we have
> a failure of abstraction.  Abstraction has a cost, and some of the people who want
> access to low level queues are not interested in paying an extra abstraction cost.

Abstraction has a cost, but it's not necessarily that high compared to
rewriting a whole chunk of sockets code (especially if you don't
actually have the source code).

> I think that some of the abstractions we need are tied up in the work that Takuya did
> for SoC and some of it is in the work done by Luigi on netmap.  I'd go so far as to say
> that what we should do is try to combine those two pieces of code into a set of
> low level APIs for programs to interact with high speed NICs.  The one thing most
> people do not talk about is extending our socket API to do two things that I think would
> be a win for 80% of our users.  If a socket, and also a kqueue, could be pinned
> to a CPU as well as a NIC queue that should improve overall bandwidth for a large
> number of our users.  The API there is definitely an ioctl() and the hard part is
> doing the tying together.  To do this we need to also work out our low level story.

But it would be a lot nicer if this could be done automatically.  Which
I believe it can - see the RFS and XPS features in Linux.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
np
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

np
On Fri, Sep 09, 2011 at 01:44:34AM +0100, Ben Hutchings wrote:

> On Thu, 2011-09-08 at 20:13 -0400, George Neville-Neil wrote:
> > On Sep 8, 2011, at 14:49 , Navdeep Parhar wrote:
> >
> > > On Thu, Sep 08, 2011 at 08:34:11AM -0400, John Baldwin wrote:
> > >> On Monday, September 05, 2011 7:21:12 am Ben Hutchings wrote:
> > >>> On Mon, 2011-09-05 at 15:51 +0900, Takuya ASADA wrote:
> > >>>> Hi,
> > >>>>
> > >>>> I implemented Ethernet Flow Director sysctls to ixgbe(4), here's a detail:
> > >>>>
> > >>>> - Adding removing signature filter
> > >>>> On linux version of ixgbe driver, it has ability to set/remove perfect
> > >>>> filter from userland using ethtool command.
> > >>>> I implemented similar feature, but on sysctl, and not perfect filter
> > >>>> but signature filter(which means hash collision may occurs).
> > >>> [...]
> > >>>
> > >>> Linux also has a generic interface to RX filtering and hashing
> > >>> (ethtool_rxnfc) which ixgbe supports; wouldn't it be better for FreeBSD
> > >>> to support something like that?
> > >>
> > >> Some sort of shared interface might be nice.  The cxgb(4) and cxgbe(4) drivers
> > >> both provide their own tools to manipulate filters, though they do not
> > >> provide explicit steering IIRC.
> > >
> > > Both of them can filter as well as steer (and the tools let you do that).
> > > cxgbe(4) can do a lot more (rewrite + switch, replicate, etc.) but those
> > > features are perhaps too specialized to be configurable via a general
> > > purpose tool.
> > >
> > >>
> > >> We would need to come up with some sort of standard interface (ioctls?) for
> > >> adding filters however.
> > >
> > > +1 for a standard interface.
> > >
> > > imho the kernel needs to be aware of the rx and tx queues of a NIC, and
> > > not just for steering.  But that's a separate discussion.
> > >
> >
> > Well I do think this is actually all of a part.  Most of us realize by now that
> > high speed (e.g. 10G and higher) NICs only make sense if you can steer traffic and
> > pin queues to cores etc.
>
> Well, you can get way better than 1G performance without that.  And for
> routers, flow hashing may be fine.  But for a host, of course, steering
> packets properly can provide a major performance win.
>
> [...]
> > What this means is that we have
> > a failure of abstraction.  Abstraction has a cost, and some of the people who want
> > access to low level queues are not interested in paying an extra abstraction cost.
>
> Abstraction has a cost, but it's not necessarily that high compared to
> rewriting a whole chunk of sockets code (especially if you don't
> actually have the source code).
>
> > I think that some of the abstractions we need are tied up in the work that Takuya did
> > for SoC and some of it is in the work done by Luigi on netmap.  I'd go so far as to say
> > that what we should do is try to combine those two pieces of code into a set of
> > low level APIs for programs to interact with high speed NICs.  The one thing most
> > people do not talk about is extending our socket API to do two things that I think would
> > be a win for 80% of our users.  If a socket, and also a kqueue, could be pinned
> > to a CPU as well as a NIC queue that should improve overall bandwidth for a large
> > number of our users.  The API there is definitely an ioctl() and the hard part is
> > doing the tying together.  To do this we need to also work out our low level story.
>
> But it would be a lot nicer if this could be done automatically.  Which
> I believe it can - see the RFS and XPS features in Linux.

rwatson@ has been working on "connection groups" (not sure what he calls
his project) with a goal to improve the placement of work in the FreeBSD
network stack.  Some of the code is in the kernel but the parts that
require closer cooperation with a NIC are not.

Regards,
Navdeep
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

syuu1228
In reply to this post by Ben Hutchings
On Sep 9, 2011, at 9:44 AM, Ben Hutchings <[hidden email]> wrote:

> But it would be a lot nicer if this could be done automatically.  Which
> I believe it can - see the RFS and XPS features in Linux.

Does it cooperate with hw queues and hw hashing now?
When I saw RFS code, it was just worked with RPS.
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Adding Flow Director sysctls to ixgbe(4)

K. Macy
In reply to this post by George Neville-Neil
> What this means is that we have
> a failure of abstraction.  Abstraction has a cost, and some of the people who want
> access to low level queues are not interested in paying an extra abstraction cost.

I think a case can be made that that isn't necessarily the case
depending on how well the abstraction is defined. As an example, I
don't believe that there is any performance penalty for the higher
level of abstraction in the BSD pmap API vs. representing the MD layer
as a multi-level page table.

>
> I think that some of the abstractions we need are tied up in the work that Takuya did
> for SoC and some of it is in the work done by Luigi on netmap.  I'd go so far as to say
> that what we should do is try to combine those two pieces of code into a set of
> low level APIs for programs to interact with high speed NICs.

I'm inclined to agree although I have fairly recently changed the
ifnet API for multi-queue I have received very little in the way of
useful responses to my inquiries with various individuals about the
interfaces exported by current cards. Based on my limited
understanding of netmap as it exists now,  I think that going forward
netmap should develop in to a general API for safely exporting of
queues to userspace, with the current limitations placed on it being
solely for cards that don't support the more advanced features. I am
only familiar with the documentation for Solarflare's quasi iommu and
have access to an implementation of exporting queues to userspace on
ixgbe cards. It appears that for a broader understanding of current
NIC feature sets I will have to resort to spelunking through the
network driver sources on kernel.org. This is probably reasonable when
it comes to directing flows as linux is converging on a single API,
but I am not aware of a similar general API for exporting queues.

> The one thing most
> people do not talk about is extending our socket API to do two things that I think would
> be a win for 80% of our users.  If a socket, and also a kqueue, could be pinned
> to a CPU as well as a NIC queue that should improve overall bandwidth for a large
> number of our users.  The API there is definitely an ioctl() and the hard part is
> doing the tying together.  To do this we need to also work out our low level story.

This is clearly a useful application, perhaps the most
straightforward, but I think there is a much broader set of possible
uses.


Cheers
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
12
Loading...