Re: [Cluster-devel] [PATCH 20/33] ipv4: add ip_sock_set_recverr

2020-05-20 Thread Christoph Hellwig
On Thu, May 14, 2020 at 04:51:26AM -0700, Joe Perches wrote: > > Mostly to keep it symmetric with the sockopt. I could probably remove > > a few arguments in the series if we want to be strict. > > My preference would use strict and add > arguments only when necessary. In a few cases that would

[Cluster-devel] [PATCH 33/33] net: remove kernel_setsockopt

2020-05-20 Thread Christoph Hellwig
No users left. Signed-off-by: Christoph Hellwig --- include/linux/net.h | 2 -- net/socket.c| 31 --- 2 files changed, 33 deletions(-) diff --git a/include/linux/net.h b/include/linux/net.h index 74ef5d7315f70..e10f378194a59 100644 --- a/include/linux/net.h

[Cluster-devel] [PATCH 25/33] ipv6: add ip6_sock_set_v6only

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IPV6_V6ONLY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ipv6.h| 11 +++ net/ipv6/ip6_udp_tunnel.c | 5 + net/sunrpc/svcsock.c | 6 +- 3 files changed, 13

[Cluster-devel] [PATCH 32/33] net: add a new bind_add method

2020-05-20 Thread Christoph Hellwig
The SCTP protocol allows to bind multiple address to a socket. That feature is currently only exposed as a socket option. Add a bind_add method struct proto that allows to bind additional addresses, and switch the dlm code to use the method instead of going through the socket option from kernel

