Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236299 > unrolled thread

[PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit

Started bySowmini Varadhan <sowmini.varadhan@oracle.com>
First post2015-09-30 15:50 +0200
Last post2015-09-30 18:10 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 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 15:50 +0200
    Re: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and  MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-09-30 17:00 +0200
    Re: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and  MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit santosh shilimkar <santosh.shilimkar@oracle.com> - 2015-09-30 18:00 +0200
      Re: [PATCH 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 18:10 +0200

#1236299 — [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit

FromSowmini Varadhan <sowmini.varadhan@oracle.com>
Date2015-09-30 15:50 +0200
Subject[PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit
Message-ID<qepVE-6Bs-9@gated-at.bofh.it>
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

--
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/

[toc] | [next] | [standalone]


#1236416 — Re: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-09-30 17:00 +0200
SubjectRe: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit
Message-ID<qer1n-8aa-1@gated-at.bofh.it>
In reply to#1236299
Hello.

On 09/30/2015 04:45 PM, Sowmini Varadhan wrote:

> 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
[...]
> @@ -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);

    No need for either inner or outer parens.

>   	while (sg < rm->data.op_nents) {
> +		int flags = (MSG_DONTWAIT | MSG_NOSIGNAL | more);

    Parens not needed as well.

[...]

MBR, Sergei

--
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/

[toc] | [prev] | [next] | [standalone]


#1236464 — Re: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit

Fromsantosh shilimkar <santosh.shilimkar@oracle.com>
Date2015-09-30 18:00 +0200
SubjectRe: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit
Message-ID<qerXs-14n-1@gated-at.bofh.it>
In reply to#1236299
On 9/30/2015 6:45 AM, Sowmini Varadhan wrote:
> 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>
> ---
Your checkpatch.pl should have complained about commit
reference in the change-log. You might want to fix that
for consistency.

Patch itself is fine.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

--
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/

[toc] | [prev] | [next] | [standalone]


#1236482 — Re: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit

FromSowmini Varadhan <sowmini.varadhan@oracle.com>
Date2015-09-30 18:10 +0200
SubjectRe: [PATCH net-next 3/3] RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit
Message-ID<qes78-1uV-17@gated-at.bofh.it>
In reply to#1236464
On (09/30/15 08:56), santosh shilimkar wrote:
> Your checkpatch.pl should have complained about commit
> reference in the change-log. You might want to fix that
> for consistency.

It didnt. But ok, I'll fix this nit as well.

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web