[v3] net/idpf: fix crash when launching l3fwd
Checks
Commit Message
From: Beilei Xing <beilei.xing@intel.com>
There's core dump when launching l3fwd with 1 queue 1 core. It's
because NULL pointer is used if fail to configure device.
This patch removes incorrect check during device configuration,
and checks NULL pointer when executing VIRTCHNL2_OP_DEALLOC_VECTORS.
Fixes: 549343c25db8 ("net/idpf: support device initialization")
Fixes: 70675bcc3a57 ("net/idpf: support RSS")
Fixes: 37291a68fd78 ("net/idpf: support write back based on ITR expire")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v2 change: fix typo.
v3 change: check NULL pointer before virtual channel handling.
drivers/net/idpf/idpf_ethdev.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Comments
> -----Original Message-----
> From: beilei.xing@intel.com <beilei.xing@intel.com>
> Sent: Friday, November 18, 2022 3:03 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Subject: [PATCH v3] net/idpf: fix crash when launching l3fwd
>
> From: Beilei Xing <beilei.xing@intel.com>
>
> There's core dump when launching l3fwd with 1 queue 1 core. It's because
> NULL pointer is used if fail to configure device.
> This patch removes incorrect check during device configuration, and checks
> NULL pointer when executing VIRTCHNL2_OP_DEALLOC_VECTORS.
>
> Fixes: 549343c25db8 ("net/idpf: support device initialization")
> Fixes: 70675bcc3a57 ("net/idpf: support RSS")
> Fixes: 37291a68fd78 ("net/idpf: support write back based on ITR expire")
>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Friday, November 18, 2022 3:03 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Subject: [PATCH v3] net/idpf: fix crash when launching l3fwd
>
> From: Beilei Xing <beilei.xing@intel.com>
>
> There's core dump when launching l3fwd with 1 queue 1 core. It's because
> NULL pointer is used if fail to configure device.
> This patch removes incorrect check during device configuration, and checks
> NULL pointer when executing VIRTCHNL2_OP_DEALLOC_VECTORS.
>
> Fixes: 549343c25db8 ("net/idpf: support device initialization")
> Fixes: 70675bcc3a57 ("net/idpf: support RSS")
> Fixes: 37291a68fd78 ("net/idpf: support write back based on ITR expire")
>
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Peng, Yuan <yuan.peng@intel.com>
@@ -372,13 +372,6 @@ idpf_dev_configure(struct rte_eth_dev *dev)
return -ENOTSUP;
}
- if ((dev->data->nb_rx_queues == 1 && conf->rxmode.mq_mode != RTE_ETH_MQ_RX_NONE) ||
- (dev->data->nb_rx_queues > 1 && conf->rxmode.mq_mode != RTE_ETH_MQ_RX_RSS)) {
- PMD_INIT_LOG(ERR, "Multi-queue packet distribution mode %d is not supported",
- conf->rxmode.mq_mode);
- return -ENOTSUP;
- }
-
if (conf->txmode.mq_mode != RTE_ETH_MQ_TX_NONE) {
PMD_INIT_LOG(ERR, "Multi-queue TX mode %d is not supported",
conf->txmode.mq_mode);
@@ -620,7 +613,8 @@ idpf_dev_stop(struct rte_eth_dev *dev)
idpf_vc_config_irq_map_unmap(vport, false);
- idpf_vc_dealloc_vectors(vport);
+ if (vport->recv_vectors != NULL)
+ idpf_vc_dealloc_vectors(vport);
vport->stopped = 1;