mlx4: remove order field from mlx4_en_frag_info
authorEric Dumazet <edumazet@google.com>
Wed, 8 Mar 2017 16:17:07 +0000 (08:17 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Mar 2017 17:54:46 +0000 (09:54 -0800)
This is really a port attribute, no need to duplicate it per
RX queue and per frag.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h

index 6183128b2d3d0519b46d14152b15c95ebbf62db7..b78d6762e03fc9f0c9e8bfa710efc2e7c86ad306 100644 (file)
@@ -59,7 +59,7 @@ static int mlx4_alloc_pages(struct mlx4_en_priv *priv,
        struct page *page;
        dma_addr_t dma;
 
-       for (order = frag_info->order; ;) {
+       for (order = priv->rx_page_order; ;) {
                gfp_t gfp = _gfp;
 
                if (order)
@@ -1195,7 +1195,7 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
         * This only works when num_frags == 1.
         */
        if (priv->tx_ring_num[TX_XDP]) {
-               priv->frag_info[0].order = 0;
+               priv->rx_page_order = 0;
                priv->frag_info[0].frag_size = eff_mtu;
                priv->frag_info[0].frag_prefix_size = 0;
                /* This will gain efficient xdp frame recycling at the
@@ -1209,7 +1209,6 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
                int buf_size = 0;
 
                while (buf_size < eff_mtu) {
-                       priv->frag_info[i].order = MLX4_EN_ALLOC_PREFER_ORDER;
                        priv->frag_info[i].frag_size =
                                (eff_mtu > buf_size + frag_sizes[i]) ?
                                        frag_sizes[i] : eff_mtu - buf_size;
@@ -1221,6 +1220,7 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
                        buf_size += priv->frag_info[i].frag_size;
                        i++;
                }
+               priv->rx_page_order = MLX4_EN_ALLOC_PREFER_ORDER;
                priv->dma_dir = PCI_DMA_FROMDEVICE;
        }
 
index a4c7d94d52c698c23c9768a4c0387378898cdbc5..9d2c53ddb15c6d2262272a1b429f0ebde366e3ac 100644 (file)
@@ -474,7 +474,6 @@ struct mlx4_en_frag_info {
        u16 frag_size;
        u16 frag_prefix_size;
        u32 frag_stride;
-       u16 order;
        u16 rx_headroom;
 };
 
@@ -586,6 +585,7 @@ struct mlx4_en_priv {
        u8 num_frags;
        u8 log_rx_info;
        u8 dma_dir;
+       u8 rx_page_order;
 
        struct mlx4_en_tx_ring **tx_ring[MLX4_EN_NUM_TX_TYPES];
        struct mlx4_en_rx_ring *rx_ring[MAX_RX_RINGS];