RX NFC cleanup
Subsystems (2)
cover RX NFC cleanup
I'm about to push these changes out, along with one fix received from Intel.
Ben.
Ben Hutchings (4):
Move '--flash' down the list of options
Merge RX NFC options
ethtool.8: Don't mention the 'clear rule' action for NFC rules ethtool.8: Improve description of RX NFC options
ethtool.8.in | 165 +++++++++++++++++++++++++--------------------------- ethtool.c | 178 ++++++++++++++++++++++++-------------------------------- test-cmdline.c | 52 +++++++++-------- 3 files changed, 182 insertions(+), 213 deletions(-)
Signature · 7 lines
1.7.7.6 -- 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.
PATCH 1/4 Move '--flash' down the list of options
It doesn't make sense to to list it between the two RX NFC options in the online help.
--- ethtool.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
ethtool.c +3 -3
@@ -3206,9 +3206,6 @@ static const struct option {"Show Rx network flow classification options" ," [ rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|" "tcp6|udp6|ah6|esp6|sctp6 ]\n" }, - { "-f|--flash", 1, do_flash, -"Flash firmware image from the specified file to a region on the device" , - " FILENAME [ REGION-NUMBER-TO-FLASH ]\n" }, { "-N|--config-nfc", 1, do_srxclass,"Configure Rx network flow classification options" ," [ rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|"
@@ -3218,6 +3215,9 @@ static const struct option { {"-X|--set-rxfh-indir" ,1 , do_srxfhindir,"Set Rx flow hash indirection" , " equal N | weight W0 W1 ...\n" }, + { "-f|--flash", 1, do_flash, +"Flash firmware image from the specified file to a region on the device" , + " FILENAME [ REGION-NUMBER-TO-FLASH ]\n" }, { "-U|--config-ntuple", 1, do_srxclsrule,"Configure Rx ntuple filters and actions" ," [ delete %d ] |\n"
Signature · 8 lines
1.7.7.6 -- 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.
PATCH 2/4 Merge RX NFC options
In reply to Ben HutchingsSantwona Behera originally intended to extend the -n and -N options to cover querying and setting rules as well as flow hash options. However, his patch fell between the cracks and the ethtool utility got n-tuple support first, using the -u and -U options. When RX NFC rule support was finally added I insisted that it should not require different command syntax, so rules must be accessed through these options.
The sets of valid argument lists following the -n and -u options are still non-overlapping, and similarly for the -N and -U options. Since the top level argument parser now supports arbitrary numbers of option aliases, we can merge these pairs together and achieve the original intent.
--- ethtool.8.in | 155 +++++++++++++++++++++++------------------------- ethtool.c | 178 ++++++++++++++++++++++++-------------------------------- test-cmdline.c | 52 +++++++++-------- 3 files changed, 177 insertions(+), 208 deletions(-)
ethtool.8.in +74 -81
@@ -250,13 +250,37 @@ ethtool \- query or control network driver and hardware settings .A1 on off .RB ...] .HP -.B ethtool \-n +.B ethtool \-n|\-u|\-\-show\-nfc|\-\-show\-ntuple .I devname -.BR rx\-flow\-hash \ \*(FL +.RB [\ rx\-flow\-hash \ \*(FL \ | +.br +.BI rule \ N +.RB ] .HP -.B ethtool \-N +.B ethtool \-N|\-U|\-\-config\-nfc|\-\-config\-ntuple .I devname -.BR rx\-flow\-hash \ \*(FL \: \*(HO +.BR rx\-flow\-hash \ \*(FL \: \*(HO \ | +.br +.B flow\-type \*(NC +.RB [ src \ \*(MA\ [ m \ \*(MA]] +.RB [ dst \ \*(MA\ [ m \ \*(MA]] +.BM proto +.RB [ src\-ip \ \*(PA\ [ m \ \*(PA]] +.RB [ dst\-ip \ \*(PA\ [ m \ \*(PA]] +.BM tos +.BM l4proto +.BM src\-port +.BM dst\-port +.BM spi +.BM l4data +.BM vlan\-etype +.BM vlan +.BM user\-def +.BN action +.BN loc +.RB | +.br +.BI delete \ N .HP .B ethtool \-w|\-\-get\-dump .I devname
@@ -283,31 +307,6 @@ ethtool \- query or control network driver and hardware settings .RI FILE .RI [ N ] .HP -.B ethtool \-u|\-\-show\-ntuple -.I devname -.BN rule -.HP -.BI ethtool\ \-U|\-\-config\-ntuple \ devname -.BN delete -.RB [\ flow\-type \ \*(NC -.RB [ src \ \*(MA\ [ m \ \*(MA]] -.RB [ dst \ \*(MA\ [ m \ \*(MA]] -.BM proto -.RB [ src\-ip \ \*(PA\ [ m \ \*(PA]] -.RB [ dst\-ip \ \*(PA\ [ m \ \*(PA]] -.BM tos -.BM l4proto -.BM src\-port -.BM dst\-port -.BM spi -.BM l4data -.BM vlan\-etype -.BM vlan -.BM user\-def -.BN action -.BN loc -.RB ] -.HP .B ethtool \-l|\-\-show\-channels .I devname .HP
@@ -590,7 +589,7 @@ The precise meanings of these type flags differ between drivers. .PD .RE .TP -.B \-n \-\-show\-nfc +.B \-n \-u \-\-show\-nfc \-\-show\-ntuple Retrieves the receive network flow classification configurations. .TP .BR rx\-flow\-hash \ \*(FL
@@ -610,7 +609,12 @@ esp6 IPSEC ESP over IPv6 sctp6 SCTP over IPv6 .TE .TP -.B \-N \-\-config\-nfc +.BI rule \ N +Retrieves the RX classification rule with the given ID. +.PD +.RE +.TP +.B \-N \-U \-\-config\-nfc \-\-config\-ntuple Configures the receive network flow classification. .TP .BR rx\-flow\-hash \ \*(FL \: \*(HO
@@ -631,56 +635,6 @@ other options are ignored. T} .TE .TP -.B \-w \-\-get\-dump -Retrieves and prints firmware dump for the specified network device. -By default, it prints out the dump flag, version and length of the dump data. -When -.I data -is indicated, then ethtool fetches the dump data and directs it to a -.I file. -.TP -.B \-W \-\-set\-dump -Sets the dump flag for the device. -.TP -.B \-x \-\-show\-rxfh\-indir -Retrieves the receive flow hash indirection table. -.TP -.B \-X \-\-set\-rxfh\-indir -Configures the receive flow hash indirection table. -.TP -.BI equal\ N -Sets the receive flow hash indirection table to spread flows evenly -between the first \fIN\fR receive queues. -.TP -\fBweight\fR \fIW0 W1\fR ... -Sets the receive flow hash indirection table to spread flows between -receive queues according to the given weights. The sum of the weights -must be non-zero and must not exceed the size of the indirection table. -.TP -.B \-f \-\-flash \ FILE -Flash firmware image from the specified file to a region on the adapter. -By default this will flash all the regions on the adapter. -.TP -.B N -A number to identify flash region where the image should be flashed. -Default region is 0 which denotes all regions in the flash. -.PD -.RE -.TP -.B \-u \-\-show\-ntuple -Get Rx ntuple filters and actions, then display them to the user. -.TP -.BI rule \ N -Retrieves the RX classification rule with the given ID. -.PD -.RE -.TP -.B \-U \-\-config\-ntuple -Configure Rx ntuple filters and actions -.TP -.BI delete \ N -Deletes the RX classification rule with the given ID. -.TP .B flow\-type \*(NC .TS nokeep;
@@ -773,6 +727,45 @@ Specify the location/ID to insert the rule. This will overwrite any rule present in that location and will not go through any of the rule ordering process. .TP +.BI delete \ N +Deletes the RX classification rule with the given ID. +.TP +.B \-w \-\-get\-dump +Retrieves and prints firmware dump for the specified network device. +By default, it prints out the dump flag, version and length of the dump data. +When +.I data +is indicated, then ethtool fetches the dump data and directs it to a +.I file. +.TP +.B \-W \-\-set\-dump +Sets the dump flag for the device. +.TP +.B \-x \-\-show\-rxfh\-indir +Retrieves the receive flow hash indirection table. +.TP +.B \-X \-\-set\-rxfh\-indir +Configures the receive flow hash indirection table. +.TP +.BI equal\ N +Sets the receive flow hash indirection table to spread flows evenly +between the first \fIN\fR receive queues. +.TP +\fBweight\fR \fIW0 W1\fR ... +Sets the receive flow hash indirection table to spread flows between +receive queues according to the given weights. The sum of the weights +must be non-zero and must not exceed the size of the indirection table. +.TP +.B \-f \-\-flash \ FILE +Flash firmware image from the specified file to a region on the adapter. +By default this will flash all the regions on the adapter. +.TP +.B N +A number to identify flash region where the image should be flashed. +Default region is 0 which denotes all regions in the flash. +.PD +.RE +.TP .B \-l \-\-show\-channels Queries the specified network device for the numbers of channels it has. A channel is an IRQ and the set of queues that can trigger that IRQ.
ethtool.c +76 -102
224 lines not on this page · raw message
test-cmdline.c +27 -25
78 lines not on this page · raw message
Signature · 8 lines
1.7.7.6 -- 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.
PATCH 3/4 ethtool.8: Don't mention the 'clear rule' action for NFC rules
In reply to Ben HutchingsThe sfc driver implemented a 'clear rule' action as a means to delete a rule through the n-tuple API. This action is not valid or useful in the RX NFC API and it's probably confusing to mention it at all.
--- ethtool.8.in | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
ethtool.8.in +0 -1
@@ -717,7 +717,6 @@ Specifies the Rx queue to send packets to, or some other action. .TS nokeep; lB l. --2 Clear the filter -1 Drop the matched flow 0 or higher Rx queue to route the flow .TE
Signature · 8 lines
1.7.7.6 -- 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.
PATCH 4/4 ethtool.8: Improve description of RX NFC options
In reply to Ben HutchingsState explicitly that arguments beginning with 'flow-type' will insert or update a rule.
Refer consistently to 'flow type' rather than 'network traffic type'.
Refer to 'options and rules', covering both flow hashing and steering/filtering.
--- ethtool.8.in | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
ethtool.8.in +5 -4
@@ -590,10 +590,10 @@ The precise meanings of these type flags differ between drivers. .RE .TP .B \-n \-u \-\-show\-nfc \-\-show\-ntuple -Retrieves the receive network flow classification configurations. +Retrieves receive network flow classification options or rules. .TP .BR rx\-flow\-hash \ \*(FL -Retrieves the hash options for the specified network traffic type. +Retrieves the hash options for the specified flow type. .TS nokeep; lB l.
@@ -615,10 +615,10 @@ Retrieves the RX classification rule with the given ID. .RE .TP .B \-N \-U \-\-config\-nfc \-\-config\-ntuple -Configures the receive network flow classification. +Configures receive network flow classification options or rules. .TP .BR rx\-flow\-hash \ \*(FL \: \*(HO -Configures the hash options for the specified network traffic type. +Configures the hash options for the specified flow type. .TS nokeep; lB l.
@@ -636,6 +636,7 @@ T} .TE .TP .B flow\-type \*(NC +Inserts or updates a classification rule for the specified flow type. .TS nokeep; lB l.
Signature · 7 lines
1.7.7.6 -- 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.