aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVenkata Duvvuru <VenkatKumar.Duvvuru@Emulex.Com>2014-04-21 06:07:59 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-22 21:27:57 -0400
commit3de0b592394d17b2c41a261a6a493a521213f299 (patch)
tree34dbd689895d3c808fc25feb3c881a6f378236fe /include
parent862aa49164812e8da2d5b96323ed2b680f255e71 (diff)
ethtool: Support for configurable RSS hash key
This ethtool patch primarily copies the ioctl command data structures from/to the User space and invokes the driver hook. Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ethtool.h13
-rw-r--r--include/uapi/linux/ethtool.h32
2 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 0a114d05f68d..212f537fc686 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -154,13 +154,23 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
154 * @reset: Reset (part of) the device, as specified by a bitmask of 154 * @reset: Reset (part of) the device, as specified by a bitmask of
155 * flags from &enum ethtool_reset_flags. Returns a negative 155 * flags from &enum ethtool_reset_flags. Returns a negative
156 * error code or zero. 156 * error code or zero.
157 * @get_rxfh_key_size: Get the size of the RX flow hash key.
158 * Returns zero if not supported for this specific device.
157 * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table. 159 * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table.
158 * Returns zero if not supported for this specific device. 160 * Returns zero if not supported for this specific device.
159 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. 161 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
160 * Will not be called if @get_rxfh_indir_size returns zero. 162 * Will not be called if @get_rxfh_indir_size returns zero.
163 * @get_rxfh: Get the contents of the RX flow hash indirection table and hash
164 * key.
165 * Will not be called if @get_rxfh_indir_size and @get_rxfh_key_size
166 * returns zero.
161 * Returns a negative error code or zero. 167 * Returns a negative error code or zero.
162 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. 168 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
163 * Will not be called if @get_rxfh_indir_size returns zero. 169 * Will not be called if @get_rxfh_indir_size returns zero.
170 * @set_rxfh: Set the contents of the RX flow hash indirection table and
171 * hash key.
172 * Will not be called if @get_rxfh_indir_size and @get_rxfh_key_size
173 * returns zero.
164 * Returns a negative error code or zero. 174 * Returns a negative error code or zero.
165 * @get_channels: Get number of channels. 175 * @get_channels: Get number of channels.
166 * @set_channels: Set number of channels. Returns a negative error code or 176 * @set_channels: Set number of channels. Returns a negative error code or
@@ -232,7 +242,10 @@ struct ethtool_ops {
232 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 242 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
233 int (*flash_device)(struct net_device *, struct ethtool_flash *); 243 int (*flash_device)(struct net_device *, struct ethtool_flash *);
234 int (*reset)(struct net_device *, u32 *); 244 int (*reset)(struct net_device *, u32 *);
245 u32 (*get_rxfh_key_size)(struct net_device *);
235 u32 (*get_rxfh_indir_size)(struct net_device *); 246 u32 (*get_rxfh_indir_size)(struct net_device *);
247 int (*get_rxfh)(struct net_device *, u32 *, u8 *);
248 int (*set_rxfh)(struct net_device *, u32 *, u8 *);
236 int (*get_rxfh_indir)(struct net_device *, u32 *); 249 int (*get_rxfh_indir)(struct net_device *, u32 *);
237 int (*set_rxfh_indir)(struct net_device *, const u32 *); 250 int (*set_rxfh_indir)(struct net_device *, const u32 *);
238 void (*get_channels)(struct net_device *, struct ethtool_channels *); 251 void (*get_channels)(struct net_device *, struct ethtool_channels *);
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index fd161e91b6d7..d47d31d6fa0e 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -847,6 +847,35 @@ struct ethtool_rxfh_indir {
847}; 847};
848 848
849/** 849/**
850 * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
851 * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
852 * @rss_context: RSS context identifier.
853 * @indir_size: On entry, the array size of the user buffer, which may be zero.
854 * On return from %ETHTOOL_GRSSH, the array size of the hardware
855 * indirection table.
856 * @key_size: On entry, the array size of the user buffer in bytes,
857 * which may be zero.
858 * On return from %ETHTOOL_GRSSH, the size of the RSS hash key.
859 * @rsvd: Reserved for future extensions.
860 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
861 * of size @indir_size followed by hash key of size @key_size.
862 *
863 * For %ETHTOOL_GRSSH, a @indir_size and key_size of zero means that only the
864 * size should be returned. For %ETHTOOL_SRSSH, a @indir_size of 0xDEADBEEF
865 * means that indir table setting is not requested and a @indir_size of zero
866 * means the indir table should be reset to default values. This last feature
867 * is not supported by the original implementations.
868 */
869struct ethtool_rxfh {
870 __u32 cmd;
871 __u32 rss_context;
872 __u32 indir_size;
873 __u32 key_size;
874 __u32 rsvd[2];
875 __u32 rss_config[0];
876};
877
878/**
850 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter 879 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
851 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW 880 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
852 * @h_u: Flow field values to match (dependent on @flow_type) 881 * @h_u: Flow field values to match (dependent on @flow_type)
@@ -1118,6 +1147,9 @@ enum ethtool_sfeatures_retval_bits {
1118#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */ 1147#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
1119#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */ 1148#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
1120 1149
1150#define ETHTOOL_GRSSH 0x00000046 /* Get RX flow hash configuration */
1151#define ETHTOOL_SRSSH 0x00000047 /* Set RX flow hash configuration */
1152
1121/* compatibility with older code */ 1153/* compatibility with older code */
1122#define SPARC_ETH_GSET ETHTOOL_GSET 1154#define SPARC_ETH_GSET ETHTOOL_GSET
1123#define SPARC_ETH_SSET ETHTOOL_SSET 1155#define SPARC_ETH_SSET ETHTOOL_SSET