Skip to content

Commit 362142b

Browse files
jtlaytonJ. Bruce Fields
authored andcommitted
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>
1 parent 05a45a2 commit 362142b

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

include/linux/sunrpc/svc_xprt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct svc_xprt {
6767
#define XPT_CACHE_AUTH 11 /* cache auth info */
6868
#define XPT_LOCAL 12 /* connection from loopback interface */
6969
#define XPT_KILL_TEMP 13 /* call xpo_kill_temp_xprt before closing */
70+
#define XPT_CONG_CTRL 14 /* has congestion control */
7071

7172
struct svc_serv *xpt_server; /* service for transport */
7273
atomic_t xpt_reserved; /* space on outq that is rsvd */

net/sunrpc/svcsock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,7 @@ static void svc_tcp_init(struct svc_sock *svsk, struct svc_serv *serv)
13061306
svc_xprt_init(sock_net(svsk->sk_sock->sk), &svc_tcp_class,
13071307
&svsk->sk_xprt, serv);
13081308
set_bit(XPT_CACHE_AUTH, &svsk->sk_xprt.xpt_flags);
1309+
set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
13091310
if (sk->sk_state == TCP_LISTEN) {
13101311
dprintk("setting up TCP socket for listening\n");
13111312
set_bit(XPT_LISTENER, &svsk->sk_xprt.xpt_flags);

net/sunrpc/xprtrdma/svc_rdma_transport.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,14 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv,
569569
spin_lock_init(&cma_xprt->sc_ctxt_lock);
570570
spin_lock_init(&cma_xprt->sc_map_lock);
571571

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+
572580
if (listener)
573581
set_bit(XPT_LISTENER, &cma_xprt->sc_xprt.xpt_flags);
574582

0 commit comments

Comments
 (0)