From: David Decotigny <[email protected]>
This removes the requirement that ethtool be tied to the support
of a specific L3 protocol, also updates a comment.
History:
v2
updated commit description for the netlink ioctl patch
v1
initial submission
############################################
# Patch Set Summary:
David Decotigny (2):
ethtool: minor doc update
netlink: add support for NIC driver ioctls
include/uapi/linux/ethtool.h | 6 +++---
net/netlink/af_netlink.c | 10 +++++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
--
2.8.0.rc3.226.g39d4020
From: David Decotigny <[email protected]>
Updates: commit 793cf87de9d1 ("ethtool: Set cmd field in
ETHTOOL_GLINKSETTINGS response to wrong nwords")
Signed-off-by: David Decotigny <[email protected]>
---
include/uapi/linux/ethtool.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 2835b07..9222db8 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1648,9 +1648,9 @@ enum ethtool_reset_flags {
* %ETHTOOL_GLINKSETTINGS: on entry, number of words passed by user
* (>= 0); on return, if handshake in progress, negative if
* request size unsupported by kernel: absolute value indicates
- * kernel recommended size and cmd field is 0, as well as all the
- * other fields; otherwise (handshake completed), strictly
- * positive to indicate size used by kernel and cmd field is
+ * kernel expected size and all the other fields but cmd
+ * are 0; otherwise (handshake completed), strictly positive
+ * to indicate size used by kernel and cmd field stays
* %ETHTOOL_GLINKSETTINGS, all other fields populated by driver. For
* %ETHTOOL_SLINKSETTINGS: must be valid on entry, ie. a positive
* value returned previously by %ETHTOOL_GLINKSETTINGS, otherwise
--
2.8.0.rc3.226.g39d4020
From: David Decotigny <[email protected]>
By returning -ENOIOCTLCMD, sock_do_ioctl() falls back to calling
dev_ioctl(), which provides support for NIC driver ioctls, which
includes ethtool support. This is similar to the way ioctls are handled
in udp.c or tcp.c.
This removes the requirement that ethtool for example be tied to the
support of a specific L3 protocol (ethtool uses an AF_INET socket
today).
Signed-off-by: David Decotigny <[email protected]>
---
net/netlink/af_netlink.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c841679..215fc08 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1033,6 +1033,14 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr,
return 0;
}
+static int netlink_ioctl(struct socket *sock, unsigned int cmd,
+ unsigned long arg)
+{
+ /* try to hand this ioctl down to the NIC drivers.
+ */
+ return -ENOIOCTLCMD;
+}
+
static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid)
{
struct sock *sock;
@@ -2494,7 +2502,7 @@ static const struct proto_ops netlink_ops = {
.accept = sock_no_accept,
.getname = netlink_getname,
.poll = datagram_poll,
- .ioctl = sock_no_ioctl,
+ .ioctl = netlink_ioctl,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = netlink_setsockopt,
--
2.8.0.rc3.226.g39d4020
From: David Decotigny <[email protected]>
Date: Mon, 21 Mar 2016 10:15:33 -0700
> From: David Decotigny <[email protected]>
>
> This removes the requirement that ethtool be tied to the support
> of a specific L3 protocol, also updates a comment.
>
> History:
> v2
> updated commit description for the netlink ioctl patch
> v1
> initial submission
Series applied, thanks David.