Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1236753
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Sowmini Varadhan <sowmini.varadhan@oracle.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit |
| Date | Wed, 30 Sep 2015 23:00:02 +0200 |
| Message-ID | <qewDM-7OB-17@gated-at.bofh.it> (permalink) |
| References | <qewDM-7OB-13@gated-at.bofh.it> |
| X-Original-To | netdev@vger.kernel.org, linux-kernel@vger.kernel.org |
| X-Mailer | git-send-email 1.7.1 |
| X-Source-IP | aserv0022.oracle.com [141.146.126.234] |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 60 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | davem@davemloft.net, rds-devel@oss.oracle.com, ajaykumar.hotchandani@oracle.com, igor.maximov@oracle.com, sowmini.varadhan@oracle.com, santosh.shilimkar@oracle.com, sergei.shtylyov@cogentembedded.com |
| X-Original-Date | Wed, 30 Sep 2015 16:54:09 -0400 |
| X-Original-Message-ID | <d37e27a682cce2fc60faeaa1d76ade62c83ec19e.1443636587.git.sowmini.varadhan@oracle.com> |
| X-Original-References | <cover.1443636587.git.sowmini.varadhan@oracle.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1236753 |
Show key headers only | View raw
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>
---
v2: Sergei Shtylov, Santosh Shilimkar comments (some parens retained for
readability)
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 53b17ca..2894e60 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,
struct rds_tcp_connection *tc = conn->c_transport_data;
int done = 0;
int ret = 0;
+ int more;
if (hdr_off == 0) {
/*
@@ -116,12 +117,15 @@ int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm,
goto out;
}
+ more = rm->data.op_nents > 1 ? (MSG_MORE | MSG_SENDPAGE_NOTLAST) : 0;
while (sg < rm->data.op_nents) {
+ int flags = MSG_DONTWAIT | MSG_NOSIGNAL | more;
+
ret = tc->t_sock->ops->sendpage(tc->t_sock,
sg_page(&rm->data.op_sg[sg]),
rm->data.op_sg[sg].offset + off,
rm->data.op_sg[sg].length - off,
- MSG_DONTWAIT|MSG_NOSIGNAL);
+ flags);
rdsdebug("tcp sendpage %p:%u:%u ret %d\n", (void *)sg_page(&rm->data.op_sg[sg]),
rm->data.op_sg[sg].offset + off, rm->data.op_sg[sg].length - off,
ret);
@@ -134,6 +138,8 @@ int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm,
off = 0;
sg++;
}
+ if (sg == rm->data.op_nents - 1)
+ more = 0;
}
out:
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 net-next 0/3] RDS: RDS-TCP perf enhancements Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-09-30 23:00 +0200 [PATCH v2 net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-09-30 23:00 +0200 [PATCH v2 net-next 1/3] RDS: Use a single TCP socket for both send and receive. Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-09-30 23:00 +0200 [PATCH v2 net-next 2/3] RDS-TCP: Do not bloat sndbuf/rcvbuf in rds_tcp_tune Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2015-09-30 23:00 +0200 Re: [PATCH v2 net-next 0/3] RDS: RDS-TCP perf enhancements santosh shilimkar <santosh.shilimkar@oracle.com> - 2015-10-01 01:30 +0200 Re: [PATCH v2 net-next 0/3] RDS: RDS-TCP perf enhancements David Miller <davem@davemloft.net> - 2015-10-05 12:30 +0200
csiph-web