diff options
author | Eric Dumazet <edumazet@google.com> | 2012-07-12 23:19:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-17 02:02:36 -0400 |
commit | ac1ae5f33fd225f46da0072e2091962410a0431b (patch) | |
tree | 32fac87b2a1167346138797cb40a9a9cccbe7e26 /drivers/net/ethernet/emulex | |
parent | d2ee62e9b587b303e2ac430cfa7711be4da698f7 (diff) |
be2net: dont pull too much data in skb linear part
skb_fill_rx_data() pulls 64 byte of data in skb->data
Its too much for TCP (with no options) on IPv4, as total size of headers
is 14 + 40 = 54
This means tcp stack and splice() are suboptimal, since tcp payload
is in part in tcp->data, and in part in skb frag.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 7e989d06523f..f18375cd75ee 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1228,16 +1228,16 @@ static void skb_fill_rx_data(struct be_rx_obj *rxo, struct sk_buff *skb, | |||
1228 | /* Copy data in the first descriptor of this completion */ | 1228 | /* Copy data in the first descriptor of this completion */ |
1229 | curr_frag_len = min(rxcp->pkt_size, rx_frag_size); | 1229 | curr_frag_len = min(rxcp->pkt_size, rx_frag_size); |
1230 | 1230 | ||
1231 | /* Copy the header portion into skb_data */ | ||
1232 | hdr_len = min(BE_HDR_LEN, curr_frag_len); | ||
1233 | memcpy(skb->data, start, hdr_len); | ||
1234 | skb->len = curr_frag_len; | 1231 | skb->len = curr_frag_len; |
1235 | if (curr_frag_len <= BE_HDR_LEN) { /* tiny packet */ | 1232 | if (curr_frag_len <= BE_HDR_LEN) { /* tiny packet */ |
1233 | memcpy(skb->data, start, curr_frag_len); | ||
1236 | /* Complete packet has now been moved to data */ | 1234 | /* Complete packet has now been moved to data */ |
1237 | put_page(page_info->page); | 1235 | put_page(page_info->page); |
1238 | skb->data_len = 0; | 1236 | skb->data_len = 0; |
1239 | skb->tail += curr_frag_len; | 1237 | skb->tail += curr_frag_len; |
1240 | } else { | 1238 | } else { |
1239 | hdr_len = ETH_HLEN; | ||
1240 | memcpy(skb->data, start, hdr_len); | ||
1241 | skb_shinfo(skb)->nr_frags = 1; | 1241 | skb_shinfo(skb)->nr_frags = 1; |
1242 | skb_frag_set_page(skb, 0, page_info->page); | 1242 | skb_frag_set_page(skb, 0, page_info->page); |
1243 | skb_shinfo(skb)->frags[0].page_offset = | 1243 | skb_shinfo(skb)->frags[0].page_offset = |