ethtool: Add support for setting multiple rx/tx queues
Subsystems (2)
PATCH 1/1 ethtool: Add support for setting multiple rx/tx queues
Signed-off-by Auke Kok <[email protected]>
---
ethtool-copy.h | 23 +++++++++++++ ethtool.8 | 23 +++++++++++++ ethtool.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 0 deletions(-)
ethtool-copy.h +23 -0
@@ -196,6 +196,23 @@ struct ethtool_ringparam {__u32 tx_pending; }; +/* for configuring RX/TX queue count */ +struct ethtool_queueparam { +__u32 cmd;/* ETHTOOL_{G,S}QUEUEPARAM */ + +/* Read only attributes. These indicate the maximum number +* of RX/TX queues the driver will allow the user to set. +*/ +__u32 rx_max; +__u32 tx_max; + +/* Values changeable by the user. The valid values are +* in the range 1 to the "*_max" counterpart above. +*/ +__u32 rx; +__u32 tx; +}; +/* for configuring link flow control parameters */ struct ethtool_pauseparam {__u32 cmd;/* ETHTOOL_{G,S}PAUSEPARAM */
@@ -295,6 +312,8 @@ int ethtool_op_set_lro(struct net_device *dev, u32 data);* set_coalesce: Set interrupt coalescing parameters * get_ringparam: Report ring sizes * set_ringparam: Set ring sizes +* get_queueparam: Report ring sizes +* set_queueparam: Set ring sizes * get_pauseparam: Report pause parameters * set_pauseparam: Set pause paramters * get_rx_csum: Report whether receive checksums are turned on or off
@@ -356,6 +375,8 @@ struct ethtool_ops {int (*set_coalesce)(struct net_device *,struct ethtool_coalesce *);void (*get_ringparam)(struct net_device *,struct ethtool_ringparam *);int (*set_ringparam)(struct net_device *,struct ethtool_ringparam *); +void (*get_queueparam)(struct net_device *,struct ethtool_queueparam *); +int (*set_queueparam)(struct net_device *,struct ethtool_queueparam *);void (*get_pauseparam)(struct net_device *,struct ethtool_pauseparam *);int (*set_pauseparam)(struct net_device *,struct ethtool_pauseparam *);u32 (*get_rx_csum)(struct net_device *);
@@ -422,6 +443,8 @@ struct ethtool_ops {#define ETHTOOL_SGSO 0x00000024/* Set GSO enable (ethtool_value) */ #define ETHTOOL_GLRO 0x00000025/* Get LRO enable (ethtool_value) */ #define ETHTOOL_SLRO 0x00000026/* Set LRO enable (ethtool_value) */ +#define ETHTOOL_GQUEUEPARAM 0x00000027/* Get queue parameters */ +#define ETHTOOL_SQUEUEPARAM 0x00000028/* Set queue parameters. */ /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET
ethtool.8 +23 -0
@@ -120,6 +120,17 @@ ethtool \- Display or change ethernet card settings .RB [ tx .IR N ] + +.B ethtool \-q|\-\-show\-queue +.I ethX + +.B ethtool \-Q|\-\-set\-queue +.I ethX +.RB [ rx +.IR N ] +.RB [ tx +.IR N ] + .B ethtool \-i|\-\-driver .I ethX
@@ -243,6 +254,18 @@ Changes the number of ring entries for the Rx Jumbo ring. .BI tx \ N Changes the number of ring entries for the Tx ring. .TP +.B \-q \-\-show\-queue +Queries the specified ethernet device for rx/tx queue parameter information. +.TP +.B \-Q \-\-set\-queue +Changes the rx/tx queue parameters of the specified ethernet device. +.TP +.BI rx \ N +Changes the number of Rx queues. +.TP +.BI tx \ N +Changes the number of Tx queues. +.TP .B \-i \-\-driver Queries the specified ethernet device for associated driver information. .TP
ethtool.c +103 -0
163 lines not on this page · raw message
ethtool.c static void parse_cmdline(int argc, char **argp) · line 522
Quoted 11 lines · Auke Kok
Signed-off-by Auke Kok <[email protected]>---
ethtool.c +4
-0@@ -496,6 +516,14 @@ static void parse_cmdline(int argc, char **argp) i = argc;break ; } +if (mode ==MODE_SQUEUE ) { + parse_generic_cmdline(argc, argp, i, + &gqueue_changed, + cmdline_ring,
Nick pointed out the obvious typo here... I'll wait for some (more) comments before reposting.
Auke