diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2011-05-04 11:41:51 -0700 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-13 02:13:07 +0100 |
commit | 8d63f72ccdcb1b19358d753a8f48f08dcd2136f0 (patch) | |
tree | 0f832dc5abc322355eb045a07b321e918b187497 /ethtool-util.h | |
parent | 9a7baa6c15344dee34d5a9dd0308dc43fc29c488 (diff) | |
download | ethtool-8d63f72ccdcb1b19358d753a8f48f08dcd2136f0.tar.gz |
Add RX packet classification interface
This patch was originally introduced as:
[PATCH 1/3] [ethtool] Add rx pkt classification interface
Signed-off-by: Santwona Behera <santwona.behera@sun.com>
http://patchwork.ozlabs.org/patch/23223/
I removed the local caching of rules.
I dropped the use of regions as there were multiple issues found.
A network flow classifier is defined using the exact same syntax as
n-tuple, and the tool will correct for the fact that NFC uses the 1's
compliment of the n-tuple mask.
I also updated the ordering of new rules being added. All new rules will
take the highest numbered open rule when no location is specified.
I split out the addition of bitops and the updates to documentation
into separate patches. This makes the total patch size a bit more
manageable since the addition of NFC and the merging of it with
n-tuple were combined into this patch.
If we setup a rule and the device has the NTUPLE flag set we will
first try to use set_rx_ntuple. If that fails with EOPNOTSUPP we then
will attempt to use the network flow classifier rule insertion.
Updated the output to make use of the updated network flow classifier
extensions that have been accepted into the kernel.
Merged the documentation update into this patch. In addition the
documentation changes were made such that there is only one listing of the
individual options and they are all listed as optional.
Several fixes to address things such as the fact that we were
maintaining the table logic even though we only need it for displaying
all of the rules, or when adding a rule with no location specified.
As such all of the logic for deleting or finding rules in the table
has been removed.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
[bwh: Abbreviated the above commit message. Fixed a minor formatting
error in the manual page additions.]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'ethtool-util.h')
-rw-r--r-- | ethtool-util.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ethtool-util.h b/ethtool-util.h index d8b621c..79be7f2 100644 --- a/ethtool-util.h +++ b/ethtool-util.h @@ -65,6 +65,8 @@ static inline u64 cpu_to_be64(u64 value) #define SIOCETHTOOL 0x8946 #endif +#define RX_CLS_LOC_UNSPEC 0xffffffffUL + /* National Semiconductor DP83815, DP83816 */ int natsemi_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); int natsemi_dump_eeprom(struct ethtool_drvinfo *info, @@ -128,4 +130,14 @@ int sfc_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); int st_mac100_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); -#endif + +/* Rx flow classification */ +int rxclass_parse_ruleopts(char **optstr, int opt_cnt, + struct ethtool_rx_flow_spec *fsp); +int rxclass_rule_getall(int fd, struct ifreq *ifr); +int rxclass_rule_get(int fd, struct ifreq *ifr, __u32 loc); +int rxclass_rule_ins(int fd, struct ifreq *ifr, + struct ethtool_rx_flow_spec *fsp); +int rxclass_rule_del(int fd, struct ifreq *ifr, __u32 loc); + +#endif /* ETHTOOL_UTIL_H__ */ |