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>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Willem de Bruijn <willemb@google.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v4 net-next 04/13] mlx4: rx_headroom is a per port attribute
Date: Wed,  8 Mar 2017 08:17:09 -0800	[thread overview]
Message-ID: <20170308161718.2867-5-edumazet@google.com> (raw)
In-Reply-To: <20170308161718.2867-1-edumazet@google.com>

No need to duplicate it per RX queue / frags.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c   | 6 +++---
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 +-
 2 files 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 118ea83cff089f614a11f99f6623358f200638a8..bb33032a280f00ee62cc39d4261e72543ed0434e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -115,7 +115,7 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv,
 
 	for (i = 0; i < priv->num_frags; i++) {
 		frags[i] = ring_alloc[i];
-		frags[i].page_offset += priv->frag_info[i].rx_headroom;
+		frags[i].page_offset += priv->rx_headroom;
 		rx_desc->data[i].addr = cpu_to_be64(frags[i].dma +
 						    frags[i].page_offset);
 		ring_alloc[i] = page_alloc[i];
@@ -1202,7 +1202,7 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
 		 */
 		priv->frag_info[0].frag_stride = PAGE_SIZE;
 		priv->dma_dir = PCI_DMA_BIDIRECTIONAL;
-		priv->frag_info[0].rx_headroom = XDP_PACKET_HEADROOM;
+		priv->rx_headroom = XDP_PACKET_HEADROOM;
 		i = 1;
 	} else {
 		int buf_size = 0;
@@ -1214,12 +1214,12 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
 			priv->frag_info[i].frag_stride =
 				ALIGN(priv->frag_info[i].frag_size,
 				      SMP_CACHE_BYTES);
-			priv->frag_info[i].rx_headroom = 0;
 			buf_size += priv->frag_info[i].frag_size;
 			i++;
 		}
 		priv->rx_page_order = MLX4_EN_ALLOC_PREFER_ORDER;
 		priv->dma_dir = PCI_DMA_FROMDEVICE;
+		priv->rx_headroom = 0;
 	}
 
 	priv->num_frags = i;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 849aa8af4dd771cdd44fae25516980bd36ed45a8..fc7b4da5d8c376455c642d9512a8565d88db42a3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -472,7 +472,6 @@ struct mlx4_en_mc_list {
 
 struct mlx4_en_frag_info {
 	u16 frag_size;
-	u16 rx_headroom;
 	u32 frag_stride;
 };
 
@@ -585,6 +584,7 @@ struct mlx4_en_priv {
 	u8 log_rx_info;
 	u8 dma_dir;
 	u8 rx_page_order;
+	u16 rx_headroom;
 
 	struct mlx4_en_tx_ring **tx_ring[MLX4_EN_NUM_TX_TYPES];
 	struct mlx4_en_rx_ring *rx_ring[MAX_RX_RINGS];
-- 
2.12.0.246.ga2ecc84866-goog

  parent reply	other threads:[~2017-03-08 16:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 16:17 [PATCH v4 net-next 00/13] mlx4: order-0 allocations and page recycling Eric Dumazet
2017-03-08 16:17 ` [PATCH v4 net-next 01/13] mlx4: dma_dir is a mlx4_en_priv attribute Eric Dumazet
2017-03-09 13:52   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 02/13] mlx4: remove order field from mlx4_en_frag_info Eric Dumazet
2017-03-09 13:53   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 03/13] mlx4: get rid of frag_prefix_size Eric Dumazet
2017-03-09 13:53   ` Tariq Toukan
2017-03-08 16:17 ` Eric Dumazet [this message]
2017-03-09 13:54   ` [PATCH v4 net-next 04/13] mlx4: rx_headroom is a per port attribute Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 05/13] mlx4: reduce rx ring page_cache size Eric Dumazet
2017-03-09 13:54   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 06/13] mlx4: removal of frag_sizes[] Eric Dumazet
2017-03-09 13:55   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 07/13] mlx4: use order-0 pages for RX Eric Dumazet
2017-03-09 13:55   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 08/13] mlx4: add page recycling in receive path Eric Dumazet
2017-03-09 13:56   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 09/13] mlx4: add rx_alloc_pages counter in ethtool -S Eric Dumazet
2017-03-09 13:56   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 10/13] mlx4: do not access rx_desc from mlx4_en_process_rx_cq() Eric Dumazet
2017-03-09 13:56   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 11/13] mlx4: factorize page_address() calls Eric Dumazet
2017-03-09 13:57   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 12/13] mlx4: make validate_loopback() more generic Eric Dumazet
2017-03-09 13:57   ` Tariq Toukan
2017-03-08 16:17 ` [PATCH v4 net-next 13/13] mlx4: remove duplicate code in mlx4_en_process_rx_cq() Eric Dumazet
2017-03-09 13:58   ` Tariq Toukan
2017-03-09 13:49 ` [PATCH v4 net-next 00/13] mlx4: order-0 allocations and page recycling Tariq Toukan
2017-03-09 14:26   ` Eric Dumazet
2017-03-09 15:53     ` Tariq Toukan
2017-03-09 17:52       ` David Miller
2017-03-09 17:59 ` David Miller

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=20170308161718.2867-5-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=ast@kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --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.