[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1313760467-8598-29-git-send-email-ian.campbell@citrix.com>
Date: Fri, 19 Aug 2011 14:27:01 +0100
From: Ian Campbell <ian.campbell@...rix.com>
To: netdev@...r.kernel.org
CC: linux-kernel@...r.kernel.org,
Ian Campbell <ian.campbell@...rix.com>,
Kristoffer Glembo <kristoffer@...sler.com>,
Grant Likely <grant.likely@...retlab.ca>,
devicetree-discuss@...ts.ozlabs.org
Subject: [PATCH 29/75] greth: convert to SKB paged frag API.
In order to avoid long lines also use phys_to_virt(page_to_phys(page)) =>
page_address(page) (since the are effectively the same thing for lowmem pages).
Also dump the frag's size instead of the headlen when dumping a frag.
Signed-off-by: Ian Campbell <ian.campbell@...rix.com>
Cc: Kristoffer Glembo <kristoffer@...sler.com>
Cc: Grant Likely <grant.likely@...retlab.ca>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: devicetree-discuss@...ts.ozlabs.org
---
drivers/net/greth.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 16ce45c..562a251 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -113,9 +113,8 @@ static void greth_print_tx_packet(struct sk_buff *skb)
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
print_hex_dump(KERN_DEBUG, "TX: ", DUMP_PREFIX_OFFSET, 16, 1,
- phys_to_virt(page_to_phys(skb_shinfo(skb)->frags[i].page)) +
- skb_shinfo(skb)->frags[i].page_offset,
- length, true);
+ skb_frag_address(&skb_shinfo(skb)->frags[i]),
+ skb_shinfo(skb)->frags[i].size, true);
}
}
@@ -528,11 +527,8 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
greth_write_bd(&bdp->stat, status);
- dma_addr = dma_map_page(greth->dev,
- frag->page,
- frag->page_offset,
- frag->size,
- DMA_TO_DEVICE);
+ dma_addr = skb_frag_dma_map(greth->dev, frag, 0, frag->size,
+ DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(greth->dev, dma_addr)))
goto frag_map_error;
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists