* [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
* Re: [PATCH] ethtool: change spi param on ip4 to l4data
2011-05-17 7:40 [PATCH] ethtool: change spi param on ip4 to l4data Sebastian Pöhn
@ 2011-06-01 21:59 ` Ben Hutchings
0 siblings, 0 replies; 2+ messages in thread
From: Ben Hutchings @ 2011-06-01 21:59 UTC (permalink / raw)
To: s.poehn; +Cc: netdev, sebastian.poehn, Alexander Duyck, Santwona Behera
On Tue, 2011-05-17 at 09:40 +0200, Sebastian Pöhn wrote:
> 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.
[...]
There are supposed to have multiple aliases for setting the l4_4_bytes
field, depending on the layer-4 protocol: 'spi', 'src-port', 'dst-port',
and potentially others. These could be used when the hardware doesn't
have specific support for the L4 protocol but can filter on the first 4
bytes of its header.
You could change the manual page to explain the assumptions behind these
options. You could also add this generic option (l4data, or possibly
options for each of the 4 bytes). But don't remove the existing ones.
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-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).