Commit 877749bf authored by Ian Campbell's avatar Ian Campbell Committed by David S. Miller

intel: convert to SKB paged frag API.

Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
Cc: Don Skidmore <donald.c.skidmore@intel.com>
Cc: Greg Rose <gregory.v.rose@intel.com>
Cc: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Cc: Alex Duyck <alexander.h.duyck@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
Cc: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Acked-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18324d69
...@@ -2911,9 +2911,10 @@ static int e1000_tx_map(struct e1000_adapter *adapter, ...@@ -2911,9 +2911,10 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
frag = &skb_shinfo(skb)->frags[f]; frag = &skb_shinfo(skb)->frags[f];
len = frag->size; len = frag->size;
offset = frag->page_offset; offset = 0;
while (len) { while (len) {
unsigned long bufend;
i++; i++;
if (unlikely(i == tx_ring->count)) if (unlikely(i == tx_ring->count))
i = 0; i = 0;
...@@ -2927,18 +2928,19 @@ static int e1000_tx_map(struct e1000_adapter *adapter, ...@@ -2927,18 +2928,19 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
/* Workaround for potential 82544 hang in PCI-X. /* Workaround for potential 82544 hang in PCI-X.
* Avoid terminating buffers within evenly-aligned * Avoid terminating buffers within evenly-aligned
* dwords. */ * dwords. */
bufend = (unsigned long)
page_to_phys(skb_frag_page(frag));
bufend += offset + size - 1;
if (unlikely(adapter->pcix_82544 && if (unlikely(adapter->pcix_82544 &&
!((unsigned long)(page_to_phys(frag->page) + offset !(bufend & 4) &&
+ size - 1) & 4) &&
size > 4)) size > 4))
size -= 4; size -= 4;
buffer_info->length = size; buffer_info->length = size;
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->mapped_as_page = true; buffer_info->mapped_as_page = true;
buffer_info->dma = dma_map_page(&pdev->dev, frag->page, buffer_info->dma = skb_frag_dma_map(&pdev->dev, frag,
offset, size, offset, size, DMA_TO_DEVICE);
DMA_TO_DEVICE);
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) if (dma_mapping_error(&pdev->dev, buffer_info->dma))
goto dma_error; goto dma_error;
buffer_info->next_to_watch = i; buffer_info->next_to_watch = i;
......
...@@ -4677,7 +4677,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter, ...@@ -4677,7 +4677,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
frag = &skb_shinfo(skb)->frags[f]; frag = &skb_shinfo(skb)->frags[f];
len = frag->size; len = frag->size;
offset = frag->page_offset; offset = 0;
while (len) { while (len) {
i++; i++;
...@@ -4690,9 +4690,8 @@ static int e1000_tx_map(struct e1000_adapter *adapter, ...@@ -4690,9 +4690,8 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
buffer_info->length = size; buffer_info->length = size;
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i; buffer_info->next_to_watch = i;
buffer_info->dma = dma_map_page(&pdev->dev, frag->page, buffer_info->dma = skb_frag_dma_map(&pdev->dev, frag,
offset, size, offset, size, DMA_TO_DEVICE);
DMA_TO_DEVICE);
buffer_info->mapped_as_page = true; buffer_info->mapped_as_page = true;
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) if (dma_mapping_error(&pdev->dev, buffer_info->dma))
goto dma_error; goto dma_error;
......
...@@ -4174,10 +4174,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb, ...@@ -4174,10 +4174,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i; buffer_info->next_to_watch = i;
buffer_info->mapped_as_page = true; buffer_info->mapped_as_page = true;
buffer_info->dma = dma_map_page(dev, buffer_info->dma = skb_frag_dma_map(dev, frag, 0, len,
frag->page,
frag->page_offset,
len,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(dev, buffer_info->dma)) if (dma_mapping_error(dev, buffer_info->dma))
goto dma_error; goto dma_error;
......
...@@ -2061,10 +2061,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter, ...@@ -2061,10 +2061,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter,
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->next_to_watch = i; buffer_info->next_to_watch = i;
buffer_info->mapped_as_page = true; buffer_info->mapped_as_page = true;
buffer_info->dma = dma_map_page(&pdev->dev, buffer_info->dma = skb_frag_dma_map(&pdev->dev, frag, 0, len,
frag->page,
frag->page_offset,
len,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) if (dma_mapping_error(&pdev->dev, buffer_info->dma))
goto dma_error; goto dma_error;
......
...@@ -1341,7 +1341,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb, ...@@ -1341,7 +1341,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
frag = &skb_shinfo(skb)->frags[f]; frag = &skb_shinfo(skb)->frags[f];
len = frag->size; len = frag->size;
offset = frag->page_offset; offset = 0;
while (len) { while (len) {
i++; i++;
...@@ -1361,8 +1361,8 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb, ...@@ -1361,8 +1361,8 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
buffer_info->time_stamp = jiffies; buffer_info->time_stamp = jiffies;
buffer_info->mapped_as_page = true; buffer_info->mapped_as_page = true;
buffer_info->dma = buffer_info->dma =
dma_map_page(&pdev->dev, frag->page, skb_frag_dma_map(&pdev->dev, frag, offset, size,
offset, size, DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) if (dma_mapping_error(&pdev->dev, buffer_info->dma))
goto dma_error; goto dma_error;
buffer_info->next_to_watch = 0; buffer_info->next_to_watch = 0;
......
...@@ -6494,8 +6494,7 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring, ...@@ -6494,8 +6494,7 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
offset = 0; offset = 0;
tx_flags |= IXGBE_TX_FLAGS_MAPPED_AS_PAGE; tx_flags |= IXGBE_TX_FLAGS_MAPPED_AS_PAGE;
dma = dma_map_page(dev, frag->page, frag->page_offset, dma = skb_frag_dma_map(dev, frag, 0, size, DMA_TO_DEVICE);
size, DMA_TO_DEVICE);
if (dma_mapping_error(dev, dma)) if (dma_mapping_error(dev, dma))
goto dma_error; goto dma_error;
......
...@@ -2918,18 +2918,16 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter, ...@@ -2918,18 +2918,16 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter,
frag = &skb_shinfo(skb)->frags[f]; frag = &skb_shinfo(skb)->frags[f];
len = min((unsigned int)frag->size, total); len = min((unsigned int)frag->size, total);
offset = frag->page_offset; offset = 0;
while (len) { while (len) {
tx_buffer_info = &tx_ring->tx_buffer_info[i]; tx_buffer_info = &tx_ring->tx_buffer_info[i];
size = min(len, (unsigned int)IXGBE_MAX_DATA_PER_TXD); size = min(len, (unsigned int)IXGBE_MAX_DATA_PER_TXD);
tx_buffer_info->length = size; tx_buffer_info->length = size;
tx_buffer_info->dma = dma_map_page(&adapter->pdev->dev, tx_buffer_info->dma =
frag->page, skb_frag_dma_map(&adapter->pdev->dev, frag,
offset, offset, size, DMA_TO_DEVICE);
size,
DMA_TO_DEVICE);
tx_buffer_info->mapped_as_page = true; tx_buffer_info->mapped_as_page = true;
if (dma_mapping_error(&pdev->dev, tx_buffer_info->dma)) if (dma_mapping_error(&pdev->dev, tx_buffer_info->dma))
goto dma_error; goto dma_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment