@@ -379,6 +379,7 @@ struct ethtool_modinfo {
* a TX interrupt, when the packet rate is above @pkt_rate_high.
* @rate_sample_interval: How often to do adaptive coalescing packet rate
* sampling, measured in seconds. Must not be zero.
+ * @queue: The specific queue which coalescing parameters apply to.
*
* Each pair of (usecs, max_frames) fields specifies that interrupts
* should be coalesced until
@@ -429,6 +430,7 @@ struct ethtool_coalesce {
__u32 tx_coalesce_usecs_high;
__u32 tx_max_coalesced_frames_high;
__u32 rate_sample_interval;
+ __s32 queue;
};
/**
@@ -1178,6 +1178,12 @@ static int dump_channels(const struct ethtool_channels *echannels)
static int dump_coalesce(const struct ethtool_coalesce *ecoal)
{
+ if (ecoal->queue < 0)
+ fprintf(stdout, "Queue: All\n");
+ else
+ fprintf(stdout, "Queue: %d\n",
+ ecoal->queue);
+
fprintf(stdout, "Adaptive RX: %s TX: %s\n",
ecoal->use_adaptive_rx_coalesce ? "on" : "off",
ecoal->use_adaptive_tx_coalesce ? "on" : "off");
@@ -1669,7 +1675,7 @@ static void do_generic_set1(struct cmdline_info *info, int *changed_out)
v1 = info->wanted_val;
wanted = *v1;
- if (wanted < 0)
+ if ((wanted < 0) || !strcmp("queue", info->name))
return;
v2 = info->ioctl_val;
@@ -1879,14 +1885,24 @@ static int do_gchannels(struct cmd_context *ctx)
static int do_gcoalesce(struct cmd_context *ctx)
{
struct ethtool_coalesce ecoal;
+ char **argp = ctx->argp;
int err;
- if (ctx->argc != 0)
+ if ((ctx->argc == 1) || (ctx->argc > 2))
+ exit_bad_args();
+
+ if ((ctx->argc == 2) && strcmp("queue", argp[0]))
exit_bad_args();
fprintf(stdout, "Coalesce parameters for %s:\n", ctx->devname);
ecoal.cmd = ETHTOOL_GCOALESCE;
+ if (ctx->argc == 0)
+ ecoal.queue = -1;
+ else
+ ecoal.queue = get_int_range(argp[1], 0,
+ -0x80000000LL,
+ 0x7fffffff);
err = send_ioctl(ctx, &ecoal);
if (err == 0) {
err = dump_coalesce(&ecoal);
@@ -1926,6 +1942,7 @@ static int do_scoalesce(struct cmd_context *ctx)
s32 coal_rx_frames_high_wanted = -1;
s32 coal_tx_usec_high_wanted = -1;
s32 coal_tx_frames_high_wanted = -1;
+ s32 coal_queue = -1;
struct cmdline_info cmdline_coalesce[] = {
{ "adaptive-rx", CMDL_BOOL, &coal_adaptive_rx_wanted,
&ecoal.use_adaptive_rx_coalesce },
@@ -1971,6 +1988,8 @@ static int do_scoalesce(struct cmd_context *ctx)
&ecoal.tx_coalesce_usecs_high },
{ "tx-frames-high", CMDL_S32, &coal_tx_frames_high_wanted,
&ecoal.tx_max_coalesced_frames_high },
+ { "queue", CMDL_S32, &coal_queue,
+ &ecoal.queue },
};
int err, changed = 0;
@@ -1978,6 +1997,8 @@ static int do_scoalesce(struct cmd_context *ctx)
cmdline_coalesce, ARRAY_SIZE(cmdline_coalesce));
ecoal.cmd = ETHTOOL_GCOALESCE;
+ if (coal_queue > 0)
+ ecoal.queue = coal_queue;
err = send_ioctl(ctx, &ecoal);
if (err) {
perror("Cannot get device coalesce settings");
@@ -4022,7 +4043,8 @@ static const struct option {
" [ autoneg on|off ]\n"
" [ rx on|off ]\n"
" [ tx on|off ]\n" },
- { "-c|--show-coalesce", 1, do_gcoalesce, "Show coalesce options" },
+ { "-c|--show-coalesce", 1, do_gcoalesce, "Show coalesce options",
+ " [queue N]\n" },
{ "-C|--coalesce", 1, do_scoalesce, "Set coalesce options",
" [adaptive-rx on|off]\n"
" [adaptive-tx on|off]\n"
@@ -4045,7 +4067,8 @@ static const struct option {
" [rx-frames-high N]\n"
" [tx-usecs-high N]\n"
" [tx-frames-high N]\n"
- " [sample-interval N]\n" },
+ " [sample-interval N]\n"
+ " [queue N]\n" },
{ "-g|--show-ring", 1, do_gring, "Query RX/TX ring parameters" },
{ "-G|--set-ring", 1, do_sring, "Set RX/TX ring parameters",
" [ rx N ]\n"