iavf: fix reported max TX and RX queues in ethdev info
PATCH 1/1 iavf: fix reported max TX and RX queues in ethdev info
With a regular iavf device, rte_eth_dev_info_get reports 256 maximum TX and RX queues. Trying to configure a port with 20 queues returns an error:
ERR: IAVF_DRIVER: iavf_dev_configure(): large VF is not supported
When the large VF feature isn't supported by the PF kernel driver, ethdev info must not report 256 supported queues but 16.
--- drivers/net/intel/iavf/iavf_ethdev.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/intel/iavf/iavf_ethdev.c +8 -2
@@ -1126,12 +1126,18 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)struct iavf_adapter *adapter =IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private);struct iavf_info *vf = &adapter->vf; +uint16_t max_queue_pairs;if (adapter->closed)return -EIO ; - dev_info->max_rx_queues =IAVF_MAX_NUM_QUEUES_LV ; - dev_info->max_tx_queues =IAVF_MAX_NUM_QUEUES_LV ; +if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_LARGE_NUM_QPAIRS ) + max_queue_pairs =IAVF_MAX_NUM_QUEUES_LV ; +else + max_queue_pairs =IAVF_MAX_NUM_QUEUES_DFLT ; + + dev_info->max_rx_queues = max_queue_pairs; + dev_info->max_tx_queues = max_queue_pairs; dev_info->min_rx_bufsize =IAVF_BUF_SIZE_MIN ; dev_info->max_rx_pktlen =IAVF_FRAME_SIZE_MAX ; dev_info->max_mtu = dev_info->max_rx_pktlen -IAVF_ETH_OVERHEAD ;
Signature · 1 line
2.52.0
Quoted 33 lines · Robin Jarry
With a regular iavf device,
rte_eth_dev_info_getreports 256 maximum TX and RX queues. Trying to configure a port with 20 queues returns an error:ERR:
IAVF_DRIVER:iavf_dev_configure(): large VF is not supportedWhen the large VF feature isn't supported by the PF kernel driver, ethdev info must not report 256 supported queues but 16.
Fixes e436cd43835b ("net/iavf: negotiate large VF and request more queues")Signed-off-by Robin Jarry <[email protected]>--- drivers/net/intel/iavf/iavf_ethdev.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/net/intel/iavf/iavf_ethdev.c +1
-2@@ -1126,12 +1126,18 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)struct iavf_adapter *adapter =IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private);struct iavf_info *vf = &adapter->vf; +uint16_t max_queue_pairs;if (adapter->closed)return -EIO ; - dev_info->max_rx_queues =IAVF_MAX_NUM_QUEUES_LV ; - dev_info->max_tx_queues =IAVF_MAX_NUM_QUEUES_LV ;
drivers/net/intel/iavf/iavf_ethdev.c iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 1143
Quoted 10 lines
drivers/net/intel/iavf/iavf_ethdev.c +7
-0+if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_LARGE_NUM_QPAIRS ) + max_queue_pairs =IAVF_MAX_NUM_QUEUES_LV ; +else + max_queue_pairs =IAVF_MAX_NUM_QUEUES_DFLT ; + + dev_info->max_rx_queues = max_queue_pairs; + dev_info->max_tx_queues = max_queue_pairs; dev_info->min_rx_bufsize =IAVF_BUF_SIZE_MIN ; dev_info->max_rx_pktlen =IAVF_FRAME_SIZE_MAX ; dev_info->max_mtu = dev_info->max_rx_pktlen -IAVF_ETH_OVERHEAD ;
Makes sense.
Bruce Richardson
AppliedQuoted 46 lines · Bruce Richardson
Quoted 33 lines · Robin Jarry
With a regular iavf device,
rte_eth_dev_info_getreports 256 maximum TX and RX queues. Trying to configure a port with 20 queues returns an error:ERR:
IAVF_DRIVER:iavf_dev_configure(): large VF is not supportedWhen the large VF feature isn't supported by the PF kernel driver, ethdev info must not report 256 supported queues but 16.
Fixes e436cd43835b ("net/iavf: negotiate large VF and request more queues")Signed-off-by Robin Jarry <[email protected]>--- drivers/net/intel/iavf/iavf_ethdev.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/net/intel/iavf/iavf_ethdev.c +1
-2@@ -1126,12 +1126,18 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)struct iavf_adapter *adapter =IAVF_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private);struct iavf_info *vf = &adapter->vf; +uint16_t max_queue_pairs;if (adapter->closed)return -EIO ; - dev_info->max_rx_queues =IAVF_MAX_NUM_QUEUES_LV ; - dev_info->max_tx_queues =IAVF_MAX_NUM_QUEUES_LV ;drivers/net/intel/iavf/iavf_ethdev.c iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 1143
Quoted 10 lines
drivers/net/intel/iavf/iavf_ethdev.c +7
-0+if (vf->vf_res->vf_cap_flags &VIRTCHNL_VF_LARGE_NUM_QPAIRS ) + max_queue_pairs =IAVF_MAX_NUM_QUEUES_LV ; +else + max_queue_pairs =IAVF_MAX_NUM_QUEUES_DFLT ; + + dev_info->max_rx_queues = max_queue_pairs; + dev_info->max_tx_queues = max_queue_pairs; dev_info->min_rx_bufsize =IAVF_BUF_SIZE_MIN ; dev_info->max_rx_pktlen =IAVF_FRAME_SIZE_MAX ; dev_info->max_mtu = dev_info->max_rx_pktlen -IAVF_ETH_OVERHEAD ;Makes sense.
Quoted 2 lines
Acked-by Bruce Richardson <[email protected]>
Applied to dpdk-next-net-intel.
/Bruce