[Cluster-devel] [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SCTP_NODELAY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 10 ++ include/net/sctp/sctp.h | 7 +++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git

[Cluster-devel] [PATCH 28/33] ipv6: add ip6_sock_set_recvpktinfo

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IPV6_RECVPKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ipv6.h | 7 +++ net/sunrpc/svcsock.c | 10 ++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git

[Cluster-devel] [PATCH 21/33] ipv4: add ip_sock_set_freebind

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IP_FREEBIND sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- drivers/target/iscsi/iscsi_target_login.c | 13 +++-- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c

[Cluster-devel] [PATCH 22/33] ipv4: add ip_sock_set_recverr

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IP_RECVERR sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells --- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c | 8 net/rxrpc/local_object.c | 8 +--- 3 files

[Cluster-devel] [PATCH 19/33] tcp: add tcp_sock_set_keepcnt

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_KEEPCNT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/linux/tcp.h | 1 + net/ipv4/tcp.c| 12 net/rds/tcp.h | 2 +- net/rds/tcp_listen.c | 17 +++--

[Cluster-devel] [PATCH 29/33] rxrpc: add rxrpc_sock_set_min_security_level

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the RXRPC_MIN_SECURITY_LEVEL sockopt from kernel space without going through a fake uaccess. Thanks to David Howells for the documentation updates. Signed-off-by: Christoph Hellwig --- Documentation/networking/rxrpc.rst | 13 +++-- fs/afs/rxrpc.c

[Cluster-devel] [PATCH 27/33] ipv6: add ip6_sock_set_addr_preferences

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IPV6_ADD_PREFERENCES sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ipv6.h | 67 net/ipv6/ipv6_sockglue.c | 59 +--

[Cluster-devel] [PATCH 30/33] tipc: call tsk_set_importance from tipc_topsrv_create_listener

2020-05-20 Thread Christoph Hellwig
Avoid using kernel_setsockopt for the TIPC_IMPORTANCE option when we can just use the internal helper. The only change needed is to pass a struct sock instead of tipc_sock, which is private to socket.c Signed-off-by: Christoph Hellwig --- net/tipc/socket.c | 18 +-

[Cluster-devel] [PATCH 18/33] tcp: add tcp_sock_set_keepintvl

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_KEEPINTVL sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/linux/tcp.h | 1 + net/ipv4/tcp.c| 12 net/rds/tcp_listen.c | 4 +--- net/sunrpc/xprtsock.c | 3 +-- 4 files

[Cluster-devel] [PATCH 24/33] ipv4: add ip_sock_set_pktinfo

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IP_PKTINFO sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c | 8 net/sunrpc/svcsock.c | 5 ++--- 3 files changed, 11 insertions(+), 3 deletions(-)

[Cluster-devel] [PATCH 16/33] tcp: add tcp_sock_set_user_timeout

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_USER_TIMEOUT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/ocfs2/cluster/tcp.c | 22 ++ include/linux/tcp.h| 1 + net/ipv4/tcp.c | 8 net/sunrpc/xprtsock.c

[Cluster-devel] [PATCH 23/33] ipv4: add ip_sock_set_mtu_discover

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IP_MTU_DISCOVER sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Reviewed-by: David Howells [rxrpc bits] --- include/net/ip.h | 1 + net/ipv4/ip_sockglue.c | 11 +++ net/rxrpc/local_object.c |

[Cluster-devel] [PATCH 20/33] ipv4: add ip_sock_set_tos

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the IP_TOS sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 14 +++--- drivers/nvme/target/tcp.c | 10 ++ include/net/ip.h | 2 ++

[Cluster-devel] [PATCH 08/33] net: add sock_enable_timestamps

2020-05-20 Thread Christoph Hellwig
Add a helper to directly enable timestamps instead of setting the SO_TIMESTAMP* sockopts from kernel space and going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h | 1 + net/core/sock.c | 47 +---

[Cluster-devel] [PATCH 14/33] tcp: add tcp_sock_set_quickack

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_QUICKACK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_int.h | 7 --

[Cluster-devel] [PATCH 02/33] net: remove kernel_getsockopt

2020-05-20 Thread Christoph Hellwig
No users left. Signed-off-by: Christoph Hellwig --- include/linux/net.h | 2 -- net/socket.c| 34 -- 2 files changed, 36 deletions(-) diff --git a/include/linux/net.h b/include/linux/net.h index 6451425e828f5..74ef5d7315f70 100644 ---

[Cluster-devel] [PATCH 15/33] tcp: add tcp_sock_set_syncnt

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_SYNCNT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 9 + include/linux/tcp.h | 1 + net/ipv4/tcp.c | 12 3 files

[Cluster-devel] [PATCH 12/33] tcp: add tcp_sock_set_cork

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_CORK sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_int.h | 14

[Cluster-devel] [PATCH 05/33] net: add sock_set_priority

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_PRIORITY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 12 ++-- drivers/nvme/target/tcp.c | 18 -- include/net/sock.h|

[Cluster-devel] [PATCH 07/33] net: add sock_bindtoindex

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_BINDTOIFINDEX sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h| 1 + net/core/sock.c | 21 +++-- net/ipv4/udp_tunnel.c | 4 +---

Re: [Cluster-devel] [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-20 Thread Marcelo Ricardo Leitner
On Wed, May 20, 2020 at 09:55:07PM +0200, Christoph Hellwig wrote: > Add a helper to directly set the SCTP_NODELAY sockopt from kernel space > without going through a fake uaccess. > > Signed-off-by: Christoph Hellwig > --- > fs/dlm/lowcomms.c | 10 ++ > include/net/sctp/sctp.h |

Re: [Cluster-devel] [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-20 Thread David Miller
From: Marcelo Ricardo Leitner Date: Wed, 20 May 2020 20:10:01 -0300 > The duplication with sctp_setsockopt_nodelay() is quite silly/bad. > Also, why have the 'true' hardcoded? It's what dlm uses, yes, but the > API could be a bit more complete than that. The APIs are being designed based upon

[Cluster-devel] [PATCH 01/33] dlm: use the tcp version of accept_from_sock for sctp as well

2020-05-20 Thread Christoph Hellwig
The only difference between a few missing fixes applied to the SCTP one is that TCP uses ->getpeername to get the remote address, while SCTP uses kernel_getsockopt(.. SCTP_PRIMARY_ADDR). But given that getpeername is defined to return the primary address for sctp, there doesn't seem to be any

[Cluster-devel] [PATCH 11/33] net: add sock_set_reuseport

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_REUSEPORT sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- include/net/sock.h| 1 + net/core/sock.c | 8 net/sunrpc/xprtsock.c | 17 + 3 files changed, 10 insertions(+),

[Cluster-devel] [PATCH 06/33] net: add sock_set_sndtimeo

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_SNDTIMEO_NEW sockopt from kernel space without going through a fake uaccess. The interface is simplified to only pass the seconds value, as that is the only thing needed at the moment. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 8 ++--

[Cluster-devel] [PATCH 13/33] tcp: add tcp_sock_set_nodelay

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the TCP_NODELAY sockopt from kernel space without going through a fake uaccess. Cleanup the callers to avoid pointless wrappers now that this is a simple function call. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg Acked-by: Jason Gunthorpe ---

[Cluster-devel] [PATCH 10/33] net: add sock_set_rcvbuf

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_RCVBUFFORCE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 7 +- include/net/sock.h | 1 + net/core/sock.c| 59 +- 3 files

[Cluster-devel] [PATCH 04/33] net: add sock_no_linger

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_LINGER sockopt from kernel space with onoff set to true and a linger time of 0 without going through a fake uaccess. Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg --- drivers/nvme/host/tcp.c | 9 + drivers/nvme/target/tcp.c | 6 +-

[Cluster-devel] [PATCH 09/33] net: add sock_set_keepalive

2020-05-20 Thread Christoph Hellwig
Add a helper to directly set the SO_KEEPALIVE sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 6 +- include/net/sock.h| 1 + net/core/sock.c | 10 ++ net/rds/tcp_listen.c | 6 +-

Re: [Cluster-devel] [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-20 Thread Marcelo Ricardo Leitner
On Wed, May 20, 2020 at 04:23:55PM -0700, David Miller wrote: > From: Marcelo Ricardo Leitner > Date: Wed, 20 May 2020 20:10:01 -0300 > > > The duplication with sctp_setsockopt_nodelay() is quite silly/bad. > > Also, why have the 'true' hardcoded? It's what dlm uses, yes, but the > > API could