From 50641113d047abd094b00a29158afa00b9c53af1 Mon Sep 17 00:00:00 2001 From: Helin Zhang Date: Tue, 3 Nov 2015 23:40:27 +0800 Subject: [PATCH] i40e: adjust the number of queues for RSS It adjusts the number of queues for RSS from power of 2 to any as long as it does not exceeds the hardware allowed. Signed-off-by: Helin Zhang --- drivers/net/i40e/i40e_ethdev.c | 8 ++++---- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 144e566171..843076045a 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5728,12 +5728,12 @@ i40e_pf_config_rss(struct i40e_pf *pf) * If both VMDQ and RSS enabled, not all of PF queues are configured. * It's necessary to calulate the actual PF queues that are configured. */ - if (pf->dev_data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG) { + if (pf->dev_data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_VMDQ_FLAG) num = i40e_pf_calc_configured_queues_num(pf); - num = i40e_align_floor(num); - } else - num = i40e_align_floor(pf->dev_data->nb_rx_queues); + else + num = pf->dev_data->nb_rx_queues; + num = RTE_MIN(num, I40E_MAX_Q_PER_TC); PMD_INIT_LOG(INFO, "Max of contiguous %u PF queues are configured", num); diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index a6f4373534..18ec46e949 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2171,7 +2171,7 @@ i40evf_config_rss(struct i40e_vf *vf) return 0; } - num = i40e_align_floor(vf->dev_data->nb_rx_queues); + num = RTE_MIN(vf->dev_data->nb_rx_queues, I40E_MAX_QP_NUM_PER_VF); /* Fill out the look up table */ for (i = 0, j = 0; i < nb_q; i++, j++) { if (j >= num) -- 2.20.1