Adding Flow Director sysctls to ixgbe(4)

Takuya ASADA syuu at dokukino.com
Mon Sep 5 07:21:04 UTC 2011


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ixgbe-head-signature.diff
Type: text/x-patch
Size: 12063 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20110905/3c0b331d/ixgbe-head-signature.bin


More information about the freebsd-net mailing list