diff options
author | Ian Campbell <Ian.Campbell@citrix.com> | 2011-10-19 23:01:45 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-21 02:52:52 -0400 |
commit | 311761c8a553adaa3ad7482b1fdde1ce9042d3e2 (patch) | |
tree | 6b8d42d30f6ed77da03d57c3f2f35ac43e40a08d /drivers/net/ethernet/mellanox/mlx4/en_tx.c | |
parent | 6cc7a765c2987f03ba278dac03c7cc759ee198e7 (diff) | |
download | lwn-311761c8a553adaa3ad7482b1fdde1ce9042d3e2.tar.gz lwn-311761c8a553adaa3ad7482b1fdde1ce9042d3e2.zip |
mlx4: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_tx.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_tx.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 75dda26189fd..75338eb88e88 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c @@ -460,26 +460,13 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind) } } -static void *get_frag_ptr(struct sk_buff *skb) -{ - struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0]; - struct page *page = frag->page; - void *ptr; - - ptr = page_address(page); - if (unlikely(!ptr)) - return NULL; - - return ptr + frag->page_offset; -} - static int is_inline(struct sk_buff *skb, void **pfrag) { void *ptr; if (inline_thold && !skb_is_gso(skb) && skb->len <= inline_thold) { if (skb_shinfo(skb)->nr_frags == 1) { - ptr = get_frag_ptr(skb); + ptr = skb_frag_address_safe(&skb_shinfo(skb)->frags[0]); if (unlikely(!ptr)) return 0; @@ -756,8 +743,9 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) /* Map fragments */ for (i = skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) { frag = &skb_shinfo(skb)->frags[i]; - dma = pci_map_page(mdev->dev->pdev, frag->page, frag->page_offset, - skb_frag_size(frag), PCI_DMA_TODEVICE); + dma = skb_frag_dma_map(&mdev->dev->pdev->dev, frag, + 0, skb_frag_size(frag), + DMA_TO_DEVICE); data->addr = cpu_to_be64(dma); data->lkey = cpu_to_be32(mdev->mr.key); wmb(); |