From 9ec6f59d94089eef2ba0c6ac06d3e71abf785102 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 30 Nov 2023 17:16:20 +0000 Subject: iavf: limit maximum number of queues to 32 First genaration of AVF APIs we currently use doesn't support more... Type: improvement Change-Id: I1ae27f322403a2b455fcad8b028fa2004b449789 Signed-off-by: Damjan Marion --- src/plugins/dev_iavf/iavf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/dev_iavf/iavf.c b/src/plugins/dev_iavf/iavf.c index 1a17f46fb52..3bf11201a3e 100644 --- a/src/plugins/dev_iavf/iavf.c +++ b/src/plugins/dev_iavf/iavf.c @@ -19,6 +19,8 @@ VLIB_REGISTER_LOG_CLASS (iavf_log, static) = { .subclass_name = "init", }; +#define IAVF_MAX_QPAIRS 32 + static const u32 driver_cap_flags = /**/ VIRTCHNL_VF_CAP_ADV_LINK_SPEED | /**/ VIRTCHNL_VF_LARGE_NUM_QPAIRS | @@ -151,15 +153,15 @@ iavf_init (vlib_main_t *vm, vnet_dev_t *dev) .rss_lut_size = res.rss_lut_size, .max_vectors = res.max_vectors, .vsi_id = res.vsi_res[0].vsi_id, - .num_qp = res.vsi_res[0].num_queue_pairs, + .num_qp = clib_min (IAVF_MAX_QPAIRS, res.vsi_res[0].num_queue_pairs), }; vnet_dev_port_add_args_t port_add_args = { .port = { .attr = { .type = VNET_DEV_PORT_TYPE_ETHERNET, - .max_rx_queues = res.num_queue_pairs, - .max_tx_queues = res.num_queue_pairs, + .max_rx_queues = clib_min (IAVF_MAX_QPAIRS, res.num_queue_pairs), + .max_tx_queues = clib_min (IAVF_MAX_QPAIRS, res.num_queue_pairs), .max_supported_rx_frame_size = res.max_mtu, .caps.change_max_rx_frame_size = 1, }, -- cgit 1.2.3-korg