Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David Miller" <davem@davemloft.net>,
	"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>,
	"Krishna Kumar" <krkumar2@in.ibm.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: [RFC] Question about tcp_sendmsg()
Date: Thu, 15 Jul 2010 15:14:48 +0200	[thread overview]
Message-ID: <1279199688.2496.32.camel@edumazet-laptop> (raw)

While investigating for various bug reports in tcp stack, I looked at
commit def87cf42069a (tcp: Slightly optimize tcp_sendmsg)

One question I have is that the 

sg = sk->sk_route_caps & NETIF_F_SG;

is now done at the beginning of tcp_sendmsg(), and kept in sg variable
for the whole tcp_sendmsg() duration, even if task has to wait for
space.

Previously sk->sk_route_caps & NETIF_F_SG was done in select_size()
itself.

I am wondering if this can have a side effect, if SG capability changes
while a thread has to wait in sk_stream_wait_memory(), and socket route
changes (sk_route_caps flips NETIF_F_SG bit)

Thanks

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 9fce8a8..8a4d9bd 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1093,6 +1093,7 @@ wait_for_memory:
 				goto do_error;
 
 			mss_now = tcp_send_mss(sk, &size_goal, flags);
+			sg = sk->sk_route_caps & NETIF_F_SG;
 		}
 	}
 



             reply	other threads:[~2010-07-15 13:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15 13:14 Eric Dumazet [this message]
2010-07-16  2:15 ` [RFC] Question about tcp_sendmsg() David Miller

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=1279199688.2496.32.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=krkumar2@in.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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