Merge branch 'next' into master
diff --git a/NEWS b/NEWS
index 23e6e3c..4fb5713 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+Version 6.11 - October 8, 2024
+ * Feature: cmis: print active and inactive firmware versions
+ * Feature: flash transceiver module firmware (--flash-module-firmware)
+ * Feature: add T1BRR 10Mb/s mode to link mode tables
+ * Feature: support for disabling netlink from command line
+ * Fix: fix lanes parameter format specifier
+ * Fix: add missing clause 33 PSE manual description
+ * Fix: qsf: Better handling of Page A2h netlink read failure
+ * Fix: rss: retrieve ring count using ETHTOOL_GRXRINGS ioctl (-x)
+ * Misc: man page formatting fix
+
Version 6.10 - August 9, 2024
* Feature: suport for PoE in PSE (--show-pse and --set-pse)
* Feature: add statistics support to tsinfo (-T)
diff --git a/configure.ac b/configure.ac
index f6fe260..f9f169e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(ethtool, 6.10, netdev@vger.kernel.org)
+AC_INIT(ethtool, 6.11, netdev@vger.kernel.org)
AC_PREREQ(2.52)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([ethtool.c])
diff --git a/ethtool.8.in b/ethtool.8.in
index 151e520..ce7a673 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -117,7 +117,7 @@
. hy \\n(HY
..
.
-.TH ETHTOOL 8 "August 2024" "Ethtool version @VERSION@"
+.TH ETHTOOL 8 "October 2024" "Ethtool version @VERSION@"
.SH NAME
ethtool \- query or control network driver and hardware settings
.
diff --git a/ethtool.c b/ethtool.c
index 2813098..818f95c 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -6494,7 +6494,7 @@
return 0;
}
-static int ioctl_init(struct cmd_context *ctx, bool no_dev)
+int ioctl_init(struct cmd_context *ctx, bool no_dev)
{
if (no_dev) {
ctx->fd = -1;
diff --git a/internal.h b/internal.h
index 8b7dbd7..f33539d 100644
--- a/internal.h
+++ b/internal.h
@@ -282,6 +282,7 @@
#endif
#endif
+int ioctl_init(struct cmd_context *ctx, bool no_dev);
int send_ioctl(struct cmd_context *ctx, void *cmd);
void dump_hex(FILE *f, const u8 *data, int len, int offset);
diff --git a/netlink/rss.c b/netlink/rss.c
index dc28698..0ee8a0d 100644
--- a/netlink/rss.c
+++ b/netlink/rss.c
@@ -61,29 +61,29 @@
close_json_object();
}
-int get_channels_cb(const struct nlmsghdr *nlhdr, void *data)
+/* There is no netlink equivalent for ETHTOOL_GRXRINGS. */
+static int get_num_rings(struct cb_args *args)
{
- const struct nlattr *tb[ETHTOOL_A_CHANNELS_MAX + 1] = {};
- DECLARE_ATTR_TB_INFO(tb);
- struct cb_args *args = data;
struct nl_context *nlctx = args->nlctx;
- bool silent;
- int err_ret;
+ struct cmd_context *ctx = nlctx->ctx;
+ struct ethtool_rxnfc ring_count = {
+ .cmd = ETHTOOL_GRXRINGS,
+ };
int ret;
- silent = nlctx->is_dump || nlctx->is_monitor;
- err_ret = silent ? MNL_CB_OK : MNL_CB_ERROR;
- ret = mnl_attr_parse(nlhdr, GENL_HDRLEN, attr_cb, &tb_info);
- if (ret < 0)
- return err_ret;
- nlctx->devname = get_dev_name(tb[ETHTOOL_A_CHANNELS_HEADER]);
- if (!dev_ok(nlctx))
- return err_ret;
- if (tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT])
- args->num_rings = mnl_attr_get_u32(tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT]);
- if (tb[ETHTOOL_A_CHANNELS_RX_COUNT])
- args->num_rings += mnl_attr_get_u32(tb[ETHTOOL_A_CHANNELS_RX_COUNT]);
- return MNL_CB_OK;
+ ret = ioctl_init(ctx, false);
+ if (ret)
+ return ret;
+
+ ret = send_ioctl(ctx, &ring_count);
+ if (ret) {
+ perror("Cannot get RX ring count");
+ return ret;
+ }
+
+ args->num_rings = (u32)ring_count.data;
+
+ return 0;
}
int rss_reply_cb(const struct nlmsghdr *nlhdr, void *data)
@@ -142,22 +142,7 @@
if (ret < 0)
return silent ? MNL_CB_OK : MNL_CB_ERROR;
- nlctx->devname = get_dev_name(tb[ETHTOOL_A_RSS_HEADER]);
- if (!dev_ok(nlctx))
- return MNL_CB_OK;
-
- /* Fetch ring count info into args->num_rings */
- ret = nlsock_prep_get_request(nlctx->ethnl2_socket,
- ETHTOOL_MSG_CHANNELS_GET,
- ETHTOOL_A_CHANNELS_HEADER, 0);
- if (ret < 0)
- return MNL_CB_ERROR;
-
- ret = nlsock_sendmsg(nlctx->ethnl2_socket, NULL);
- if (ret < 0)
- return MNL_CB_ERROR;
-
- ret = nlsock_process_reply(nlctx->ethnl2_socket, get_channels_cb, args);
+ ret = get_num_rings(args);
if (ret < 0)
return MNL_CB_ERROR;