From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
Stephen Hemminger <shemminger@linux-foundation.org>
Subject: [PATCH 04/14] sky2: convert to SKB paged frag API.
Date: Thu, 22 Sep 2011 08:53:18 +0100 [thread overview]
Message-ID: <1316678008-16842-4-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: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: netdev@vger.kernel.org
---
drivers/net/ethernet/marvell/sky2.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 3ff0a12..ef2dc02 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -1226,10 +1226,9 @@ static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re,
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- re->frag_addr[i] = pci_map_page(pdev, frag->page,
- frag->page_offset,
- frag->size,
- PCI_DMA_FROMDEVICE);
+ re->frag_addr[i] = skb_frag_dma_map(&pdev->dev, frag, 0,
+ frag->size,
+ PCI_DMA_FROMDEVICE);
if (pci_dma_mapping_error(pdev, re->frag_addr[i]))
goto map_page_error;
@@ -1910,8 +1909,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset,
- frag->size, PCI_DMA_TODEVICE);
+ mapping = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
+ frag->size, PCI_DMA_TODEVICE);
if (pci_dma_mapping_error(hw->pdev, mapping))
goto mapping_unwind;
@@ -2449,7 +2448,7 @@ static void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space,
if (length == 0) {
/* don't need this page */
- __free_page(frag->page);
+ __skb_frag_unref(frag);
--skb_shinfo(skb)->nr_frags;
} else {
size = min(length, (unsigned) PAGE_SIZE);
--
1.7.2.5
next prev 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 ` [PATCH 02/14] sfc: " Ian Campbell
2011-09-22 7:53 ` [PATCH 03/14] skge: " Ian Campbell
2011-09-22 7:53 ` Ian Campbell [this message]
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-4-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
/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).