net/idpf: fix checks in multi-queue config and stop

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: 549343c25d ("net/idpf: support device initialization")
Fixes: 70675bcc3a ("net/idpf: support RSS")
Fixes: 37291a68fd ("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>
This commit is contained in:
Beilei Xing 2022-11-18 07:02:46 +00:00 committed by Qi Zhang
parent 67cb9cbe66
commit 8c6ef17e1f

View File

@ -390,13 +390,6 @@ idpf_dev_configure(struct rte_eth_dev *dev)
return -ENOTSUP; 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) { if (conf->txmode.mq_mode != RTE_ETH_MQ_TX_NONE) {
PMD_INIT_LOG(ERR, "Multi-queue TX mode %d is not supported", PMD_INIT_LOG(ERR, "Multi-queue TX mode %d is not supported",
conf->txmode.mq_mode); conf->txmode.mq_mode);
@ -638,7 +631,8 @@ idpf_dev_stop(struct rte_eth_dev *dev)
idpf_vc_config_irq_map_unmap(vport, false); 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; vport->stopped = 1;