]> git.baikalelectronics.ru Git - kernel.git/commit
[TCP]: Simplify SKB data portion allocation with NETIF_F_SG.
authorDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2005 22:17:25 +0000 (15:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2005 22:17:25 +0000 (15:17 -0700)
commit7187a1506121841f26a26e24ea78599e1b6b03e3
tree160f85e7d9ec1df2432b4dd3fae315812558bd10
parent44fd239799e9525e9f96efecec6f6d371c9ccb4a
[TCP]: Simplify SKB data portion allocation with NETIF_F_SG.

The ideal and most optimal layout for an SKB when doing
scatter-gather is to put all the headers at skb->data, and
all the user data in the page array.

This makes SKB splitting and combining extremely simple,
especially before a packet goes onto the wire the first
time.

So, when sk_stream_alloc_pskb() is given a zero size, make
sure there is no skb_tailroom().  This is achieved by applying
SKB_DATA_ALIGN() to the header length used here.

Next, make select_size() in TCP output segmentation use a
length of zero when NETIF_F_SG is true on the outgoing
interface.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/ipv4/tcp.c