Commit 4a22c4c9 authored by Ian Campbell's avatar Ian Campbell Committed by David S. Miller

sfc: convert to SKB paged frag API.

Signed-off-by: default avatarIan 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: default avatarDavid S. Miller <davem@davemloft.net>
parent f0d06d82
...@@ -478,7 +478,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel, ...@@ -478,7 +478,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel,
if (efx->net_dev->features & NETIF_F_RXHASH) if (efx->net_dev->features & NETIF_F_RXHASH)
skb->rxhash = efx_rx_buf_hash(eh); skb->rxhash = efx_rx_buf_hash(eh);
skb_shinfo(skb)->frags[0].page = page; skb_frag_set_page(skb, 0, page);
skb_shinfo(skb)->frags[0].page_offset = skb_shinfo(skb)->frags[0].page_offset =
efx_rx_buf_offset(efx, rx_buf); efx_rx_buf_offset(efx, rx_buf);
skb_shinfo(skb)->frags[0].size = rx_buf->len; skb_shinfo(skb)->frags[0].size = rx_buf->len;
......
...@@ -137,8 +137,6 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) ...@@ -137,8 +137,6 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
struct pci_dev *pci_dev = efx->pci_dev; struct pci_dev *pci_dev = efx->pci_dev;
struct efx_tx_buffer *buffer; struct efx_tx_buffer *buffer;
skb_frag_t *fragment; skb_frag_t *fragment;
struct page *page;
int page_offset;
unsigned int len, unmap_len = 0, fill_level, insert_ptr; unsigned int len, unmap_len = 0, fill_level, insert_ptr;
dma_addr_t dma_addr, unmap_addr = 0; dma_addr_t dma_addr, unmap_addr = 0;
unsigned int dma_len; unsigned int dma_len;
...@@ -241,12 +239,10 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) ...@@ -241,12 +239,10 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
break; break;
fragment = &skb_shinfo(skb)->frags[i]; fragment = &skb_shinfo(skb)->frags[i];
len = fragment->size; len = fragment->size;
page = fragment->page;
page_offset = fragment->page_offset;
i++; i++;
/* Map for DMA */ /* Map for DMA */
unmap_single = false; unmap_single = false;
dma_addr = pci_map_page(pci_dev, page, page_offset, len, dma_addr = skb_frag_dma_map(&pci_dev->dev, fragment, 0, len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
} }
...@@ -929,9 +925,8 @@ static void tso_start(struct tso_state *st, const struct sk_buff *skb) ...@@ -929,9 +925,8 @@ static void tso_start(struct tso_state *st, const struct sk_buff *skb)
static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx, static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx,
skb_frag_t *frag) skb_frag_t *frag)
{ {
st->unmap_addr = pci_map_page(efx->pci_dev, frag->page, st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0,
frag->page_offset, frag->size, frag->size, PCI_DMA_TODEVICE);
PCI_DMA_TODEVICE);
if (likely(!pci_dma_mapping_error(efx->pci_dev, st->unmap_addr))) { if (likely(!pci_dma_mapping_error(efx->pci_dev, st->unmap_addr))) {
st->unmap_single = false; st->unmap_single = false;
st->unmap_len = frag->size; st->unmap_len = frag->size;
......
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