Configuring NIC with 0 RX queue (TX queues only) on DPDK 21.11

Hi,

I am using DPDK on a Connectx-5 to generate packets at very high bandwidth.

Because I only need to send packets, I am using one or more TX queues, but no RX queues. This worked fine using up to DPDK 21.08, but does not work anymore after updating to DPDK 21.11. I am getting the error mlx5_net: port 0 cannot allocate rxq private data when calling rte_eth_dev_configure.

After debugging, I found that the commit 4cda06c3c35e004a333e98f83786ef3a16260ad4 of DPDK introduced my issue (drivers/net/mlx5/mlx5_ethdev.c:108), by trying to allocate private memory for RX queues even if rxqs_n (the number of RX queues requested) equals 0. Allocating 0 bytes of memory obviously returns a NULL pointer, triggering the error.

Q: Should it be allowed to allocate only TX queues on a Mellanox NIC ? If yes, I could provide a simple code path for the case where rxqs_n==0. But I fear breaking more code…

I want to know if this is a bug or expected behaviour, and what is the best way to fix / best workaround.

I know that I can allocate an unused RX queue, but this would cost the mempool, and the flow API, so a bigger footprint and complexity to this simple application.

I attached a MWE triggering the error on DPDK 21.11 but working fine with DPDK 21.08.

I run it with # ./no_rx_queue -a 84:00.0. Here is my PCI configuration:


lspci | grep nox

05:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]

0c:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]

84:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]

8b:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]

Thanks for any help,

Julien

no_rx_queue.c (1 KB)

I changed code from mlx5_ethdev.c at line 108 from:


if (priv->rxq_privs == NULL) {

DRV_LOG(ERR, "port %u cannot allocate rxq private data",

dev->data->port_id);

rte_errno = ENOMEM;

return -rte_errno;

}

to


if (priv->rxq_privs == NULL) {

if (rxqs_n > 0) {

DRV_LOG(ERR, "port %u cannot allocate rxq private data",

dev->data->port_id);

rte_errno = ENOMEM;

return -rte_errno;

}

else {

DRV_LOG(DEBUG, "no rxq private data allocated");

}

}

This works fine for my problem, and I can send packets without any issue. I can write a pull request, but could I have confirmation that this is not supposed to break anything ? I am not familiar with the whole mlx5_net driver, and do not have time to practice in-depth checks for this.

Thanks,

Julien

hi Julien,

Thank you for pointing out unexcepted result with ‘rxq=0’.

Compared to v20.11, it seems v21.11 adding more stricter

check for ‘priv->rxq_privs’, while bring unexpected result for rxq=0.

I’m confirming internally and will feedback here when there is an update.

Levei​

1 Like

Hi Julien,

Could you write an email about this issue and send it to networking-support@nvidia.com through your working email?

In the email, you can include message "assign this case to Levei Luo’ . So, I can get this case to continue.

Regards,

Levei

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.