Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sunrpc: flag transports as having congestion control

NFSv4 requires a transport protocol with congestion control in most
cases.

On an IP network, that means that NFSv4 over UDP should be forbidden.

The situation with RDMA is a bit more nuanced, but most RDMA transports
are suitable for this. For now, we assume that all RDMA transports are
suitable, but we may need to revise that at some point.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Jeff Layton and committed by
J. Bruce Fields
362142b2 05a45a2d

+10
+1
include/linux/sunrpc/svc_xprt.h
··· 67 67 #define XPT_CACHE_AUTH 11 /* cache auth info */ 68 68 #define XPT_LOCAL 12 /* connection from loopback interface */ 69 69 #define XPT_KILL_TEMP 13 /* call xpo_kill_temp_xprt before closing */ 70 + #define XPT_CONG_CTRL 14 /* has congestion control */ 70 71 71 72 struct svc_serv *xpt_server; /* service for transport */ 72 73 atomic_t xpt_reserved; /* space on outq that is rsvd */
+1
net/sunrpc/svcsock.c
··· 1306 1306 svc_xprt_init(sock_net(svsk->sk_sock->sk), &svc_tcp_class, 1307 1307 &svsk->sk_xprt, serv); 1308 1308 set_bit(XPT_CACHE_AUTH, &svsk->sk_xprt.xpt_flags); 1309 + set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags); 1309 1310 if (sk->sk_state == TCP_LISTEN) { 1310 1311 dprintk("setting up TCP socket for listening\n"); 1311 1312 set_bit(XPT_LISTENER, &svsk->sk_xprt.xpt_flags);
+8
net/sunrpc/xprtrdma/svc_rdma_transport.c
··· 569 569 spin_lock_init(&cma_xprt->sc_ctxt_lock); 570 570 spin_lock_init(&cma_xprt->sc_map_lock); 571 571 572 + /* 573 + * Note that this implies that the underlying transport support 574 + * has some form of congestion control (see RFC 7530 section 3.1 575 + * paragraph 2). For now, we assume that all supported RDMA 576 + * transports are suitable here. 577 + */ 578 + set_bit(XPT_CONG_CTRL, &cma_xprt->sc_xprt.xpt_flags); 579 + 572 580 if (listener) 573 581 set_bit(XPT_LISTENER, &cma_xprt->sc_xprt.xpt_flags); 574 582