Commit d85f6c14 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

mlx4: rx_headroom is a per port attribute

No need to duplicate it per RX queue / frags.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aaca121d
...@@ -115,7 +115,7 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv, ...@@ -115,7 +115,7 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv,
for (i = 0; i < priv->num_frags; i++) { for (i = 0; i < priv->num_frags; i++) {
frags[i] = ring_alloc[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 + rx_desc->data[i].addr = cpu_to_be64(frags[i].dma +
frags[i].page_offset); frags[i].page_offset);
ring_alloc[i] = page_alloc[i]; ring_alloc[i] = page_alloc[i];
...@@ -1202,7 +1202,7 @@ void mlx4_en_calc_rx_buf(struct net_device *dev) ...@@ -1202,7 +1202,7 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
*/ */
priv->frag_info[0].frag_stride = PAGE_SIZE; priv->frag_info[0].frag_stride = PAGE_SIZE;
priv->dma_dir = PCI_DMA_BIDIRECTIONAL; priv->dma_dir = PCI_DMA_BIDIRECTIONAL;
priv->frag_info[0].rx_headroom = XDP_PACKET_HEADROOM; priv->rx_headroom = XDP_PACKET_HEADROOM;
i = 1; i = 1;
} else { } else {
int buf_size = 0; int buf_size = 0;
...@@ -1214,12 +1214,12 @@ void mlx4_en_calc_rx_buf(struct net_device *dev) ...@@ -1214,12 +1214,12 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
priv->frag_info[i].frag_stride = priv->frag_info[i].frag_stride =
ALIGN(priv->frag_info[i].frag_size, ALIGN(priv->frag_info[i].frag_size,
SMP_CACHE_BYTES); SMP_CACHE_BYTES);
priv->frag_info[i].rx_headroom = 0;
buf_size += priv->frag_info[i].frag_size; buf_size += priv->frag_info[i].frag_size;
i++; i++;
} }
priv->rx_page_order = MLX4_EN_ALLOC_PREFER_ORDER; priv->rx_page_order = MLX4_EN_ALLOC_PREFER_ORDER;
priv->dma_dir = PCI_DMA_FROMDEVICE; priv->dma_dir = PCI_DMA_FROMDEVICE;
priv->rx_headroom = 0;
} }
priv->num_frags = i; priv->num_frags = i;
......
...@@ -472,7 +472,6 @@ struct mlx4_en_mc_list { ...@@ -472,7 +472,6 @@ struct mlx4_en_mc_list {
struct mlx4_en_frag_info { struct mlx4_en_frag_info {
u16 frag_size; u16 frag_size;
u16 rx_headroom;
u32 frag_stride; u32 frag_stride;
}; };
...@@ -585,6 +584,7 @@ struct mlx4_en_priv { ...@@ -585,6 +584,7 @@ struct mlx4_en_priv {
u8 log_rx_info; u8 log_rx_info;
u8 dma_dir; u8 dma_dir;
u8 rx_page_order; u8 rx_page_order;
u16 rx_headroom;
struct mlx4_en_tx_ring **tx_ring[MLX4_EN_NUM_TX_TYPES]; struct mlx4_en_tx_ring **tx_ring[MLX4_EN_NUM_TX_TYPES];
struct mlx4_en_rx_ring *rx_ring[MAX_RX_RINGS]; struct mlx4_en_rx_ring *rx_ring[MAX_RX_RINGS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment