diff options
author | Jakub Mielczarek <jakub.mielczarek@symphonyteleca.com> | 2015-09-03 10:32:39 +0200 |
---|---|---|
committer | Marcin Miklas <marcin.miklas@symphonyteleca.com> | 2015-09-03 11:35:18 +0200 |
commit | 4cf1c3eb3601a1dd6a8a24ace5f6320789877352 (patch) | |
tree | 4eb2aa3052d848facbd10eb712ebc522c65148bd /kmod/igb | |
parent | c9371849f159c665064101820d745655690d09e6 (diff) | |
download | Open-AVB-4cf1c3eb3601a1dd6a8a24ace5f6320789877352.tar.gz |
Fixes: #276 - Problems with receiving ethernet frames longer than 256 bytes.
Details: Function igb_add_rx_frag taken from before commit:
AVNu/Open-AVB/2fdb56a391e9e09ff22837e56d594507fbaf9250
Diffstat (limited to 'kmod/igb')
-rw-r--r-- | kmod/igb/igb_main.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/kmod/igb/igb_main.c b/kmod/igb/igb_main.c index 09547203..e61f156b 100644 --- a/kmod/igb/igb_main.c +++ b/kmod/igb/igb_main.c @@ -7364,27 +7364,24 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring, struct sk_buff *skb) { struct page *page = rx_buffer->page; - unsigned char *va = page_address(page) + rx_buffer->page_offset; unsigned int size = le16_to_cpu(rx_desc->wb.upper.length); #if (PAGE_SIZE < 8192) unsigned int truesize = IGB_RX_BUFSZ; #else - unsigned int truesize = SKB_DATA_ALIGN(size); + unsigned int truesize = ALIGN(size, L1_CACHE_BYTES); #endif - unsigned int pull_len; - if (unlikely(skb_is_nonlinear(skb))) - goto add_tail_frag; + if ((size <= IGB_RX_HDR_LEN) && !skb_is_nonlinear(skb)) { + unsigned char *va = page_address(page) + rx_buffer->page_offset; #ifdef HAVE_PTP_1588_CLOCK - if (unlikely(igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP))) { - igb_ptp_rx_pktstamp(rx_ring->q_vector, va, skb); - va += IGB_TS_HDR_LEN; - size -= IGB_TS_HDR_LEN; - } + if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) { + igb_ptp_rx_pktstamp(rx_ring->q_vector, va, skb); + va += IGB_TS_HDR_LEN; + size -= IGB_TS_HDR_LEN; + } #endif /* HAVE_PTP_1588_CLOCK */ - if (likely(size <= IGB_RX_HDR_LEN)) { memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long))); /* we can reuse buffer as-is, just make sure it is local */ @@ -7396,21 +7393,8 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring, return false; } - /* we need the header to contain the greater of either ETH_HLEN or - * 60 bytes if the skb->len is less than 60 for skb_pad. - */ - pull_len = eth_get_headlen(va, IGB_RX_HDR_LEN); - - /* align pull length to size of long to optimize memcpy performance */ - memcpy(__skb_put(skb, pull_len), va, ALIGN(pull_len, sizeof(long))); - - /* update all of the pointers */ - va += pull_len; - size -= pull_len; - -add_tail_frag: skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, - (unsigned long)va & ~PAGE_MASK, size, truesize); + rx_buffer->page_offset, size, truesize); return igb_can_reuse_rx_page(rx_buffer, page, truesize); } |