All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Tariq Toukan <tariqt@mellanox.com>,
	Martin KaFai Lau <kafai@fb.com>,
	Willem de Bruijn <willemb@google.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Brenden Blanco <bblanco@plumgrid.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net-next 1/9] mlx4: use __skb_fill_page_desc()
Date: Mon,  6 Feb 2017 19:02:32 -0800	[thread overview]
Message-ID: <20170207030240.31357-2-edumazet@google.com> (raw)
In-Reply-To: <20170207030240.31357-1-edumazet@google.com>

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>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index f15ddba3659aac38471059c6bcbf05071794..03f1713c94c7fa57e9eaaf87fe38a0a6d372 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -601,10 +601,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;
 	}
-- 
2.11.0.483.g087da7b7c-goog

  reply	other threads:[~2017-02-07  3:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  3:02 [PATCH net-next 0/9] mlx4: order-0 allocations and page recycling Eric Dumazet
2017-02-07  3:02 ` Eric Dumazet [this message]
2017-02-07  3:02 ` [PATCH net-next 2/9] mlx4: dma_dir is a mlx4_en_priv attribute Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 3/9] mlx4: remove order field from mlx4_en_frag_info Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 4/9] mlx4: get rid of frag_prefix_size Eric Dumazet
2017-02-09 12:28   ` Tariq Toukan
2017-02-09 14:06     ` Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 5/9] mlx4: rx_headroom is a per port attribute Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 6/9] mlx4: reduce rx ring page_cache size Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 7/9] mlx4: removal of frag_sizes[] Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 8/9] mlx4: use order-0 pages for RX Eric Dumazet
2017-02-07  3:02 ` [PATCH net-next 9/9] mlx4: add page recycling in receive path Eric Dumazet
2017-02-07 16:20   ` Tariq Toukan
2017-02-07 16:34     ` Eric Dumazet
2017-02-08 10:27       ` Tariq Toukan
2017-02-07 15:50 ` [PATCH net-next 0/9] mlx4: order-0 allocations and page recycling Tariq Toukan
2017-02-07 16:06   ` Eric Dumazet
2017-02-07 16:26     ` Eric Dumazet
2017-02-07 16:28       ` Eric Dumazet
2017-02-07 19:05       ` Alexei Starovoitov
2017-02-07 19:18         ` Eric Dumazet
2017-02-08  9:02   ` Tariq Toukan
2017-02-08 10:29     ` Tariq Toukan
2017-02-08 15:52     ` Eric Dumazet
2017-02-09 12:00       ` Tariq Toukan
2017-02-09 13:31         ` Eric Dumazet

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=20170207030240.31357-2-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=ast@kernel.org \
    --cc=bblanco@plumgrid.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.com \
    --cc=willemb@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.