linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()
@ 2018-06-05  2:42 Wei Yongjun
  2018-06-05  6:48 ` Tariq Toukan
  2018-06-05 14:20 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-06-05  2:42 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: Wei Yongjun, netdev, linux-rdma, kernel-janitors

Fix to return error code -ENOMEM from the kvzalloc_node() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 069d11465a80 ("net/mlx5e: RX, Enhance legacy Receive Queue memory scheme")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 333d4ed..89c96a0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -566,8 +566,10 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
 			kvzalloc_node((wq_sz << rq->wqe.info.log_num_frags) *
 				      sizeof(*rq->wqe.frags),
 				      GFP_KERNEL, cpu_to_node(c->cpu));
-		if (!rq->wqe.frags)
+		if (!rq->wqe.frags) {
+			err = -ENOMEM;
 			goto err_free;
+		}
 
 		err = mlx5e_init_di_list(rq, params, wq_sz, c->cpu);
 		if (err)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()
  2018-06-05  2:42 [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq() Wei Yongjun
@ 2018-06-05  6:48 ` Tariq Toukan
  2018-06-05 14:20 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Tariq Toukan @ 2018-06-05  6:48 UTC (permalink / raw)
  To: Wei Yongjun, Saeed Mahameed, Leon Romanovsky, Tariq Toukan
  Cc: netdev, linux-rdma, kernel-janitors



On 05/06/2018 5:42 AM, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the kvzalloc_node() error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 069d11465a80 ("net/mlx5e: RX, Enhance legacy Receive Queue memory scheme")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 333d4ed..89c96a0 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -566,8 +566,10 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
>   			kvzalloc_node((wq_sz << rq->wqe.info.log_num_frags) *
>   				      sizeof(*rq->wqe.frags),
>   				      GFP_KERNEL, cpu_to_node(c->cpu));
> -		if (!rq->wqe.frags)
> +		if (!rq->wqe.frags) {
> +			err = -ENOMEM;
>   			goto err_free;
> +		}
>   
>   		err = mlx5e_init_di_list(rq, params, wq_sz, c->cpu);
>   		if (err)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Thanks Wei!

Reviewed-by: Tariq Toukan <tariqt@mellanox.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()
  2018-06-05  2:42 [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq() Wei Yongjun
  2018-06-05  6:48 ` Tariq Toukan
@ 2018-06-05 14:20 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2018-06-05 14:20 UTC (permalink / raw)
  To: weiyongjun1; +Cc: saeedm, leon, tariqt, netdev, linux-rdma, kernel-janitors

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Tue, 5 Jun 2018 02:42:56 +0000

> Fix to return error code -ENOMEM from the kvzalloc_node() error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 069d11465a80 ("net/mlx5e: RX, Enhance legacy Receive Queue memory scheme")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()
       [not found] ` <1515569453-63865-1-git-send-email-weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2018-01-10 20:55   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-01-10 20:55 UTC (permalink / raw)
  To: weiyongjun1-hv44wF8Li93QT0dZR+AlfA
  Cc: saeedm-VPRAkNaXOzVWk0Htik3J/w, matanb-VPRAkNaXOzVWk0Htik3J/w,
	leonro-VPRAkNaXOzVWk0Htik3J/w, brouer-H+wXaHxf7aLQT0dZR+AlfA,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA

From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Date: Wed, 10 Jan 2018 07:30:53 +0000

> Fix to return a negative error code from the xdp_rxq_info_reg() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 0ddf543226ac ("xdp/mlx5: setup xdp_rxq_info")
> Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()
  2018-01-10  7:30 Wei Yongjun
@ 2018-01-10 14:08 ` Jesper Dangaard Brouer
       [not found] ` <1515569453-63865-1-git-send-email-weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Jesper Dangaard Brouer @ 2018-01-10 14:08 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Saeed Mahameed, Matan Barak, Leon Romanovsky, netdev, linux-rdma, brouer


On Wed, 10 Jan 2018 07:30:53 +0000 Wei Yongjun <weiyongjun1@huawei.com> wrote:

> Fix to return a negative error code from the xdp_rxq_info_reg() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 0ddf543226ac ("xdp/mlx5: setup xdp_rxq_info")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 539bd1d..6ba6671 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -582,7 +582,8 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
>  		goto err_rq_wq_destroy;
>  	}
>  
> -	if (xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix) < 0)
> +	err = xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix);
> +	if (err < 0)
>  		goto err_rq_wq_destroy;
>  
>  	rq->buff.map_dir = rq->xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;

Reviewed-by: Jesper Dangaard Brouer <brouer@redhat.com>

Thanks for fixing this.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()
@ 2018-01-10  7:30 Wei Yongjun
  2018-01-10 14:08 ` Jesper Dangaard Brouer
       [not found] ` <1515569453-63865-1-git-send-email-weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Yongjun @ 2018-01-10  7:30 UTC (permalink / raw)
  To: Saeed Mahameed, Matan Barak, Leon Romanovsky, Jesper Dangaard Brouer
  Cc: Wei Yongjun, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

Fix to return a negative error code from the xdp_rxq_info_reg() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 0ddf543226ac ("xdp/mlx5: setup xdp_rxq_info")
Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 539bd1d..6ba6671 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -582,7 +582,8 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
 		goto err_rq_wq_destroy;
 	}
 
-	if (xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix) < 0)
+	err = xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix);
+	if (err < 0)
 		goto err_rq_wq_destroy;
 
 	rq->buff.map_dir = rq->xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-05 14:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05  2:42 [PATCH net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq() Wei Yongjun
2018-06-05  6:48 ` Tariq Toukan
2018-06-05 14:20 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2018-01-10  7:30 Wei Yongjun
2018-01-10 14:08 ` Jesper Dangaard Brouer
     [not found] ` <1515569453-63865-1-git-send-email-weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-01-10 20:55   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).