netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Solarflare linux maintainers <linux-net-drivers@solarflare.com>,
	Steve Hodgson <shodgson@solarflare.com>,
	Ben Hutchings <bhutchings@solarflare.com>
Subject: [PATCH 02/14] sfc: convert to SKB paged frag API.
Date: Thu, 22 Sep 2011 08:53:16 +0100	[thread overview]
Message-ID: <1316678008-16842-2-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1316677996.23371.10.camel@zakaz.uk.xensource.com>

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
---
 drivers/net/ethernet/sfc/rx.c |    2 +-
 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 62e4364..91a6b71 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,
 		if (efx->net_dev->features & NETIF_F_RXHASH)
 			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 =
 			efx_rx_buf_offset(efx, rx_buf);
 		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 84eb99e..f2467a1 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)
 	struct pci_dev *pci_dev = efx->pci_dev;
 	struct efx_tx_buffer *buffer;
 	skb_frag_t *fragment;
-	struct page *page;
-	int page_offset;
 	unsigned int len, unmap_len = 0, fill_level, insert_ptr;
 	dma_addr_t dma_addr, unmap_addr = 0;
 	unsigned int dma_len;
@@ -241,13 +239,11 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
 			break;
 		fragment = &skb_shinfo(skb)->frags[i];
 		len = fragment->size;
-		page = fragment->page;
-		page_offset = fragment->page_offset;
 		i++;
 		/* Map for DMA */
 		unmap_single = false;
-		dma_addr = pci_map_page(pci_dev, page, page_offset, len,
-					PCI_DMA_TODEVICE);
+		dma_addr = skb_frag_dma_map(&pci_dev->dev, fragment, 0, len,
+					    PCI_DMA_TODEVICE);
 	}
 
 	/* 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)
 static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx,
 			    skb_frag_t *frag)
 {
-	st->unmap_addr = pci_map_page(efx->pci_dev, frag->page,
-				      frag->page_offset, frag->size,
-				      PCI_DMA_TODEVICE);
+	st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0,
+					  frag->size, PCI_DMA_TODEVICE);
 	if (likely(!pci_dma_mapping_error(efx->pci_dev, st->unmap_addr))) {
 		st->unmap_single = false;
 		st->unmap_len = frag->size;
-- 
1.7.2.5

  parent reply	other threads:[~2011-09-22  7:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22  7:53 [PATCH 0/14] skb fragment API: convert network drivers (part III) Ian Campbell
2011-09-22  7:53 ` [PATCH 01/14] s2io: convert to SKB paged frag API Ian Campbell
2011-09-22  7:53 ` Ian Campbell [this message]
2011-09-22  7:53 ` [PATCH 03/14] skge: " Ian Campbell
2011-09-22  7:53 ` [PATCH 04/14] sky2: " Ian Campbell
2011-09-22  7:53 ` [PATCH 05/14] starfire: " Ian Campbell
2011-09-22  7:53 ` [PATCH 06/14] stmmac: " Ian Campbell
2011-09-22  7:53 ` [PATCH 07/14] sungem: " Ian Campbell
2011-09-22  7:53 ` [PATCH 08/14] sunhme: " Ian Campbell
2011-09-22  7:53 ` [PATCH 09/14] tehuti: " Ian Campbell
2011-09-22  8:08   ` [PATCH] MAINTAINERS: tehuti: Alexander Indenbaum's address bounces Ian Campbell
2011-09-29  4:32     ` David Miller
2011-09-22  7:53 ` [PATCH 10/14] tsi108: convert to SKB paged frag API Ian Campbell
2011-09-22  7:53 ` [PATCH 11/14] typhoon: " Ian Campbell
2011-09-22  7:53 ` [PATCH 12/14] via-velocity: " Ian Campbell
2011-09-22  7:53 ` [PATCH 13/14] virtionet: " Ian Campbell
2011-09-22  7:53 ` [PATCH 14/14] vmxnet3: " Ian Campbell
2011-09-22 16:30   ` [Pv-drivers] " Bhavesh Davda
2011-09-22 16:46     ` Ian Campbell
2011-09-22 16:49       ` Bhavesh Davda
2011-09-22 20:05 ` [PATCH 0/14] skb fragment API: convert network drivers (part III) David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316678008-16842-2-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=bhutchings@solarflare.com \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=shodgson@solarflare.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).