From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org, linville@tuxdriver.com
Cc: davem@davemloft.net, andrew@lunn.ch,
Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH ethtool v2 3/3] ethtool: Add support for action value -2 (wake-up filter)
Date: Thu, 9 Aug 2018 11:04:02 -0700 [thread overview]
Message-ID: <20180809180402.19430-4-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180809180402.19430-1-f.fainelli@gmail.com>
Add the ability to program special filters using ethtool::rxnfc which
are meant to be used for wake-up purposes (in conjuction with
WAKE_FILTER) using the special action value: -2 (RX_CLS_FLOW_WAKE).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
ethtool.8.in | 1 +
rxclass.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/ethtool.8.in b/ethtool.8.in
index 3eb9005ada48..97c7330fd373 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -871,6 +871,7 @@ Specifies the Rx queue to send packets to, or some other action.
nokeep;
lB l.
-1 Drop the matched flow
+-2 Use the matched flow as a Wake-on-LAN filter
0 or higher Rx queue to route the flow
.TE
.TP
diff --git a/rxclass.c b/rxclass.c
index 42d122d1ed86..79972651e706 100644
--- a/rxclass.c
+++ b/rxclass.c
@@ -251,7 +251,11 @@ static void rxclass_print_nfc_rule(struct ethtool_rx_flow_spec *fsp,
if (fsp->flow_type & FLOW_RSS)
fprintf(stdout, "\tRSS Context ID: %u\n", rss_context);
- if (fsp->ring_cookie != RX_CLS_FLOW_DISC) {
+ 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 {
u64 vf = ethtool_get_flow_spec_ring_vf(fsp->ring_cookie);
u64 queue = ethtool_get_flow_spec_ring(fsp->ring_cookie);
@@ -266,8 +270,6 @@ static void rxclass_print_nfc_rule(struct ethtool_rx_flow_spec *fsp,
else
fprintf(stdout, "\tAction: Direct to queue %llu\n",
queue);
- } else {
- fprintf(stdout, "\tAction: Drop\n");
}
fprintf(stdout, "\n");
--
2.17.1
next prev parent reply other threads:[~2018-08-09 20:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 18:03 [PATCH ethtool v2 0/3] ethtool: Wake-on-LAN using filters Florian Fainelli
2018-08-09 18:04 ` [PATCH ethtool v2 1/3] ethtool-copy.h: sync with net-next Florian Fainelli
2018-08-09 18:04 ` [PATCH ethtool v2 2/3] ethtool: Add support for WAKE_FILTER (WoL using filters) Florian Fainelli
2018-08-09 18:04 ` Florian Fainelli [this message]
2018-08-16 18:32 ` [PATCH ethtool v2 0/3] ethtool: Wake-on-LAN using filters John W. Linville
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180809180402.19430-4-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox