From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
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
Subject: [PATCH 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 09:45:54 -0400 [thread overview]
Message-ID: <4471e1253cbbd917c1b1bd62b5b14844c19a857f.1443569239.git.sowmini.varadhan@oracle.com> (raw)
In-Reply-To: <cover.1443569239.git.sowmini.varadhan@oracle.com>
In-Reply-To: <cover.1443569239.git.sowmini.varadhan@oracle.com>
For the same reasons as 2f53384424 and 35f9c09fe9, 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>
---
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..5f3e3fa 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
next prev parent reply other threads:[~2015-09-30 13:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 13:45 [PATCH net-next 0/3] RDS: RDS-TCP perf enhancements Sowmini Varadhan
2015-09-30 13:45 ` [PATCH net-next 1/3] net/rds: Use a single TCP socket for both send and receive Sowmini Varadhan
2015-09-30 14:45 ` kbuild test robot
2015-09-30 15:50 ` santosh shilimkar
2015-09-30 15:58 ` Sowmini Varadhan
2015-09-30 16:04 ` santosh shilimkar
2015-09-30 16:09 ` Sowmini Varadhan
2015-09-30 16:13 ` santosh shilimkar
2015-09-30 13:45 ` [PATCH net-next 2/3] RDS-TCP: Do not bloat sndbuf/rcvbuf in rds_tcp_tune Sowmini Varadhan
2015-09-30 15:54 ` santosh shilimkar
2015-09-30 13:45 ` Sowmini Varadhan [this message]
2015-09-30 14:53 ` [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit Sergei Shtylyov
2015-09-30 15:56 ` santosh shilimkar
2015-09-30 16:00 ` Sowmini Varadhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4471e1253cbbd917c1b1bd62b5b14844c19a857f.1443569239.git.sowmini.varadhan@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=ajaykumar.hotchandani@oracle.com \
--cc=davem@davemloft.net \
--cc=igor.maximov@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®