diff options
author | Ian Campbell <Ian.Campbell@citrix.com> | 2011-09-21 17:53:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-22 16:04:15 -0400 |
commit | 4a22c4c919c201c2a7f4ee09e672435a3072d875 (patch) | |
tree | 173bda72ec4fc72bbc26e81739125a349db06d1b /drivers/net/ethernet/sfc | |
parent | f0d06d82f7ab821554f8761aaa47c3ad592cc441 (diff) |
sfc: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Steve Hodgson <shodgson@solarflare.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r-- | drivers/net/ethernet/sfc/rx.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/tx.c | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 62e43649466e..91a6b7123539 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
@@ -478,7 +478,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel, | |||
478 | if (efx->net_dev->features & NETIF_F_RXHASH) | 478 | if (efx->net_dev->features & NETIF_F_RXHASH) |
479 | skb->rxhash = efx_rx_buf_hash(eh); | 479 | skb->rxhash = efx_rx_buf_hash(eh); |
480 | 480 | ||
481 | skb_shinfo(skb)->frags[0].page = page; | 481 | skb_frag_set_page(skb, 0, page); |
482 | skb_shinfo(skb)->frags[0].page_offset = | 482 | skb_shinfo(skb)->frags[0].page_offset = |
483 | efx_rx_buf_offset(efx, rx_buf); | 483 | efx_rx_buf_offset(efx, rx_buf); |
484 | skb_shinfo(skb)->frags[0].size = rx_buf->len; | 484 | skb_shinfo(skb)->frags[0].size = rx_buf->len; |
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index 84eb99e0f8d2..f2467a1b51bd 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c | |||
@@ -137,8 +137,6 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) | |||
137 | struct pci_dev *pci_dev = efx->pci_dev; | 137 | struct pci_dev *pci_dev = efx->pci_dev; |
138 | struct efx_tx_buffer *buffer; | 138 | struct efx_tx_buffer *buffer; |
139 | skb_frag_t *fragment; | 139 | skb_frag_t *fragment; |
140 | struct page *page; | ||
141 | int page_offset; | ||
142 | unsigned int len, unmap_len = 0, fill_level, insert_ptr; | 140 | unsigned int len, unmap_len = 0, fill_level, insert_ptr; |
143 | dma_addr_t dma_addr, unmap_addr = 0; | 141 | dma_addr_t dma_addr, unmap_addr = 0; |
144 | unsigned int dma_len; | 142 | unsigned int dma_len; |
@@ -241,13 +239,11 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) | |||
241 | break; | 239 | break; |
242 | fragment = &skb_shinfo(skb)->frags[i]; | 240 | fragment = &skb_shinfo(skb)->frags[i]; |
243 | len = fragment->size; | 241 | len = fragment->size; |
244 | page = fragment->page; | ||
245 | page_offset = fragment->page_offset; | ||
246 | i++; | 242 | i++; |
247 | /* Map for DMA */ | 243 | /* Map for DMA */ |
248 | unmap_single = false; | 244 | unmap_single = false; |
249 | dma_addr = pci_map_page(pci_dev, page, page_offset, len, | 245 | dma_addr = skb_frag_dma_map(&pci_dev->dev, fragment, 0, len, |
250 | PCI_DMA_TODEVICE); | 246 | PCI_DMA_TODEVICE); |
251 | } | 247 | } |
252 | 248 | ||
253 | /* Transfer ownership of the skb to the final buffer */ | 249 | /* Transfer ownership of the skb to the final buffer */ |
@@ -929,9 +925,8 @@ static void tso_start(struct tso_state *st, const struct sk_buff *skb) | |||
929 | static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx, | 925 | static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx, |
930 | skb_frag_t *frag) | 926 | skb_frag_t *frag) |
931 | { | 927 | { |
932 | st->unmap_addr = pci_map_page(efx->pci_dev, frag->page, | 928 | st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0, |
933 | frag->page_offset, frag->size, | 929 | frag->size, PCI_DMA_TODEVICE); |
934 | PCI_DMA_TODEVICE); | ||
935 | if (likely(!pci_dma_mapping_error(efx->pci_dev, st->unmap_addr))) { | 930 | if (likely(!pci_dma_mapping_error(efx->pci_dev, st->unmap_addr))) { |
936 | st->unmap_single = false; | 931 | st->unmap_single = false; |
937 | st->unmap_len = frag->size; | 932 | st->unmap_len = frag->size; |