aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGal Pressman <galp@mellanox.com>2018-01-25 11:00:41 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2018-02-20 15:52:58 -0500
commit2f0db87901698cd73d828cc6fb1957b8916fc911 (patch)
treec60dc68460dc095b98c3162829a15ba81dec0252
parent001a2fc0c8cc29241305e44ffbce52d1daf8782b (diff)
net/mlx5e: Specify numa node when allocating drop rq
When allocating a drop rq, no numa node is explicitly set which means allocations are done on node zero. This is not necessarily the nearest numa node to the HCA, and even worse, might even be a memoryless numa node. Choose the numa_node given to us by the pci device in order to properly allocate the coherent dma memory instead of assuming zero is valid. Fixes: 556dd1b9c313 ("net/mlx5e: Set drop RQ's necessary parameters only") Signed-off-by: Gal Pressman <galp@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index a64b9226d281..da94c8cba5ee 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1768,13 +1768,16 @@ static void mlx5e_build_rq_param(struct mlx5e_priv *priv,
1768 param->wq.linear = 1; 1768 param->wq.linear = 1;
1769} 1769}
1770 1770
1771static void mlx5e_build_drop_rq_param(struct mlx5e_rq_param *param) 1771static void mlx5e_build_drop_rq_param(struct mlx5_core_dev *mdev,
1772 struct mlx5e_rq_param *param)
1772{ 1773{
1773 void *rqc = param->rqc; 1774 void *rqc = param->rqc;
1774 void *wq = MLX5_ADDR_OF(rqc, rqc, wq); 1775 void *wq = MLX5_ADDR_OF(rqc, rqc, wq);
1775 1776
1776 MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_LINKED_LIST); 1777 MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_LINKED_LIST);
1777 MLX5_SET(wq, wq, log_wq_stride, ilog2(sizeof(struct mlx5e_rx_wqe))); 1778 MLX5_SET(wq, wq, log_wq_stride, ilog2(sizeof(struct mlx5e_rx_wqe)));
1779
1780 param->wq.buf_numa_node = dev_to_node(&mdev->pdev->dev);
1778} 1781}
1779 1782
1780static void mlx5e_build_sq_param_common(struct mlx5e_priv *priv, 1783static void mlx5e_build_sq_param_common(struct mlx5e_priv *priv,
@@ -2634,6 +2637,9 @@ static int mlx5e_alloc_drop_cq(struct mlx5_core_dev *mdev,
2634 struct mlx5e_cq *cq, 2637 struct mlx5e_cq *cq,
2635 struct mlx5e_cq_param *param) 2638 struct mlx5e_cq_param *param)
2636{ 2639{
2640 param->wq.buf_numa_node = dev_to_node(&mdev->pdev->dev);
2641 param->wq.db_numa_node = dev_to_node(&mdev->pdev->dev);
2642
2637 return mlx5e_alloc_cq_common(mdev, param, cq); 2643 return mlx5e_alloc_cq_common(mdev, param, cq);
2638} 2644}
2639 2645
@@ -2645,7 +2651,7 @@ static int mlx5e_open_drop_rq(struct mlx5_core_dev *mdev,
2645 struct mlx5e_cq *cq = &drop_rq->cq; 2651 struct mlx5e_cq *cq = &drop_rq->cq;
2646 int err; 2652 int err;
2647 2653
2648 mlx5e_build_drop_rq_param(&rq_param); 2654 mlx5e_build_drop_rq_param(mdev, &rq_param);
2649 2655
2650 err = mlx5e_alloc_drop_cq(mdev, cq, &cq_param); 2656 err = mlx5e_alloc_drop_cq(mdev, cq, &cq_param);
2651 if (err) 2657 if (err)