Skip to content

Commit

Permalink
greth: convert to SKB paged frag API.
Browse files Browse the repository at this point in the history
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@citrix.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ian Campbell authored and David S. Miller committed Aug 30, 2011
1 parent 2234a72 commit ab7e11d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/net/ethernet/aeroflex/greth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ab7e11d

Please sign in to comment.