diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2015-09-30 16:54:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-05 06:34:53 -0400 |
commit | 76b29ef120f5b845f862de08b92c7d2317b50907 (patch) | |
tree | feccf26a3c9fa86e110b4b7a6b35cd9413c4d5df /net/rds/tcp_send.c | |
parent | 1edd6a14d24f21b8b478970c63a243a08e2b55b0 (diff) |
RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit
For the same reasons as commit 2f5338442425 ("tcp: allow splice() to
build full TSO packets") and commit 35f9c09fe9c7 ("tcp: tcp_sendpages()
should call tcp_push() once"), rds_tcp_xmit may have multiple pages to
send, so use the MSG_MORE and MSG_SENDPAGE_NOTLAST as hints to
tcp_sendpage()
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp_send.c')
-rw-r--r-- | net/rds/tcp_send.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c index 53b17ca0dff5..2894e6095e3b 100644 --- a/net/rds/tcp_send.c +++ b/net/rds/tcp_send.c | |||
@@ -83,6 +83,7 @@ int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
83 | struct rds_tcp_connection *tc = conn->c_transport_data; | 83 | struct rds_tcp_connection *tc = conn->c_transport_data; |
84 | int done = 0; | 84 | int done = 0; |
85 | int ret = 0; | 85 | int ret = 0; |
86 | int more; | ||
86 | 87 | ||
87 | if (hdr_off == 0) { | 88 | if (hdr_off == 0) { |
88 | /* | 89 | /* |
@@ -116,12 +117,15 @@ int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
116 | goto out; | 117 | goto out; |
117 | } | 118 | } |
118 | 119 | ||
120 | more = rm->data.op_nents > 1 ? (MSG_MORE | MSG_SENDPAGE_NOTLAST) : 0; | ||
119 | while (sg < rm->data.op_nents) { | 121 | while (sg < rm->data.op_nents) { |
122 | int flags = MSG_DONTWAIT | MSG_NOSIGNAL | more; | ||
123 | |||
120 | ret = tc->t_sock->ops->sendpage(tc->t_sock, | 124 | ret = tc->t_sock->ops->sendpage(tc->t_sock, |
121 | sg_page(&rm->data.op_sg[sg]), | 125 | sg_page(&rm->data.op_sg[sg]), |
122 | rm->data.op_sg[sg].offset + off, | 126 | rm->data.op_sg[sg].offset + off, |
123 | rm->data.op_sg[sg].length - off, | 127 | rm->data.op_sg[sg].length - off, |
124 | MSG_DONTWAIT|MSG_NOSIGNAL); | 128 | flags); |
125 | rdsdebug("tcp sendpage %p:%u:%u ret %d\n", (void *)sg_page(&rm->data.op_sg[sg]), | 129 | rdsdebug("tcp sendpage %p:%u:%u ret %d\n", (void *)sg_page(&rm->data.op_sg[sg]), |
126 | rm->data.op_sg[sg].offset + off, rm->data.op_sg[sg].length - off, | 130 | rm->data.op_sg[sg].offset + off, rm->data.op_sg[sg].length - off, |
127 | ret); | 131 | ret); |
@@ -134,6 +138,8 @@ int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
134 | off = 0; | 138 | off = 0; |
135 | sg++; | 139 | sg++; |
136 | } | 140 | } |
141 | if (sg == rm->data.op_nents - 1) | ||
142 | more = 0; | ||
137 | } | 143 | } |
138 | 144 | ||
139 | out: | 145 | out: |