@@ -4886,6 +4886,7 @@ static int show_usage(struct cmd_context *ctx);
#define nl_geee NULL
#define nl_gfec NULL
#define nl_scoalesce NULL
+#define nl_sring NULL
#endif
static const struct option {
@@ -4944,7 +4945,7 @@ static const struct option {
" [sample-interval N]\n" },
{ "-g|--show-ring", 1, do_gring, nl_gring,
"Query RX/TX ring parameters" },
- { "-G|--set-ring", 1, do_sring, NULL,
+ { "-G|--set-ring", 1, do_sring, nl_sring,
"Set RX/TX ring parameters",
" [ rx N ]\n"
" [ rx-mini N ]\n"
@@ -25,6 +25,7 @@ int nl_gchannels(struct cmd_context *ctx);
int nl_geee(struct cmd_context *ctx);
int nl_gfec(struct cmd_context *ctx);
int nl_scoalesce(struct cmd_context *ctx);
+int nl_sring(struct cmd_context *ctx);
int nl_monitor(struct cmd_context *ctx);
void monitor_usage();
@@ -510,3 +510,37 @@ int nl_scoalesce(struct cmd_context *ctx)
return nl_set_param(ctx, "-C", scoalesce_params, ETHA_PARAMS_COALESCE,
ETHA_COALESCE_MAX);
}
+
+static const struct param_parser sring_params[] = {
+ {
+ .arg = "rx",
+ .type = ETHA_RING_RX_PENDING,
+ .handler = nl_parse_direct_u32,
+ .min_argc = 1,
+ },
+ {
+ .arg = "rx-mini",
+ .type = ETHA_RING_RX_MINI_PENDING,
+ .handler = nl_parse_direct_u32,
+ .min_argc = 1,
+ },
+ {
+ .arg = "rx-jumbo",
+ .type = ETHA_RING_RX_JUMBO_PENDING,
+ .handler = nl_parse_direct_u32,
+ .min_argc = 1,
+ },
+ {
+ .arg = "tx",
+ .type = ETHA_RING_TX_PENDING,
+ .handler = nl_parse_direct_u32,
+ .min_argc = 1,
+ },
+ {}
+};
+
+int nl_sring(struct cmd_context *ctx)
+{
+ return nl_set_param(ctx, "-G", sring_params, ETHA_PARAMS_RING,
+ ETHA_RING_MAX);
+}
Implement "ethtool -G <dev>" subcommand using netlink interface command ETHNL_CMD_SET_PARAMS. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> --- ethtool.c | 3 ++- netlink/extapi.h | 1 + netlink/params.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-)