From: Alexander Duyck Date: Thu, 7 May 2015 04:11:45 +0000 (-0700) Subject: igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation X-Git-Tag: v4.1.12-92~267^2~1^2~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8e4cf26dac1fde655d6ca4505f50ef66d224a790;p=users%2Fjedix%2Flinux-maple.git igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation Orabug: 21792102 This change updates igb so that it will correctly perform the descriptor count calculation. Previously it was taking NETDEV_FRAG_PAGE_MAX_SIZE into account with isn't really correct since a different value is used to determine the size of the pages used for TCP. That is actually determined by SKB_FRAG_PAGE_ORDER. Signed-off-by: Alexander Duyck Signed-off-by: David S. Miller (cherry picked from commit 2ee52ad4962b32797bac33fa29ec8159e64c4ee3) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index b63845dccdad4..f287186192bb6 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -4976,6 +4976,7 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, struct igb_tx_buffer *first; int tso; u32 tx_flags = 0; + unsigned short f; u16 count = TXD_USE_COUNT(skb_headlen(skb)); __be16 protocol = vlan_get_protocol(skb); u8 hdr_len = 0; @@ -4986,14 +4987,8 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, * + 1 desc for context descriptor, * otherwise try next time */ - if (NETDEV_FRAG_PAGE_MAX_SIZE > IGB_MAX_DATA_PER_TXD) { - unsigned short f; - - for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) - count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); - } else { - count += skb_shinfo(skb)->nr_frags; - } + for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) + count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); if (igb_maybe_stop_tx(tx_ring, count + 3)) { /* this is a hard error */