netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethtool: change spi param on ip4 to l4data
@ 2011-05-17  7:40 Sebastian Pöhn
  2011-06-01 21:59 ` Ben Hutchings
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Pöhn @ 2011-05-17  7:40 UTC (permalink / raw)
  To: netdev; +Cc: sebastian.poehn, bhutchings

It is confusing for users if ip4 has a spi field, which results in
l4_4_bytes filtering. Add a new option and remove spi from ip4.

Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com>

diff --git a/ethtool.8.in b/ethtool.8.in
index 42d923b..19ba190 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -284,6 +284,7 @@ ethtool \- query or control network driver and
hardware settings
 .RB [ dst\-ip \ \*(PA\ [ m \ \*(PA]]
 .BM tos
 .BM l4proto
+.BM l4data
 .BM src\-port
 .BM dst\-port
 .BM spi
@@ -683,6 +684,10 @@ match along with an optional mask.  Applies to all
IPv4 based flow-types.
 Includes the layer 4 protocol number and optional mask.  Valid only for
 flow-type ip4.
 .TP
+.BI l4data \ N \\fR\ [\\fPm \ N \\fR]\\fP
+Specify the first 4 byte of layer 4 protocol.  Valid only for
+flow-type ip4.
+.TP
 .BI src\-port \ N \\fR\ [\\fPm \ N \\fR]\\fP
 Specify the value of the source port field (applicable to TCP/UDP packets)
 in the incoming packet to match along with an optional mask.  Valid for
@@ -696,7 +701,7 @@ Valid for flow-types ip4, tcp4, udp4, and sctp4.
 .BI spi \ N \\fR\ [\\fPm \ N \\fR]\\fP
 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.
+mask.  Valid for flow-types ah4 and esp4.
 .TP
 .BI vlan\-etype \ N \\fR\ [\\fPm \ N \\fR]\\fP
 Includes the VLAN tag Ethertype and an optional mask.
diff --git a/ethtool.c b/ethtool.c
index 0b7ec05..fe12934 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -242,6 +242,7 @@ static struct option {
 		"			[ dst-ip %d.%d.%d.%d [m %d.%d.%d.%d] ]\n"
 		"			[ tos %d [m %x] ]\n"
 		"			[ l4proto %d [m %x] ]\n"
+		"			[ l4data %d [m %x] ]\n"
 		"			[ src-port %d [m %x] ]\n"
 		"			[ dst-port %d [m %x] ]\n"
 		"			[ spi %d [m %x] ]\n"
diff --git a/rxclass.c b/rxclass.c
index ee486f7..7507979 100644
--- a/rxclass.c
+++ b/rxclass.c
@@ -541,6 +541,7 @@ typedef enum {
 #define NTUPLE_FLAG_VLAN	0x100
 #define NTUPLE_FLAG_UDEF	0x200
 #define NTUPLE_FLAG_VETH	0x400
+#define NFC_FLAG_L4DATA	0x800

 struct rule_opts {
 	const char	*name;
@@ -622,7 +623,7 @@ 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) },
-	{ "spi", OPT_BE32, NFC_FLAG_SPI,
+	{ "l4data", OPT_BE32, NFC_FLAG_L4DATA,
 	  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) },
 	{ "src-port", OPT_BE16, NFC_FLAG_SPORT,

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

end of thread, other threads:[~2011-06-01 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17  7:40 [PATCH] ethtool: change spi param on ip4 to l4data Sebastian Pöhn
2011-06-01 21:59 ` 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).