Skip to content

Commit

Permalink
kernel: final pre-v6 touches
Browse files Browse the repository at this point in the history
- add Acked-by/Reviewed-by from v5 review
- unsplit some GENL_SET_ERR_MSG() lines
  • Loading branch information
mkubecek committed Jul 2, 2019
1 parent 915c337 commit 9c57aa8
Show file tree
Hide file tree
Showing 42 changed files with 138 additions and 141 deletions.
4 changes: 3 additions & 1 deletion kernel/0003-ethtool-move-to-its-own-directory.patch
@@ -1,4 +1,4 @@
From 992ed15ad4841220ef492ef20fc015080852d88f Mon Sep 17 00:00:00 2001
From ce3a28d37e0e617140e118489d48696fab739bf8 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sun, 13 May 2018 02:35:53 +0200
Subject: [PATCH 03/44] ethtool: move to its own directory
Expand All @@ -9,6 +9,8 @@ net/ethtool. Start by moving current ethtool.c with ioctl interface into
this directory and renaming it to ioctl.c.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/Makefile | 2 +-
net/core/Makefile | 2 +-
Expand Down
@@ -1,4 +1,4 @@
From 2bde9f2256724cd172b46bc3497f62e4651dd7b0 Mon Sep 17 00:00:00 2001
From e7fa3ad7e9cf4d7a8f9a2085e3166f7260845b0a Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 10 Nov 2017 15:12:24 +0100
Subject: [PATCH 04/44] ethtool: introduce ethtool netlink interface
Expand Down
@@ -1,4 +1,4 @@
From 39cf3bdbc5caaa8845d507d18b8728cf050c6c3c Mon Sep 17 00:00:00 2001
From 44957b13e8edbced71aca893908d184eb9e57341 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 10 Nov 2017 15:34:56 +0100
Subject: [PATCH 05/44] ethtool: helper functions for netlink interface
Expand Down
2 changes: 1 addition & 1 deletion kernel/0006-ethtool-netlink-bitset-handling.patch
@@ -1,4 +1,4 @@
From 50559d5137032278bceaa7667102235d11e3c6de Mon Sep 17 00:00:00 2001
From 5f73b0634ffdecc77da2151564628fd133937d66 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 13 Nov 2017 12:58:03 +0100
Subject: [PATCH 06/44] ethtool: netlink bitset handling
Expand Down
@@ -1,4 +1,4 @@
From 3fb36d763a478f1b4fea31bdc7879b25151b4674 Mon Sep 17 00:00:00 2001
From 5b829a7a7b4b0957fed2b70e05526bb08236c758 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Wed, 11 Jul 2018 14:19:52 -0400
Subject: [PATCH 07/44] ethtool: support for netlink notifications
Expand Down
@@ -1,4 +1,4 @@
From 19ffefe7f0d442cf67080bb34c7d0908f16a5b54 Mon Sep 17 00:00:00 2001
From 84acc3f1365cb7efee92a458539c7b313d911f5d Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 15 Feb 2019 11:50:56 +0100
Subject: [PATCH 08/44] ethtool: move string arrays into common file
Expand Down
@@ -1,4 +1,4 @@
From 5f271a3d374561d25d0e338e7386dc144fbdd715 Mon Sep 17 00:00:00 2001
From b559760c4a49ded9daec493b7e3a08f494539fee Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Tue, 24 Jul 2018 21:22:00 +0200
Subject: [PATCH 09/44] ethtool: generic handlers for GET requests
Expand Down
@@ -1,4 +1,4 @@
From dc40375699aa155ebf134b387c150c8dda9080ca Mon Sep 17 00:00:00 2001
From 1d89819515cab38cc02c7ce415d5c39c0df4e858 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 23 Jul 2018 12:32:56 +0200
Subject: [PATCH 10/44] ethtool: provide string sets with STRSET_GET request
Expand Down Expand Up @@ -27,8 +27,8 @@ Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
net/ethtool/Makefile | 2 +-
net/ethtool/netlink.c | 8 +
net/ethtool/netlink.h | 4 +
net/ethtool/strset.c | 454 +++++++++++++++++++
7 files changed, 584 insertions(+), 3 deletions(-)
net/ethtool/strset.c | 453 +++++++++++++++++++
7 files changed, 583 insertions(+), 3 deletions(-)
create mode 100644 net/ethtool/strset.c

diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt
Expand Down Expand Up @@ -269,10 +269,10 @@ index 6a9695c3b0c6..2352fd9c17c3 100644
#endif /* _NET_ETHTOOL_NETLINK_H */
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
new file mode 100644
index 000000000000..e3c3ea77b056
index 000000000000..fd7229379158
--- /dev/null
+++ b/net/ethtool/strset.c
@@ -0,0 +1,454 @@
@@ -0,0 +1,453 @@
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+#include <linux/ethtool.h>
Expand Down Expand Up @@ -531,8 +531,7 @@ index 000000000000..e3c3ea77b056
+ if ((data->req_ids & (1U << i)) &&
+ data->info[i].per_dev) {
+ if (info)
+ GENL_SET_ERR_MSG(info,
+ "requested per device strings without dev");
+ GENL_SET_ERR_MSG(info, "requested per device strings without dev");
+ return -EINVAL;
+ }
+ }
Expand Down
@@ -1,4 +1,4 @@
From da173ea0670889d83011344ec545bb97f652982f Mon Sep 17 00:00:00 2001
From 617333c94f4b3db89a731a09b0dbd5cf985358b7 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 11:50:07 +0100
Subject: [PATCH 11/44] ethtool: provide link mode names as a string set
Expand Down Expand Up @@ -173,7 +173,7 @@ index 2352fd9c17c3..d85b1edc1b91 100644
const struct nlattr *nest, struct net *net,
struct netlink_ext_ack *extack,
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index e3c3ea77b056..58fe650a816e 100644
index fd7229379158..514ef04709d3 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -67,6 +67,12 @@ static const struct strset_info info_template[] = {
Expand Down
@@ -1,4 +1,4 @@
From f3f06a43b5a1605072185dc9fe7382989f42afa1 Mon Sep 17 00:00:00 2001
From 6500d0f88539daed18dd0f96bdf2af0474202943 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 14:49:09 +0100
Subject: [PATCH 12/44] ethtool: provide link settings and link modes in
Expand Down
@@ -1,4 +1,4 @@
From c3008c4a50d40f9220bb73bc31eb019d83174cc6 Mon Sep 17 00:00:00 2001
From e3d64181c964b8295ed7f5e0f9c27032310f6396 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 29 Jun 2019 19:54:07 +0200
Subject: [PATCH 13/44] ethtool: add standard notification handler
Expand Down
@@ -1,4 +1,4 @@
From 0810e762df3bf22e6124fc91e6f4aa6bf2abf408 Mon Sep 17 00:00:00 2001
From d5b79138653c700da407e04aa9eab3eb1cf348ad Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 8 Mar 2019 17:24:23 +0100
Subject: [PATCH 14/44] ethtool: set link settings and link modes with
Expand Down
@@ -1,4 +1,4 @@
From bab2e136c13ee4bbecd5e6a00bc516954832113b Mon Sep 17 00:00:00 2001
From 3b6286d097c2eecde3fdc41f60595a9bfc8d6838 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 15:26:45 +0100
Subject: [PATCH 15/44] ethtool: provide link state in SETTINGS_GET request
Expand Down
2 changes: 1 addition & 1 deletion kernel/0016-netlink-introduce-nla_put_bitfield32.patch
@@ -1,4 +1,4 @@
From 224a460c89cc3f344dd35c4e90ea0161cab45b6b Mon Sep 17 00:00:00 2001
From dbf963a740143f5014fc2ecfbb35a6ba4accb548 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 10 Nov 2017 14:17:36 +0100
Subject: [PATCH 16/44] netlink: introduce nla_put_bitfield32()
Expand Down
@@ -1,4 +1,4 @@
From f2be6104521b2035cd7cab7f9860b3d034d7de67 Mon Sep 17 00:00:00 2001
From e537cbc7d0f3aac94d8f6ca745fb0296e0bd5c77 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 15:08:55 +0100
Subject: [PATCH 17/44] ethtool: provide WoL information in SETTINGS_GET
Expand Down
@@ -1,4 +1,4 @@
From 3ec79244fe62e19e7c4c7bac6ac96c2ddc3976d3 Mon Sep 17 00:00:00 2001
From 61ef4f5bd2e7b089f5056596712b1329f897d175 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 8 Mar 2019 17:50:30 +0100
Subject: [PATCH 18/44] ethtool: set WoL settings with SETTINGS_SET request
Expand Down
@@ -1,4 +1,4 @@
From e0a03bd77cbe1499ee028ab2e6597b4fbb4c5446 Mon Sep 17 00:00:00 2001
From 7c6ec34f56556384cd5b40a266dcb7e41cb7b166 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 15:19:02 +0100
Subject: [PATCH 19/44] ethtool: provide message level in SETTINGS_GET request
Expand Down
@@ -1,4 +1,4 @@
From 3e18c69053a48919e0ea4ee9e434f19f3753ce9f Mon Sep 17 00:00:00 2001
From 6d0cc10cd1cf5ccee454b52276e172eeafc5456b Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 8 Mar 2019 18:01:46 +0100
Subject: [PATCH 20/44] ethtool: set message level with SETTINGS_SET request
Expand Down
@@ -1,4 +1,4 @@
From 3a0d4478fef1598c393c4ba9ba171f3109dd8386 Mon Sep 17 00:00:00 2001
From f310cdae9f4799dbd418d7900c6b94d7bb80afc4 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 27 Jul 2018 15:42:51 +0200
Subject: [PATCH 21/44] ethtool: provide device features in SETTINGS_GET
Expand Down
15 changes: 7 additions & 8 deletions kernel/0022-ethtool-set-device-features-with-SETTINGS_SET.patch
@@ -1,4 +1,4 @@
From 1407ea7fb9236e09de01bd926a0c325c49d1be34 Mon Sep 17 00:00:00 2001
From ca7df3c2da2db85724616e13a37a9d304f8190ec Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sun, 29 Jul 2018 14:58:36 +0200
Subject: [PATCH 22/44] ethtool: set device features with SETTINGS_SET
Expand All @@ -17,8 +17,8 @@ Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
Documentation/networking/ethtool-netlink.txt | 35 ++--
include/uapi/linux/ethtool_netlink.h | 1 +
net/ethtool/settings.c | 159 ++++++++++++++++++-
3 files changed, 185 insertions(+), 10 deletions(-)
net/ethtool/settings.c | 158 ++++++++++++++++++-
3 files changed, 184 insertions(+), 10 deletions(-)

diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt
index f2b0eeaf6461..35ea19b9baea 100644
Expand Down Expand Up @@ -123,7 +123,7 @@ index 0875c5d88410..ce8e9d6a4718 100644
/* add new constants above here */
__ETHTOOL_MSG_KERNEL_CNT,
diff --git a/net/ethtool/settings.c b/net/ethtool/settings.c
index f85451aba649..487ddc3e1dde 100644
index f85451aba649..4b06f824540e 100644
--- a/net/ethtool/settings.c
+++ b/net/ethtool/settings.c
@@ -648,6 +648,15 @@ static const struct nla_policy debug_set_policy[ETHTOOL_A_DEBUG_MAX + 1] = {
Expand Down Expand Up @@ -151,7 +151,7 @@ index f85451aba649..487ddc3e1dde 100644
};

static int ethnl_set_link_ksettings(struct genl_info *info,
@@ -878,12 +887,151 @@ static int settings_update_debug(struct genl_info *info, struct nlattr *nest,
@@ -878,12 +887,150 @@ static int settings_update_debug(struct genl_info *info, struct nlattr *nest,
return ret;
}

Expand Down Expand Up @@ -218,8 +218,7 @@ index f85451aba649..487ddc3e1dde 100644
+ if (ret < 0)
+ return ret;
+ if (features_from_bitmap(req_mask) & ~NETIF_F_ETHTOOL_BITS) {
+ GENL_SET_ERR_MSG(info,
+ "attempt to change non-ethtool features");
+ GENL_SET_ERR_MSG(info, "attempt to change non-ethtool features");
+ return -EINVAL;
+ }
+ if (!mod)
Expand Down Expand Up @@ -303,7 +302,7 @@ index f85451aba649..487ddc3e1dde 100644
int ret;

ret = nlmsg_parse(info->nlhdr, GENL_HDRLEN, tb,
@@ -927,6 +1075,15 @@ int ethnl_set_settings(struct sk_buff *skb, struct genl_info *info)
@@ -927,6 +1074,15 @@ int ethnl_set_settings(struct sk_buff *skb, struct genl_info *info)
if (ret)
req_mask |= ETHTOOL_IM_SETTINGS_DEBUG;
}
Expand Down
@@ -1,4 +1,4 @@
From 4bb6ad6e59ff6aa132a31c107d6064eb87607007 Mon Sep 17 00:00:00 2001
From adb8f9396ab33b4ebe64ee16b6b4cc4ae128ff7d Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 16:19:21 +0100
Subject: [PATCH 23/44] ethtool: provide private flags in SETTINGS_GET request
Expand Down Expand Up @@ -103,7 +103,7 @@ index 16482a266eec..5c2e810bc886 100644
case ETHTOOL_GRXFH:
case ETHTOOL_GRXRINGS:
diff --git a/net/ethtool/settings.c b/net/ethtool/settings.c
index 487ddc3e1dde..46cab669c612 100644
index 4b06f824540e..5a9d178d169e 100644
--- a/net/ethtool/settings.c
+++ b/net/ethtool/settings.c
@@ -20,6 +20,9 @@ struct settings_data {
Expand Down
@@ -1,4 +1,4 @@
From 22f141d4db8be21aef660e86ec691416112f2b8d Mon Sep 17 00:00:00 2001
From 3010240bb5f18fda9092dda93dbc5218abdda457 Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 7 Sep 2018 13:23:31 +0200
Subject: [PATCH 24/44] ethtool: set private flags with SETTINGS_SET request
Expand Down Expand Up @@ -36,7 +36,7 @@ index 966c25a258af..8a492a727cc2 100644
ETHTOOL_SRXFH n/a
ETHTOOL_GGRO ETHTOOL_MSG_SETTINGS_GET
diff --git a/net/ethtool/settings.c b/net/ethtool/settings.c
index 46cab669c612..5fa566043b76 100644
index 5a9d178d169e..6c746a30354b 100644
--- a/net/ethtool/settings.c
+++ b/net/ethtool/settings.c
@@ -765,7 +765,7 @@ settings_set_policy[ETHTOOL_A_SETTINGS_MAX + 1] = {
Expand All @@ -48,7 +48,7 @@ index 46cab669c612..5fa566043b76 100644
};

static int ethnl_set_link_ksettings(struct genl_info *info,
@@ -1124,6 +1124,41 @@ static int settings_update_features(struct genl_info *info,
@@ -1123,6 +1123,41 @@ static int settings_update_features(struct genl_info *info,
return 0;
}

Expand Down Expand Up @@ -90,7 +90,7 @@ index 46cab669c612..5fa566043b76 100644
int ethnl_set_settings(struct sk_buff *skb, struct genl_info *info)
{
struct nlattr *tb[ETHTOOL_A_SETTINGS_MAX + 1];
@@ -1183,6 +1218,15 @@ int ethnl_set_settings(struct sk_buff *skb, struct genl_info *info)
@@ -1182,6 +1217,15 @@ int ethnl_set_settings(struct sk_buff *skb, struct genl_info *info)
if (ret < 0)
goto out_ops;
}
Expand Down
@@ -1,4 +1,4 @@
From 1f332c2613a28793c723075139042ceac70efc70 Mon Sep 17 00:00:00 2001
From 8afd4ff9ff4d3a804e0ddddae0179215a5611a7e Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 10:51:08 +0100
Subject: [PATCH 25/44] ethtool: provide driver/device information in INFO_GET
Expand All @@ -18,11 +18,11 @@ Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
net/ethtool/Makefile | 2 +-
net/ethtool/common.c | 52 +++++++
net/ethtool/common.h | 1 +
net/ethtool/info.c | 152 +++++++++++++++++++
net/ethtool/info.c | 151 +++++++++++++++++++
net/ethtool/ioctl.c | 50 +-----
net/ethtool/netlink.c | 8 +
net/ethtool/netlink.h | 1 +
9 files changed, 290 insertions(+), 47 deletions(-)
9 files changed, 289 insertions(+), 47 deletions(-)
create mode 100644 net/ethtool/info.c

diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt
Expand Down Expand Up @@ -243,10 +243,10 @@ index 5f512dbbded5..fa878fff1564 100644
struct ethtool_link_ksettings *link_ksettings,
diff --git a/net/ethtool/info.c b/net/ethtool/info.c
new file mode 100644
index 000000000000..99c81c949434
index 000000000000..63f64506f8a5
--- /dev/null
+++ b/net/ethtool/info.c
@@ -0,0 +1,152 @@
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
+
+#include "netlink.h"
Expand Down Expand Up @@ -299,8 +299,7 @@ index 000000000000..99c81c949434
+
+ data->repdata_base.info_mask = req_mask;
+ if (req_info->req_mask & ~req_mask && info)
+ GENL_SET_ERR_MSG(info,
+ "not all requested data could be retrieved");
+ GENL_SET_ERR_MSG(info, "not all requested data could be retrieved");
+ return 0;
+}
+
Expand Down
@@ -1,4 +1,4 @@
From f2c5dcdb06418dbc913005ddfb86e6f823079a05 Mon Sep 17 00:00:00 2001
From c40979b201c2d28578b93ac4625db16ff41ae10a Mon Sep 17 00:00:00 2001
From: Michal Kubecek <mkubecek@suse.cz>
Date: Sat, 16 Feb 2019 11:22:58 +0100
Subject: [PATCH 26/44] ethtool: provide timestamping information in INFO_GET
Expand Down Expand Up @@ -227,7 +227,7 @@ index fa878fff1564..937c5d21c72f 100644
bool convert_legacy_settings_to_link_ksettings(
struct ethtool_link_ksettings *link_ksettings,
diff --git a/net/ethtool/info.c b/net/ethtool/info.c
index 99c81c949434..fd00ce17b96f 100644
index 63f64506f8a5..a9d96d3c9a8f 100644
--- a/net/ethtool/info.c
+++ b/net/ethtool/info.c
@@ -1,21 +1,68 @@
Expand Down Expand Up @@ -311,7 +311,7 @@ index 99c81c949434..fd00ce17b96f 100644
ethnl_after_ops(dev);

data->repdata_base.info_mask = req_mask;
@@ -71,6 +123,42 @@ static int info_drvinfo_size(const struct ethtool_drvinfo *drvinfo)
@@ -70,6 +122,42 @@ static int info_drvinfo_size(const struct ethtool_drvinfo *drvinfo)
return nla_total_size(len);
}

Expand Down Expand Up @@ -354,7 +354,7 @@ index 99c81c949434..fd00ce17b96f 100644
/* reply_size() handler */
static int info_size(const struct ethnl_req_info *req_info)
{
@@ -82,6 +170,15 @@ static int info_size(const struct ethnl_req_info *req_info)
@@ -81,6 +169,15 @@ static int info_size(const struct ethnl_req_info *req_info)
len += ethnl_reply_header_size();
if (info_mask & ETHTOOL_IM_INFO_DRVINFO)
len += info_drvinfo_size(&data->drvinfo);
Expand All @@ -370,7 +370,7 @@ index 99c81c949434..fd00ce17b96f 100644

return len;
}
@@ -116,6 +213,47 @@ static int info_fill_drvinfo(struct sk_buff *skb,
@@ -115,6 +212,47 @@ static int info_fill_drvinfo(struct sk_buff *skb,
return -EMSGSIZE;
}

Expand Down Expand Up @@ -418,7 +418,7 @@ index 99c81c949434..fd00ce17b96f 100644
/* fill_reply() handler */
static int info_fill(struct sk_buff *skb,
const struct ethnl_req_info *req_info)
@@ -130,6 +268,13 @@ static int info_fill(struct sk_buff *skb,
@@ -129,6 +267,13 @@ static int info_fill(struct sk_buff *skb,
if (ret < 0)
return ret;
}
Expand Down Expand Up @@ -491,7 +491,7 @@ index 10d75fca5056..dc41095f71ca 100644

int ethnl_parse_header(struct ethnl_req_info *req_info,
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index 58fe650a816e..665d527809eb 100644
index 514ef04709d3..52bab3301bac 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -73,6 +73,24 @@ static const struct strset_info info_template[] = {
Expand Down

0 comments on commit 9c57aa8

Please sign in to comment.