aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authoramit salecha <amit.salecha@qlogic.com>2011-04-06 21:58:42 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-13 14:31:04 -0400
commit8b5933c380fc66a6311739f9b36a812383f82141 (patch)
tree0552732a62a704756069e34cb945ee191a733332 /include/linux/ethtool.h
parent6139e75f4a413bdc8f366fc11e437347be8abc59 (diff)
net: ethtool support to configure number of channels
Ethtool support to configure RX, TX and other channels. combined field in struct ethtool_channels to reflect set of channel (RX, TX or other). Other channel can be link interrupts, SR-IOV coordination etc. ETHTOOL_GCHANNELS will report max and current number of RX channels, max and current number of TX channels, max and current number of other channel or max and current number of combined channel. Number of channel can be modify upto max number of channel through ETHTOOL_SCHANNELS command. Ben Hutchings: o define 'combined' and 'other' types. Most multiqueue drivers pair up RX and TX queues so that most channels combine RX and TX work. o Please could you use a kernel-doc comment to describe the structure. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 12cfbd0be2ee..ad22a68c2e5d 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -229,6 +229,34 @@ struct ethtool_ringparam {
229 __u32 tx_pending; 229 __u32 tx_pending;
230}; 230};
231 231
232/**
233 * struct ethtool_channels - configuring number of network channel
234 * @cmd: ETHTOOL_{G,S}CHANNELS
235 * @max_rx: Read only. Maximum number of receive channel the driver support.
236 * @max_tx: Read only. Maximum number of transmit channel the driver support.
237 * @max_other: Read only. Maximum number of other channel the driver support.
238 * @max_combined: Read only. Maximum number of combined channel the driver
239 * support. Set of queues RX, TX or other.
240 * @rx_count: Valid values are in the range 1 to the max_rx.
241 * @tx_count: Valid values are in the range 1 to the max_tx.
242 * @other_count: Valid values are in the range 1 to the max_other.
243 * @combined_count: Valid values are in the range 1 to the max_combined.
244 *
245 * This can be used to configure RX, TX and other channels.
246 */
247
248struct ethtool_channels {
249 __u32 cmd;
250 __u32 max_rx;
251 __u32 max_tx;
252 __u32 max_other;
253 __u32 max_combined;
254 __u32 rx_count;
255 __u32 tx_count;
256 __u32 other_count;
257 __u32 combined_count;
258};
259
232/* for configuring link flow control parameters */ 260/* for configuring link flow control parameters */
233struct ethtool_pauseparam { 261struct ethtool_pauseparam {
234 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ 262 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
@@ -818,6 +846,9 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
818 * Returns a negative error code or zero. 846 * Returns a negative error code or zero.
819 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. 847 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
820 * Returns a negative error code or zero. 848 * Returns a negative error code or zero.
849 * @get_channels: Get number of channels.
850 * @set_channels: Set number of channels. Returns a negative error code or
851 * zero.
821 * 852 *
822 * All operations are optional (i.e. the function pointer may be set 853 * All operations are optional (i.e. the function pointer may be set
823 * to %NULL) and callers must take this into account. Callers must 854 * to %NULL) and callers must take this into account. Callers must
@@ -891,6 +922,9 @@ struct ethtool_ops {
891 struct ethtool_rxfh_indir *); 922 struct ethtool_rxfh_indir *);
892 int (*set_rxfh_indir)(struct net_device *, 923 int (*set_rxfh_indir)(struct net_device *,
893 const struct ethtool_rxfh_indir *); 924 const struct ethtool_rxfh_indir *);
925 void (*get_channels)(struct net_device *, struct ethtool_channels *);
926 int (*set_channels)(struct net_device *, struct ethtool_channels *);
927
894}; 928};
895#endif /* __KERNEL__ */ 929#endif /* __KERNEL__ */
896 930
@@ -959,6 +993,8 @@ struct ethtool_ops {
959 993
960#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */ 994#define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */
961#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */ 995#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
996#define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
997#define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
962 998
963/* compatibility with older code */ 999/* compatibility with older code */
964#define SPARC_ETH_GSET ETHTOOL_GSET 1000#define SPARC_ETH_GSET ETHTOOL_GSET