aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igbvf/netdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/igbvf/netdev.c')
-rw-r--r--drivers/net/igbvf/netdev.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 0dbd0320023a..2aa71a766c35 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -1963,7 +1963,7 @@ static int igbvf_tso(struct igbvf_adapter *adapter,
1963 iph->daddr, 0, 1963 iph->daddr, 0,
1964 IPPROTO_TCP, 1964 IPPROTO_TCP,
1965 0); 1965 0);
1966 } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) { 1966 } else if (skb_is_gso_v6(skb)) {
1967 ipv6_hdr(skb)->payload_len = 0; 1967 ipv6_hdr(skb)->payload_len = 0;
1968 tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, 1968 tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
1969 &ipv6_hdr(skb)->daddr, 1969 &ipv6_hdr(skb)->daddr,
@@ -2117,6 +2117,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
2117 /* set time_stamp *before* dma to help avoid a possible race */ 2117 /* set time_stamp *before* dma to help avoid a possible race */
2118 buffer_info->time_stamp = jiffies; 2118 buffer_info->time_stamp = jiffies;
2119 buffer_info->next_to_watch = i; 2119 buffer_info->next_to_watch = i;
2120 buffer_info->mapped_as_page = false;
2120 buffer_info->dma = pci_map_single(pdev, skb->data, len, 2121 buffer_info->dma = pci_map_single(pdev, skb->data, len,
2121 PCI_DMA_TODEVICE); 2122 PCI_DMA_TODEVICE);
2122 if (pci_dma_mapping_error(pdev, buffer_info->dma)) 2123 if (pci_dma_mapping_error(pdev, buffer_info->dma))
@@ -2126,6 +2127,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
2126 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) { 2127 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
2127 struct skb_frag_struct *frag; 2128 struct skb_frag_struct *frag;
2128 2129
2130 count++;
2129 i++; 2131 i++;
2130 if (i == tx_ring->count) 2132 if (i == tx_ring->count)
2131 i = 0; 2133 i = 0;
@@ -2146,7 +2148,6 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
2146 PCI_DMA_TODEVICE); 2148 PCI_DMA_TODEVICE);
2147 if (pci_dma_mapping_error(pdev, buffer_info->dma)) 2149 if (pci_dma_mapping_error(pdev, buffer_info->dma))
2148 goto dma_error; 2150 goto dma_error;
2149 count++;
2150 } 2151 }
2151 2152
2152 tx_ring->buffer_info[i].skb = skb; 2153 tx_ring->buffer_info[i].skb = skb;
@@ -2163,14 +2164,14 @@ dma_error:
2163 buffer_info->length = 0; 2164 buffer_info->length = 0;
2164 buffer_info->next_to_watch = 0; 2165 buffer_info->next_to_watch = 0;
2165 buffer_info->mapped_as_page = false; 2166 buffer_info->mapped_as_page = false;
2166 count--; 2167 if (count)
2168 count--;
2167 2169
2168 /* clear timestamp and dma mappings for remaining portion of packet */ 2170 /* clear timestamp and dma mappings for remaining portion of packet */
2169 while (count >= 0) { 2171 while (count--) {
2170 count--; 2172 if (i==0)
2171 i--;
2172 if (i < 0)
2173 i += tx_ring->count; 2173 i += tx_ring->count;
2174 i--;
2174 buffer_info = &tx_ring->buffer_info[i]; 2175 buffer_info = &tx_ring->buffer_info[i];
2175 igbvf_put_txbuf(adapter, buffer_info); 2176 igbvf_put_txbuf(adapter, buffer_info);
2176 } 2177 }