* [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues
@ 2019-11-27 14:18 xiangxia.m.yue
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment xiangxia.m.yue
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: xiangxia.m.yue @ 2019-11-27 14:18 UTC (permalink / raw)
To: dev; +Cc: Tonghao Zhang, Ori Kam
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
If configuring the number of tx/rx queue with rte_eth_dev_configure
to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
hairpin queues via rte_eth_tx/rx_hairpin_queue_setup.
When starting the netdev, there is a crash because of NULL accessing.
Fixes: cf5516696d77 ("ethdev: add hairpin queue")
Cc: Ori Kam <orika@mellanox.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 1d6c084119ec..0076d05b00cc 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -476,7 +476,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev)
rxq_data = (*priv->rxqs)[i];
rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
- if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
+ if (rxq_ctrl && rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
rss_queue_arr[j++] = i;
}
rss_queue_n = j;
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index cafab25c67e7..ab6937ab10d1 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
unsigned int i;
int ret = 0;
enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
+ struct mlx5_rxq_data *rxq = NULL;
for (i = 0; i < priv->rxqs_n; ++i) {
- if ((*priv->rxqs)[i]->lro) {
+ rxq = (*priv->rxqs)[i];
+
+ if (rxq && rxq->lro) {
obj_type = MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
break;
}
--
2.23.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment
2019-11-27 14:18 [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues xiangxia.m.yue
@ 2019-11-27 14:18 ` xiangxia.m.yue
2019-11-27 14:51 ` Ori Kam
2019-12-15 8:55 ` Raslan Darawsheh
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq xiangxia.m.yue
` (2 subsequent siblings)
3 siblings, 2 replies; 10+ messages in thread
From: xiangxia.m.yue @ 2019-11-27 14:18 UTC (permalink / raw)
To: dev; +Cc: Tonghao Zhang, Ori Kam
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
The type of txq has been assigned in mlx5_txq_hairpin_new.
Fixes: ae18a1ae9692 ("net/mlx5: support Tx hairpin queues")
Cc: Ori Kam <orika@mellanox.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
drivers/net/mlx5/mlx5_txq.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index a0d61644cb7f..e6a841c8d359 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -271,7 +271,6 @@ mlx5_tx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx,
DRV_LOG(DEBUG, "port %u adding Tx queue %u to list",
dev->data->port_id, idx);
(*priv->txqs)[idx] = &txq_ctrl->txq;
- txq_ctrl->type = MLX5_TXQ_TYPE_HAIRPIN;
return 0;
}
--
2.23.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq
2019-11-27 14:18 [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues xiangxia.m.yue
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment xiangxia.m.yue
@ 2019-11-27 14:18 ` xiangxia.m.yue
2019-11-27 14:52 ` Ori Kam
2019-11-27 14:50 ` [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues Ori Kam
2019-12-15 8:54 ` Raslan Darawsheh
3 siblings, 1 reply; 10+ messages in thread
From: xiangxia.m.yue @ 2019-11-27 14:18 UTC (permalink / raw)
To: dev; +Cc: Tonghao Zhang, Ori Kam
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
The mlx5_rxq_obj_hairpin_new doesn't alloc the
cq anymore. When releasing it, don't check it.
Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")
Cc: Ori Kam <orika@mellanox.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
drivers/net/mlx5/mlx5_rxq.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 2a12d5fa3436..582a2330e575 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -673,7 +673,6 @@ mlx5_rxq_obj_release(struct mlx5_rxq_obj *rxq_obj)
assert(rxq_obj);
if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_IBV)
assert(rxq_obj->wq);
- assert(rxq_obj->cq);
if (rte_atomic32_dec_and_test(&rxq_obj->refcnt)) {
switch (rxq_obj->type) {
case MLX5_RXQ_OBJ_TYPE_IBV:
--
2.23.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues
2019-11-27 14:18 [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues xiangxia.m.yue
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment xiangxia.m.yue
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq xiangxia.m.yue
@ 2019-11-27 14:50 ` Ori Kam
2019-12-15 8:54 ` Raslan Darawsheh
3 siblings, 0 replies; 10+ messages in thread
From: Ori Kam @ 2019-11-27 14:50 UTC (permalink / raw)
To: xiangxia.m.yue, dev
> -----Original Message-----
> From: xiangxia.m.yue@gmail.com <xiangxia.m.yue@gmail.com>
> Sent: Wednesday, November 27, 2019 4:19 PM
> To: dev@dpdk.org
> Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> <orika@mellanox.com>
> Subject: [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin
> queues
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> If configuring the number of tx/rx queue with rte_eth_dev_configure
> to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
> nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
> hairpin queues via rte_eth_tx/rx_hairpin_queue_setup.
>
> When starting the netdev, there is a crash because of NULL accessing.
>
> Fixes: cf5516696d77 ("ethdev: add hairpin queue")
> Cc: Ori Kam <orika@mellanox.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> drivers/net/mlx5/mlx5_ethdev.c | 2 +-
> drivers/net/mlx5/mlx5_trigger.c | 5 ++++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c
> index 1d6c084119ec..0076d05b00cc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -476,7 +476,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev
> *dev)
>
> rxq_data = (*priv->rxqs)[i];
> rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
> - if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
> + if (rxq_ctrl && rxq_ctrl->type ==
> MLX5_RXQ_TYPE_STANDARD)
> rss_queue_arr[j++] = i;
> }
> rss_queue_n = j;
> diff --git a/drivers/net/mlx5/mlx5_trigger.c
> b/drivers/net/mlx5/mlx5_trigger.c
> index cafab25c67e7..ab6937ab10d1 100644
> --- a/drivers/net/mlx5/mlx5_trigger.c
> +++ b/drivers/net/mlx5/mlx5_trigger.c
> @@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
> unsigned int i;
> int ret = 0;
> enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
> + struct mlx5_rxq_data *rxq = NULL;
>
> for (i = 0; i < priv->rxqs_n; ++i) {
> - if ((*priv->rxqs)[i]->lro) {
> + rxq = (*priv->rxqs)[i];
> +
> + if (rxq && rxq->lro) {
> obj_type = MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
> break;
> }
> --
> 2.23.0
Nice catch,
Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment xiangxia.m.yue
@ 2019-11-27 14:51 ` Ori Kam
2019-12-15 8:55 ` Raslan Darawsheh
1 sibling, 0 replies; 10+ messages in thread
From: Ori Kam @ 2019-11-27 14:51 UTC (permalink / raw)
To: xiangxia.m.yue, dev
> -----Original Message-----
> From: xiangxia.m.yue@gmail.com <xiangxia.m.yue@gmail.com>
> Sent: Wednesday, November 27, 2019 4:19 PM
> To: dev@dpdk.org
> Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> <orika@mellanox.com>
> Subject: [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The type of txq has been assigned in mlx5_txq_hairpin_new.
>
> Fixes: ae18a1ae9692 ("net/mlx5: support Tx hairpin queues")
> Cc: Ori Kam <orika@mellanox.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> drivers/net/mlx5/mlx5_txq.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
> index a0d61644cb7f..e6a841c8d359 100644
> --- a/drivers/net/mlx5/mlx5_txq.c
> +++ b/drivers/net/mlx5/mlx5_txq.c
> @@ -271,7 +271,6 @@ mlx5_tx_hairpin_queue_setup(struct rte_eth_dev
> *dev, uint16_t idx,
> DRV_LOG(DEBUG, "port %u adding Tx queue %u to list",
> dev->data->port_id, idx);
> (*priv->txqs)[idx] = &txq_ctrl->txq;
> - txq_ctrl->type = MLX5_TXQ_TYPE_HAIRPIN;
> return 0;
> }
>
> --
> 2.23.0
Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq xiangxia.m.yue
@ 2019-11-27 14:52 ` Ori Kam
2019-11-28 1:18 ` Tonghao Zhang
0 siblings, 1 reply; 10+ messages in thread
From: Ori Kam @ 2019-11-27 14:52 UTC (permalink / raw)
To: xiangxia.m.yue, dev
This patch is not correct,
You are using old code. This was already solved.
Thanks,
Ori
> -----Original Message-----
> From: xiangxia.m.yue@gmail.com <xiangxia.m.yue@gmail.com>
> Sent: Wednesday, November 27, 2019 4:19 PM
> To: dev@dpdk.org
> Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> <orika@mellanox.com>
> Subject: [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The mlx5_rxq_obj_hairpin_new doesn't alloc the
> cq anymore. When releasing it, don't check it.
>
> Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")
> Cc: Ori Kam <orika@mellanox.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> drivers/net/mlx5/mlx5_rxq.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
> index 2a12d5fa3436..582a2330e575 100644
> --- a/drivers/net/mlx5/mlx5_rxq.c
> +++ b/drivers/net/mlx5/mlx5_rxq.c
> @@ -673,7 +673,6 @@ mlx5_rxq_obj_release(struct mlx5_rxq_obj
> *rxq_obj)
> assert(rxq_obj);
> if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_IBV)
> assert(rxq_obj->wq);
> - assert(rxq_obj->cq);
> if (rte_atomic32_dec_and_test(&rxq_obj->refcnt)) {
> switch (rxq_obj->type) {
> case MLX5_RXQ_OBJ_TYPE_IBV:
> --
> 2.23.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq
2019-11-27 14:52 ` Ori Kam
@ 2019-11-28 1:18 ` Tonghao Zhang
0 siblings, 0 replies; 10+ messages in thread
From: Tonghao Zhang @ 2019-11-28 1:18 UTC (permalink / raw)
To: Ori Kam; +Cc: dev
On Wed, Nov 27, 2019 at 10:52 PM Ori Kam <orika@mellanox.com> wrote:
>
> This patch is not correct,
> You are using old code. This was already solved.
Thanks for your review, and tips
> Thanks,
> Ori
>
> > -----Original Message-----
> > From: xiangxia.m.yue@gmail.com <xiangxia.m.yue@gmail.com>
> > Sent: Wednesday, November 27, 2019 4:19 PM
> > To: dev@dpdk.org
> > Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> > <orika@mellanox.com>
> > Subject: [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq
> >
> > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >
> > The mlx5_rxq_obj_hairpin_new doesn't alloc the
> > cq anymore. When releasing it, don't check it.
> >
> > Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues")
> > Cc: Ori Kam <orika@mellanox.com>
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > ---
> > drivers/net/mlx5/mlx5_rxq.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
> > index 2a12d5fa3436..582a2330e575 100644
> > --- a/drivers/net/mlx5/mlx5_rxq.c
> > +++ b/drivers/net/mlx5/mlx5_rxq.c
> > @@ -673,7 +673,6 @@ mlx5_rxq_obj_release(struct mlx5_rxq_obj
> > *rxq_obj)
> > assert(rxq_obj);
> > if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_IBV)
> > assert(rxq_obj->wq);
> > - assert(rxq_obj->cq);
> > if (rte_atomic32_dec_and_test(&rxq_obj->refcnt)) {
> > switch (rxq_obj->type) {
> > case MLX5_RXQ_OBJ_TYPE_IBV:
> > --
> > 2.23.0
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues
2019-11-27 14:18 [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues xiangxia.m.yue
` (2 preceding siblings ...)
2019-11-27 14:50 ` [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues Ori Kam
@ 2019-12-15 8:54 ` Raslan Darawsheh
2019-12-15 9:02 ` Raslan Darawsheh
3 siblings, 1 reply; 10+ messages in thread
From: Raslan Darawsheh @ 2019-12-15 8:54 UTC (permalink / raw)
To: xiangxia.m.yue, dev; +Cc: Ori Kam
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> xiangxia.m.yue@gmail.com
> Sent: Wednesday, November 27, 2019 4:19 PM
> To: dev@dpdk.org
> Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> <orika@mellanox.com>
> Subject: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when
> setting hairpin queues
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> If configuring the number of tx/rx queue with rte_eth_dev_configure
> to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
> nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
> hairpin queues via rte_eth_tx/rx_hairpin_queue_setup.
>
> When starting the netdev, there is a crash because of NULL accessing.
>
> Fixes: cf5516696d77 ("ethdev: add hairpin queue")
> Cc: Ori Kam <orika@mellanox.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> drivers/net/mlx5/mlx5_ethdev.c | 2 +-
> drivers/net/mlx5/mlx5_trigger.c | 5 ++++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> b/drivers/net/mlx5/mlx5_ethdev.c
> index 1d6c084119ec..0076d05b00cc 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -476,7 +476,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev
> *dev)
>
> rxq_data = (*priv->rxqs)[i];
> rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
> - if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
> + if (rxq_ctrl && rxq_ctrl->type ==
> MLX5_RXQ_TYPE_STANDARD)
> rss_queue_arr[j++] = i;
> }
> rss_queue_n = j;
> diff --git a/drivers/net/mlx5/mlx5_trigger.c
> b/drivers/net/mlx5/mlx5_trigger.c
> index cafab25c67e7..ab6937ab10d1 100644
> --- a/drivers/net/mlx5/mlx5_trigger.c
> +++ b/drivers/net/mlx5/mlx5_trigger.c
> @@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
> unsigned int i;
> int ret = 0;
> enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
> + struct mlx5_rxq_data *rxq = NULL;
>
> for (i = 0; i < priv->rxqs_n; ++i) {
> - if ((*priv->rxqs)[i]->lro) {
> + rxq = (*priv->rxqs)[i];
> +
> + if (rxq && rxq->lro) {
> obj_type = MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
> break;
> }
> --
> 2.23.0
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment xiangxia.m.yue
2019-11-27 14:51 ` Ori Kam
@ 2019-12-15 8:55 ` Raslan Darawsheh
1 sibling, 0 replies; 10+ messages in thread
From: Raslan Darawsheh @ 2019-12-15 8:55 UTC (permalink / raw)
To: xiangxia.m.yue, dev; +Cc: Ori Kam
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> xiangxia.m.yue@gmail.com
> Sent: Wednesday, November 27, 2019 4:19 PM
> To: dev@dpdk.org
> Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> <orika@mellanox.com>
> Subject: [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant
> assignment
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The type of txq has been assigned in mlx5_txq_hairpin_new.
>
> Fixes: ae18a1ae9692 ("net/mlx5: support Tx hairpin queues")
> Cc: Ori Kam <orika@mellanox.com>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> drivers/net/mlx5/mlx5_txq.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
> index a0d61644cb7f..e6a841c8d359 100644
> --- a/drivers/net/mlx5/mlx5_txq.c
> +++ b/drivers/net/mlx5/mlx5_txq.c
> @@ -271,7 +271,6 @@ mlx5_tx_hairpin_queue_setup(struct rte_eth_dev
> *dev, uint16_t idx,
> DRV_LOG(DEBUG, "port %u adding Tx queue %u to list",
> dev->data->port_id, idx);
> (*priv->txqs)[idx] = &txq_ctrl->txq;
> - txq_ctrl->type = MLX5_TXQ_TYPE_HAIRPIN;
> return 0;
> }
>
> --
> 2.23.0
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues
2019-12-15 8:54 ` Raslan Darawsheh
@ 2019-12-15 9:02 ` Raslan Darawsheh
0 siblings, 0 replies; 10+ messages in thread
From: Raslan Darawsheh @ 2019-12-15 9:02 UTC (permalink / raw)
To: Raslan Darawsheh, xiangxia.m.yue, dev; +Cc: Ori Kam
Please be noted that only the first two patches where applied from this series,
The last patch is not needed anymore.
Also Added Cc: stable@dpdk.org to the commits.
Kindest regards,
Raslan Darawsheh
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Raslan Darawsheh
> Sent: Sunday, December 15, 2019 10:55 AM
> To: xiangxia.m.yue@gmail.com; dev@dpdk.org
> Cc: Ori Kam <orika@mellanox.com>
> Subject: Re: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when
> setting hairpin queues
>
> Hi,
>
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of
> > xiangxia.m.yue@gmail.com
> > Sent: Wednesday, November 27, 2019 4:19 PM
> > To: dev@dpdk.org
> > Cc: Tonghao Zhang <xiangxia.m.yue@gmail.com>; Ori Kam
> > <orika@mellanox.com>
> > Subject: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when
> > setting hairpin queues
> >
> > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >
> > If configuring the number of tx/rx queue with rte_eth_dev_configure
> > to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
> > nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
> > hairpin queues via rte_eth_tx/rx_hairpin_queue_setup.
> >
> > When starting the netdev, there is a crash because of NULL accessing.
> >
> > Fixes: cf5516696d77 ("ethdev: add hairpin queue")
> > Cc: Ori Kam <orika@mellanox.com>
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > ---
> > drivers/net/mlx5/mlx5_ethdev.c | 2 +-
> > drivers/net/mlx5/mlx5_trigger.c | 5 ++++-
> > 2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_ethdev.c
> > b/drivers/net/mlx5/mlx5_ethdev.c
> > index 1d6c084119ec..0076d05b00cc 100644
> > --- a/drivers/net/mlx5/mlx5_ethdev.c
> > +++ b/drivers/net/mlx5/mlx5_ethdev.c
> > @@ -476,7 +476,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev
> > *dev)
> >
> > rxq_data = (*priv->rxqs)[i];
> > rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
> > - if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
> > + if (rxq_ctrl && rxq_ctrl->type ==
> > MLX5_RXQ_TYPE_STANDARD)
> > rss_queue_arr[j++] = i;
> > }
> > rss_queue_n = j;
> > diff --git a/drivers/net/mlx5/mlx5_trigger.c
> > b/drivers/net/mlx5/mlx5_trigger.c
> > index cafab25c67e7..ab6937ab10d1 100644
> > --- a/drivers/net/mlx5/mlx5_trigger.c
> > +++ b/drivers/net/mlx5/mlx5_trigger.c
> > @@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
> > unsigned int i;
> > int ret = 0;
> > enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
> > + struct mlx5_rxq_data *rxq = NULL;
> >
> > for (i = 0; i < priv->rxqs_n; ++i) {
> > - if ((*priv->rxqs)[i]->lro) {
> > + rxq = (*priv->rxqs)[i];
> > +
> > + if (rxq && rxq->lro) {
> > obj_type = MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
> > break;
> > }
> > --
> > 2.23.0
>
> Patch applied to next-net-mlx,
>
> Kindest regards,
> Raslan Darawsheh
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-12-15 9:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 14:18 [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues xiangxia.m.yue
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 2/3] net/mlx5: clean up redundant assignment xiangxia.m.yue
2019-11-27 14:51 ` Ori Kam
2019-12-15 8:55 ` Raslan Darawsheh
2019-11-27 14:18 ` [dpdk-dev] [PATCH dpdk-dev 3/3] net/mlx5: remove the assert for rxq cq xiangxia.m.yue
2019-11-27 14:52 ` Ori Kam
2019-11-28 1:18 ` Tonghao Zhang
2019-11-27 14:50 ` [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues Ori Kam
2019-12-15 8:54 ` Raslan Darawsheh
2019-12-15 9:02 ` Raslan Darawsheh
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).