net/mlx5e: Remove unnecessary wqe_sz field from RQ buffer
authorTariq Toukan <tariqt@mellanox.com>
Mon, 3 Jul 2017 08:51:17 +0000 (11:51 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Sun, 3 Sep 2017 03:34:08 +0000 (06:34 +0300)
Field is used only locally within the RQ create function.
The use of a local variable is sufficient.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 44bd8df905caf526351c39dd37568e968a1d5f16..ce8b4f648757a2ed78baa5f7051bd1a80bd6a8ca 100644 (file)
@@ -540,7 +540,6 @@ struct mlx5e_rq {
                } mpwqe;
        };
        struct {
-               u32            wqe_sz;    /* wqe data buffer size */
                u16            headroom;
                u8             page_order;
                u8             map_dir;   /* dma map direction */
index 7a25d952c922136b8effe354babba1f92ac8d05e..591e0dca96712351a590b18b7f2b98362cbf7a73 100644 (file)
@@ -618,8 +618,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
                rq->mpwqe.log_stride_sz = params->mpwqe_log_stride_sz;
                rq->mpwqe.num_strides = BIT(params->mpwqe_log_num_strides);
 
-               rq->buff.wqe_sz = rq->mpwqe.num_strides << rq->mpwqe.log_stride_sz;
-               byte_count = rq->buff.wqe_sz;
+               byte_count = rq->mpwqe.num_strides << rq->mpwqe.log_stride_sz;
 
                err = mlx5e_create_rq_umr_mkey(mdev, rq);
                if (err)
@@ -654,15 +653,14 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
                        goto err_rq_wq_destroy;
                }
 
-               rq->buff.wqe_sz = params->lro_en  ?
+               byte_count = params->lro_en  ?
                                params->lro_wqe_sz :
                                MLX5E_SW2HW_MTU(c->priv, c->netdev->mtu);
 #ifdef CONFIG_MLX5_EN_IPSEC
                if (MLX5_IPSEC_DEV(mdev))
-                       rq->buff.wqe_sz += MLX5E_METADATA_ETHER_LEN;
+                       byte_count += MLX5E_METADATA_ETHER_LEN;
 #endif
                rq->wqe.page_reuse = !params->xdp_prog && !params->lro_en;
-               byte_count = rq->buff.wqe_sz;
 
                /* calc the required page order */
                rq->wqe.frag_sz = MLX5_SKB_FRAG_SZ(rq->buff.headroom + byte_count);