diff options
author | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2010-02-10 23:03:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-10 23:03:05 -0500 |
commit | 15682bc488d4af8c9bb998844a94281025e0a333 (patch) | |
tree | 2534589c00cbf695e6c2906f5c228a0006174904 /include/linux/ethtool.h | |
parent | 375c568844e49d292885c7485d4a255f71680e56 (diff) |
ethtool: Introduce n-tuple filter programming support
This patchset enables the ethtool layer to program n-tuple
filters to an underlying device. The idea is to allow capable
hardware to have static rules applied that can assist steering
flows into appropriate queues.
Hardware that is known to support these types of filters today
are ixgbe and niu.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ef4a2d84d922..a3cac53a0766 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #define _LINUX_ETHTOOL_H | 14 | #define _LINUX_ETHTOOL_H |
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/rculist.h> | ||
17 | 18 | ||
18 | /* This should work for both 32 and 64 bit userland. */ | 19 | /* This should work for both 32 and 64 bit userland. */ |
19 | struct ethtool_cmd { | 20 | struct ethtool_cmd { |
@@ -242,6 +243,7 @@ enum ethtool_stringset { | |||
242 | ETH_SS_TEST = 0, | 243 | ETH_SS_TEST = 0, |
243 | ETH_SS_STATS, | 244 | ETH_SS_STATS, |
244 | ETH_SS_PRIV_FLAGS, | 245 | ETH_SS_PRIV_FLAGS, |
246 | ETH_SS_NTUPLE_FILTERS, | ||
245 | }; | 247 | }; |
246 | 248 | ||
247 | /* for passing string sets for data tagging */ | 249 | /* for passing string sets for data tagging */ |
@@ -290,6 +292,7 @@ struct ethtool_perm_addr { | |||
290 | */ | 292 | */ |
291 | enum ethtool_flags { | 293 | enum ethtool_flags { |
292 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 294 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
295 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | ||
293 | }; | 296 | }; |
294 | 297 | ||
295 | /* The following structures are for supporting RX network flow | 298 | /* The following structures are for supporting RX network flow |
@@ -363,6 +366,35 @@ struct ethtool_rxnfc { | |||
363 | __u32 rule_locs[0]; | 366 | __u32 rule_locs[0]; |
364 | }; | 367 | }; |
365 | 368 | ||
369 | struct ethtool_rx_ntuple_flow_spec { | ||
370 | __u32 flow_type; | ||
371 | union { | ||
372 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
373 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
374 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
375 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
376 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
377 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
378 | struct ethtool_ether_spec ether_spec; | ||
379 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
380 | __u8 hdata[64]; | ||
381 | } h_u, m_u; /* entry, mask */ | ||
382 | |||
383 | __u16 vlan_tag; | ||
384 | __u16 vlan_tag_mask; | ||
385 | __u64 data; /* user-defined flow spec data */ | ||
386 | __u64 data_mask; /* user-defined flow spec mask */ | ||
387 | |||
388 | /* signed to distinguish between queue and actions (DROP) */ | ||
389 | __s32 action; | ||
390 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | ||
391 | }; | ||
392 | |||
393 | struct ethtool_rx_ntuple { | ||
394 | __u32 cmd; | ||
395 | struct ethtool_rx_ntuple_flow_spec fs; | ||
396 | }; | ||
397 | |||
366 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | 398 | #define ETHTOOL_FLASH_MAX_FILENAME 128 |
367 | enum ethtool_flash_op_type { | 399 | enum ethtool_flash_op_type { |
368 | ETHTOOL_FLASH_ALL_REGIONS = 0, | 400 | ETHTOOL_FLASH_ALL_REGIONS = 0, |
@@ -377,6 +409,18 @@ struct ethtool_flash { | |||
377 | 409 | ||
378 | #ifdef __KERNEL__ | 410 | #ifdef __KERNEL__ |
379 | 411 | ||
412 | struct ethtool_rx_ntuple_flow_spec_container { | ||
413 | struct ethtool_rx_ntuple_flow_spec fs; | ||
414 | struct list_head list; | ||
415 | }; | ||
416 | |||
417 | struct ethtool_rx_ntuple_list { | ||
418 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
419 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
420 | struct list_head list; | ||
421 | unsigned int count; | ||
422 | }; | ||
423 | |||
380 | struct net_device; | 424 | struct net_device; |
381 | 425 | ||
382 | /* Some generic methods drivers may use in their ethtool_ops */ | 426 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -394,6 +438,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev); | |||
394 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 438 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
395 | u32 ethtool_op_get_flags(struct net_device *dev); | 439 | u32 ethtool_op_get_flags(struct net_device *dev); |
396 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 440 | int ethtool_op_set_flags(struct net_device *dev, u32 data); |
441 | void ethtool_ntuple_flush(struct net_device *dev); | ||
397 | 442 | ||
398 | /** | 443 | /** |
399 | * ðtool_ops - Alter and report network device settings | 444 | * ðtool_ops - Alter and report network device settings |
@@ -500,6 +545,8 @@ struct ethtool_ops { | |||
500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 545 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 546 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
502 | int (*reset)(struct net_device *, u32 *); | 547 | int (*reset)(struct net_device *, u32 *); |
548 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | ||
549 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
503 | }; | 550 | }; |
504 | #endif /* __KERNEL__ */ | 551 | #endif /* __KERNEL__ */ |
505 | 552 | ||
@@ -559,6 +606,9 @@ struct ethtool_ops { | |||
559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 606 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 607 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
561 | 608 | ||
609 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | ||
610 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | ||
611 | |||
562 | /* compatibility with older code */ | 612 | /* compatibility with older code */ |
563 | #define SPARC_ETH_GSET ETHTOOL_GSET | 613 | #define SPARC_ETH_GSET ETHTOOL_GSET |
564 | #define SPARC_ETH_SSET ETHTOOL_SSET | 614 | #define SPARC_ETH_SSET ETHTOOL_SSET |