* [PATCH] ethtool : NFC corrections again
@ 2011-06-30 8:41 Sebastian Pöhn
2011-07-14 1:01 ` Ben Hutchings
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Pöhn @ 2011-06-30 8:41 UTC (permalink / raw)
To: Ben Hutchings, Linux Netdev; +Cc: Sebastian Pöhn
This patch:
# Adds an alias for ip4 called l4data pointing to spi (first 4 Layer 4
bytes)
# [TRIVIAL] Corrects the permutation of dst and src for ethernet
# Suggests to always set the ip_ver field of usr_ip to ETH_RX_NFC_IP4 at
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 <sebastian.poehn@belden.com>
---
ethtool.8.in | 5 +++++
rxclass.c | 11 ++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ethtool.8.in b/ethtool.8.in
index 7b1cdf5..0a64d75 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -296,6 +296,7 @@ ethtool \- query or control network driver and
hardware settings
.BM src\-port
.BM dst\-port
.BM spi
+.BM l4data
.BM vlan\-etype
.BM vlan
.BM user\-def
@@ -718,6 +719,10 @@ Specify the value of the security parameter index
field (applicable to
AH/ESP packets)in the incoming packet to match along with an optional
mask. Valid for flow-types ip4, ah4, and esp4.
.TP
+.BI l4data \ N \\fR\ [\\fPm \ N \\fR]\\fP
+Specify the value of the first 4 Bytes of Layer 4 in the incoming
packet to
+match along with an optional mask. Valid for ip4 flow-type.
+.TP
.BI vlan\-etype \ N \\fR\ [\\fPm \ N \\fR]\\fP
Includes the VLAN tag Ethertype and an optional mask.
.TP
diff --git a/rxclass.c b/rxclass.c
index ee486f7..b227901 100644
--- a/rxclass.c
+++ b/rxclass.c
@@ -622,6 +622,9 @@ static struct rule_opts rule_nfc_usr_ip4[] = {
{ "l4proto", OPT_U8, NFC_FLAG_PROTO,
offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip4_spec.proto),
offsetof(struct ethtool_rx_flow_spec, m_u.usr_ip4_spec.proto) },
+ { "l4data", OPT_BE32, NFC_FLAG_SPI,
+ offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip4_spec.l4_4_bytes),
+ offsetof(struct ethtool_rx_flow_spec,
m_u.usr_ip4_spec.l4_4_bytes) },
{ "spi", OPT_BE32, NFC_FLAG_SPI,
offsetof(struct ethtool_rx_flow_spec, h_u.usr_ip4_spec.l4_4_bytes),
offsetof(struct ethtool_rx_flow_spec,
m_u.usr_ip4_spec.l4_4_bytes) },
@@ -648,11 +651,11 @@ static struct rule_opts rule_nfc_usr_ip4[] = {
static struct rule_opts rule_nfc_ether[] = {
{ "src", OPT_MAC, NFC_FLAG_SADDR,
- offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_dest),
- offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_dest) },
- { "dst", OPT_MAC, NFC_FLAG_DADDR,
offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_source),
offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_source) },
+ { "dst", OPT_MAC, NFC_FLAG_DADDR,
+ offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_dest),
+ offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_dest) },
{ "proto", OPT_BE16, NFC_FLAG_PROTO,
offsetof(struct ethtool_rx_flow_spec, h_u.ether_spec.h_proto),
offsetof(struct ethtool_rx_flow_spec, m_u.ether_spec.h_proto) },
@@ -1062,6 +1065,8 @@ int rxclass_parse_ruleopts(char **argp, int argc,
}
}
+ if (flow_type == IP_USER_FLOW)
+ fsp->h_u.usr_ip4_spec.ip_ver = ETH_RX_NFC_IP4;
if (flags & (NTUPLE_FLAG_VLAN | NTUPLE_FLAG_UDEF | NTUPLE_FLAG_VETH))
fsp->flow_type |= FLOW_EXT;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ethtool : NFC corrections again
2011-06-30 8:41 [PATCH] ethtool : NFC corrections again Sebastian Pöhn
@ 2011-07-14 1:01 ` Ben Hutchings
0 siblings, 0 replies; 2+ messages in thread
From: Ben Hutchings @ 2011-07-14 1:01 UTC (permalink / raw)
To: Sebastian Pöhn; +Cc: Linux Netdev, Sebastian Pöhn
On Thu, 2011-06-30 at 10:41 +0200, Sebastian Pöhn wrote:
> This patch:
> # Adds an alias for ip4 called l4data pointing to spi (first 4 Layer 4
> bytes)
> # [TRIVIAL] Corrects the permutation of dst and src for ethernet
> # Suggests to always set the ip_ver field of usr_ip to ETH_RX_NFC_IP4 at
> least as long there is no opportunity to use others than IPv4 and there
> is no frontend option to enter ip_ver.
[...]
Applied. Sorry for the delay.
Ben.
--
Ben Hutchings, Senior Software 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-14 1:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-30 8:41 [PATCH] ethtool : NFC corrections again Sebastian Pöhn
2011-07-14 1:01 ` Ben Hutchings
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).