Re: [PATCH net-next v2 03/10] net: ethtool: netlink: Add support for triggering a cable test
From: Michal Kubecek <hidden>
Date: 2020-05-05 07:15:22
On Tue, May 05, 2020 at 02:18:14AM +0200, Andrew Lunn wrote:
quoted hunk ↗ jump to hunk
Add new ethtool netlink calls to trigger the starting of a PHY cable test. Add Kconfig'ury to ETHTOOL_NETLINK so that PHYLIB is not a module when ETHTOOL_NETLINK is builtin, which would result in kernel linking errors. v2: Remove unwanted white space change Remove ethnl_cable_test_act_ops and use doit handler Rename cable_test_set_policy cable_test_act_policy Remove ETHTOOL_MSG_CABLE_TEST_ACT_REPLY Signed-off-by: Andrew Lunn <andrew@lunn.ch> ---diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst index 567326491f80..72d53da2bea9 100644 --- a/Documentation/networking/ethtool-netlink.rst +++ b/Documentation/networking/ethtool-netlink.rst@@ -204,6 +204,7 @@ Userspace to kernel: ``ETHTOOL_MSG_EEE_GET`` get EEE settings ``ETHTOOL_MSG_EEE_SET`` set EEE settings ``ETHTOOL_MSG_TSINFO_GET`` get timestamping info + ``ETHTOOL_MSG_CABLE_TEST_ACT`` action start cable test ===================================== ================================ Kernel to userspace:@@ -235,6 +236,7 @@ Kernel to userspace: ``ETHTOOL_MSG_EEE_GET_REPLY`` EEE settings ``ETHTOOL_MSG_EEE_NTF`` EEE settings ``ETHTOOL_MSG_TSINFO_GET_REPLY`` timestamping info + ``ETHTOOL_MSG_CABLE_TEST_ACT_REPLY`` Cable test action result
This was dropped. [...]
quoted hunk ↗ jump to hunk
diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c new file mode 100644 index 000000000000..6e5782a7da80 --- /dev/null +++ b/net/ethtool/cabletest.c@@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include <linux/phy.h> +#include "netlink.h" +#include "common.h" +#include "bitset.h" + +static const struct nla_policy +cable_test_get_policy[ETHTOOL_A_CABLE_TEST_MAX + 1] = { + [ETHTOOL_A_CABLE_TEST_UNSPEC] = { .type = NLA_REJECT }, + [ETHTOOL_A_CABLE_TEST_HEADER] = { .type = NLA_NESTED }, +};
This policy is probably a leftover from the previous version. Also, you don't need to include bitset.h [...]
quoted hunk ↗ jump to hunk
diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index 81b8fa020bcb..03e65e2b9e3d 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h@@ -345,6 +345,7 @@ extern const struct ethnl_request_ops ethnl_coalesce_request_ops; extern const struct ethnl_request_ops ethnl_pause_request_ops; extern const struct ethnl_request_ops ethnl_eee_request_ops; extern const struct ethnl_request_ops ethnl_tsinfo_request_ops; +extern const struct ethnl_request_ops ethnl_cable_test_act_ops;
This was also dropped. Excepts for the cleanups suggested above, Reviewed-by: Michal Kubecek <redacted> Michal