netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ethtool-next] rxclass: Make output for RSS context action explicit
@ 2024-11-08 19:32 Daniel Xu
  2024-11-08 19:35 ` Daniel Xu
  2024-11-08 19:56 ` Edward Cree
  0 siblings, 2 replies; 16+ messages in thread
From: Daniel Xu @ 2024-11-08 19:32 UTC (permalink / raw)
  To: davem, mkubecek; +Cc: kuba, martin.lau, netdev, kernel-team

Currently, if the action for an ntuple rule is to redirect to an RSS
context, the RSS context is printed as an attribute. At the same time,
a wrong action is printed. For example:

    # ethtool -X eth0 hfunc toeplitz context new start 24 equal 8
    New RSS context is 1

    # ethtool -N eth0 flow-type ip6 dst-ip $IP6 context 1
    Added rule with ID 0

    # ethtool -n eth0 rule 0
    Filter: 0
            Rule Type: Raw IPv6
            Src IP addr: :: mask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
            Dest IP addr: <redacted> mask: ::
            Traffic Class: 0x0 mask: 0xff
            Protocol: 0 mask: 0xff
            L4 bytes: 0x0 mask: 0xffffffff
            RSS Context ID: 1
            Action: Direct to queue 0

This is wrong and misleading. Fix by treating RSS context as a explicit
action. The new output looks like this:

    # ./ethtool -n eth0 rule 0
    Filter: 0
            Rule Type: Raw IPv6
            Src IP addr: :: mask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
            Dest IP addr: <redacted> mask: ::
            Traffic Class: 0x0 mask: 0xff
            Protocol: 0 mask: 0xff
            L4 bytes: 0x0 mask: 0xffffffff
            Action: Direct to RSS context id 1

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 rxclass.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/rxclass.c b/rxclass.c
index f17e3a5..80d6419 100644
--- a/rxclass.c
+++ b/rxclass.c
@@ -248,13 +248,12 @@ static void rxclass_print_nfc_rule(struct ethtool_rx_flow_spec *fsp,
 
 	rxclass_print_nfc_spec_ext(fsp);
 
-	if (fsp->flow_type & FLOW_RSS)
-		fprintf(stdout, "\tRSS Context ID: %u\n", rss_context);
-
 	if (fsp->ring_cookie == RX_CLS_FLOW_DISC) {
 		fprintf(stdout, "\tAction: Drop\n");
 	} else if (fsp->ring_cookie == RX_CLS_FLOW_WAKE) {
 		fprintf(stdout, "\tAction: Wake-on-LAN\n");
+	} else if (fsp->flow_type & FLOW_RSS)
+		fprintf(stdout, "\tRSS context id %u\n", rss_context);
 	} else {
 		u64 vf = ethtool_get_flow_spec_ring_vf(fsp->ring_cookie);
 		u64 queue = ethtool_get_flow_spec_ring(fsp->ring_cookie);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-11-14 23:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 19:32 [PATCH ethtool-next] rxclass: Make output for RSS context action explicit Daniel Xu
2024-11-08 19:35 ` Daniel Xu
2024-11-08 19:56 ` Edward Cree
2024-11-08 20:34   ` Joe Damato
2024-11-08 20:43     ` Joe Damato
2024-11-08 21:13     ` Edward Cree
2024-11-08 22:50       ` Daniel Xu
2024-11-09 17:42       ` Jakub Kicinski
2024-11-11 10:47         ` Edward Cree
2024-11-11 18:22           ` Jakub Kicinski
2024-11-12  9:24         ` Edward Cree
2024-11-12 15:24           ` Jakub Kicinski
2024-11-13  3:30             ` Edward Cree
2024-11-14  0:46               ` Jakub Kicinski
2024-11-14  0:46                 ` Jakub Kicinski
2024-11-14 23:04                 ` Edward Cree

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).