net/mlx4_en: Use __skb_fill_page_desc()
authorEric Dumazet <edumazet@google.com>
Thu, 23 Feb 2017 10:02:45 +0000 (12:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Feb 2017 15:57:57 +0000 (10:57 -0500)
Or we might miss the fact that a page was allocated from memory reserves.

Fixes: dceeab0e5258 ("mlx4: support __GFP_MEMALLOC for rx")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_rx.c

index d85e6446f9d99e38c75b97d7fba29bd057e0a16f..867292880c07a15124a0cf099d1fcda09926548e 100644 (file)
@@ -604,10 +604,10 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
                dma_sync_single_for_cpu(priv->ddev, dma, frag_info->frag_size,
                                        DMA_FROM_DEVICE);
 
-               /* Save page reference in skb */
-               __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page);
-               skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size);
-               skb_frags_rx[nr].page_offset = frags[nr].page_offset;
+               __skb_fill_page_desc(skb, nr, frags[nr].page,
+                                    frags[nr].page_offset,
+                                    frag_info->frag_size);
+
                skb->truesize += frag_info->frag_stride;
                frags[nr].page = NULL;
        }