* [RFC] Question about tcp_sendmsg()
@ 2010-07-15 13:14 Eric Dumazet
2010-07-16 2:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-07-15 13:14 UTC (permalink / raw)
To: David Miller, Ilpo Järvinen, Krishna Kumar; +Cc: netdev
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;
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC] Question about tcp_sendmsg()
2010-07-15 13:14 [RFC] Question about tcp_sendmsg() Eric Dumazet
@ 2010-07-16 2:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-07-16 2:15 UTC (permalink / raw)
To: eric.dumazet; +Cc: ilpo.jarvinen, krkumar2, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 15 Jul 2010 15:14:48 +0200
> 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)
The consequence of this happening would be that we would linearize the
SKB in the device layer transmit path.
Therefore, to me it seems harmless. And since such SG capability
changes are so rare, caching the value in this function as we do now
seems reasonable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-16 2:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-15 13:14 [RFC] Question about tcp_sendmsg() Eric Dumazet
2010-07-16 2:15 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).