From b26637b69054a84ac7f7012680d22a25ad9a6b5c Mon Sep 17 00:00:00 2001 From: Peter Waskiewicz Date: Wed, 3 Feb 2010 23:51:01 -0800 Subject: Support n-tuple filter programming Program underlying ethernet devices with n-tuple flow classification filters. This also adds a new flag to ethtool_flags, allowing n-tuple programming to be toggled using the set_flags call. Signed-off-by: Peter P Waskiewicz Jr Signed-off-by: Jeff Kirsher Signed-off-by: Jeff Garzik --- ethtool-copy.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'ethtool-copy.h') diff --git a/ethtool-copy.h b/ethtool-copy.h index 09dd548..77b375d 100644 --- a/ethtool-copy.h +++ b/ethtool-copy.h @@ -242,6 +242,7 @@ enum ethtool_stringset { ETH_SS_TEST = 0, ETH_SS_STATS, ETH_SS_PRIV_FLAGS, + ETH_SS_NTUPLE_FILTERS, }; /* for passing string sets for data tagging */ @@ -290,6 +291,7 @@ struct ethtool_perm_addr { */ enum ethtool_flags { ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ + ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ }; /* The following structures are for supporting RX network flow @@ -375,6 +377,36 @@ struct ethtool_flash { char data[ETHTOOL_FLASH_MAX_FILENAME]; }; +struct ethtool_rx_ntuple_flow_spec { + int flow_type; + union { + struct ethtool_tcpip4_spec tcp_ip4_spec; + struct ethtool_tcpip4_spec udp_ip4_spec; + struct ethtool_tcpip4_spec sctp_ip4_spec; + struct ethtool_ah_espip4_spec ah_ip4_spec; + struct ethtool_ah_espip4_spec esp_ip4_spec; + struct ethtool_rawip4_spec raw_ip4_spec; + struct ethtool_ether_spec ether_spec; + struct ethtool_usrip4_spec usr_ip4_spec; + __u8 hdata[64]; + } h_u, m_u; /* entry, mask */ + + __u16 vlan_tag; + __u16 vlan_tag_mask; + __u64 data; /* user-defined flow spec data */ + __u64 data_mask; /* user-defined flow spec mask */ + + /* signed to distinguish between queue and actions (DROP) */ + int action; +#define ETHTOOL_RXNTUPLE_ACTION_DROP -1 +}; + +#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 +#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 +struct ethtool_rx_ntuple { + __u32 cmd; + struct ethtool_rx_ntuple_flow_spec fs; +}; /* CMDs currently supported */ #define ETHTOOL_GSET 0x00000001 /* Get settings. */ @@ -432,6 +464,9 @@ struct ethtool_flash { #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ +#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ +#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ + /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET #define SPARC_ETH_SSET ETHTOOL_SSET -- cgit v1.2.1