Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   be2net: dont pull too much data in skb linear part (http://www.linux-archive.org/ubuntu-kernel-team/695756-be2net-dont-pull-too-much-data-skb-linear-part.html)

"Jesse Sung" 08-20-2012 03:54 AM

be2net: dont pull too much data in skb linear part
 
From: Eric Dumazet <edumazet@google.com>

BugLink: https://launchpad.net/bugs/1035348

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>
(cherry picked from commit ac1ae5f33fd225f46da0072e2091962410a0431b)
Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 6 +++---
1 file 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 cb4029d..b14c530 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1136,16 +1136,16 @@ static void skb_fill_rx_data(struct be_adapter *adapter, struct be_rx_obj *rxo,
/* 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 =
--
1.7.9.5


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team


All times are GMT. The time now is 06:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.