diff options
author | Alexander Duyck <alexander.h.duyck@redhat.com> | 2015-05-07 00:11:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-12 10:39:26 -0400 |
commit | 2ee52ad4962b32797bac33fa29ec8159e64c4ee3 (patch) | |
tree | da72a00a2bbd4f8bfe0dcb3fc4dfedb9b93bc80d | |
parent | 9451980a6646ed487efce04a9df28f450935683e (diff) |
igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation
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 <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_main.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index e63664649029..8a45ed7506c5 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -4974,6 +4974,7 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, | |||
4974 | struct igb_tx_buffer *first; | 4974 | struct igb_tx_buffer *first; |
4975 | int tso; | 4975 | int tso; |
4976 | u32 tx_flags = 0; | 4976 | u32 tx_flags = 0; |
4977 | unsigned short f; | ||
4977 | u16 count = TXD_USE_COUNT(skb_headlen(skb)); | 4978 | u16 count = TXD_USE_COUNT(skb_headlen(skb)); |
4978 | __be16 protocol = vlan_get_protocol(skb); | 4979 | __be16 protocol = vlan_get_protocol(skb); |
4979 | u8 hdr_len = 0; | 4980 | u8 hdr_len = 0; |
@@ -4984,14 +4985,8 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, | |||
4984 | * + 1 desc for context descriptor, | 4985 | * + 1 desc for context descriptor, |
4985 | * otherwise try next time | 4986 | * otherwise try next time |
4986 | */ | 4987 | */ |
4987 | if (NETDEV_FRAG_PAGE_MAX_SIZE > IGB_MAX_DATA_PER_TXD) { | 4988 | for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) |
4988 | unsigned short f; | 4989 | count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); |
4989 | |||
4990 | for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) | ||
4991 | count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); | ||
4992 | } else { | ||
4993 | count += skb_shinfo(skb)->nr_frags; | ||
4994 | } | ||
4995 | 4990 | ||
4996 | if (igb_maybe_stop_tx(tx_ring, count + 3)) { | 4991 | if (igb_maybe_stop_tx(tx_ring, count + 3)) { |
4997 | /* this is a hard error */ | 4992 | /* this is a hard error */ |