Skip to content

Commit

Permalink
be2net: dont pull too much data in skb linear part
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Padmanabh Ratnakar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jul 17, 2012
1 parent d2ee62e commit ac1ae5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,16 +1228,16 @@ static void skb_fill_rx_data(struct be_rx_obj *rxo, struct sk_buff *skb,
/* Copy data in the first descriptor of this completion */
curr_frag_len = min(rxcp->pkt_size, rx_frag_size);

/* Copy the header portion into skb_data */
hdr_len = min(BE_HDR_LEN, curr_frag_len);
memcpy(skb->data, start, hdr_len);
skb->len = curr_frag_len;
if (curr_frag_len <= BE_HDR_LEN) { /* tiny packet */
memcpy(skb->data, start, curr_frag_len);
/* Complete packet has now been moved to data */
put_page(page_info->page);
skb->data_len = 0;
skb->tail += curr_frag_len;
} else {
hdr_len = ETH_HLEN;
memcpy(skb->data, start, hdr_len);
skb_shinfo(skb)->nr_frags = 1;
skb_frag_set_page(skb, 0, page_info->page);
skb_shinfo(skb)->frags[0].page_offset =
Expand Down

0 comments on commit ac1ae5f

Please sign in to comment.