path: root/rxclass.c
AgeCommit message (Collapse)AuthorFilesLines
2013-01-22rxclass: Show full 64 bits of user-data in rxclass_print_nfc_spec_ext()Ben Hutchings1-1/+1
Previously only the lower 32 bits would be shown. Signed-off-by: Ben Hutchings <>
2013-01-22Added dst-mac parameter for L3/L4 flow spec rules. This is usefull in ↵Yan Burman1-19/+43
vSwitch configurations. Signed-off-by: Yan Burman <> Signed-off-by: Amir Vadai <> Signed-off-by: Ben Hutchings <>
2012-07-16ethtool: Resolve use of uninitialized memory in rxclass_get_dev_infoAlexander Duyck1-0/+1
The ethtool function for getting the rule count was not zeroing out the data field before passing it to the kernel. As a result the value started uninitialized and was incorrectly returning a result indicating that devices supported setting new rule indexes. In order to correct this I am adding a one line fix that sets data to zero before we pass the command to the kernel. Signed-off-by: Alexander Duyck <> Signed-off-by: Ben Hutchings <>
2012-01-12rxclass: Allow driver to select RX NFC rule locationBen Hutchings1-9/+20
If the user does not specify a location for an RX NFC rule to be added and the result of the ETHTOOL_GRXCLSRLCNT command indicates that the driver supports special rule locations, let the driver select the location. Signed-off-by: Ben Hutchings <>
2012-01-12rxclass: Use RX_CLS_LOC_{ANY,SPECIAL} in place of RX_CLS_LOC_UNSPECBen Hutchings1-7/+4
The macro RX_CLS_LOC_ANY is now defined in ethtool(-copy).h with the same intended semantics and same value as RX_CLS_LOC_UNSPEC. Change some equality tests to check for the flag RX_CLS_LOC_SPECIAL, to allow for future support of other special location value. Remove the special case for RX_CLS_LOC_UNSPEC in rxclass_print_nfc_rule(), since it is dead code. Signed-off-by: Ben Hutchings <>
2011-11-03Declare static variables const as appropriateBen Hutchings1-4/+4
Signed-off-by: Ben Hutchings <>
2011-11-03rxclass: Replace global rmgr with automatic variable/parameterBen Hutchings1-44/+34
Signed-off-by: Ben Hutchings <>
2011-11-03Move argument parsing to sub-command functionsBen Hutchings1-1/+3
Instead of doing most of the argument parsing in parse_cmdline(), find the sub-command and (if required) the device name in main() and do the rest in the sub-command handler function. Pass argc and argp around in struct cmd_context. This also tightens up argument parsing slightly: extraneous or missing arguments will now result in an error in a few cases where they were previously ignored. All test cases now pass. Replace sub-command dispatch in doit() with a function pointer in struct option. Signed-off-by: Ben Hutchings <>
2011-11-01Encapsulate command context in a structureBen Hutchings1-24/+18
Replace the fd and ifr arguments to each sub-command handler with struct cmd_context. Change send_ioctl() to take a pointer to this context and a pointer to the ethtool_cmd or other structure. Use send_ioctl() consistently. Signed-off-by: Ben Hutchings <>
2011-11-01Combine ethtool-{bitops,util}.h into internal.hBen Hutchings1-2/+1
ethtool-util.h contains all kinds of declarations, not just utility functions or macros. ethtool-bitops.h contains just a few extra definitions, and its only user also includes ethtool-util.h. Signed-off-by: Ben Hutchings <>
2011-07-14ethtool: RX NFC correctionsSebastian Pöhn1-3/+8
This patch: least as long there is no opportunity to use others than IPv4 and there is no frontend option to enter ip_ver. Signed-off-by: Sebastian Poehn <> Signed-off-by: Ben Hutchings <>
2011-05-13Add RX packet classification interfaceAlexander Duyck1-0/+1073
This patch was originally introduced as: [PATCH 1/3] [ethtool] Add rx pkt classification interface Signed-off-by: Santwona Behera <> 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 <> [bwh: Abbreviated the above commit message. Fixed a minor formatting error in the manual page additions.] Signed-off-by: Ben Hutchings <>