From 528fcfab2357168d73c601cd2658443c3551e730 Mon Sep 17 00:00:00 2001 From: Harish Patil Date: Thu, 22 Dec 2016 16:48:11 -0800 Subject: [PATCH] net/qede: restrict maximum queues for PF/VF HW can support up to 128 queues based on the NIC config/personality. But most of the testing is done with 32 queues for PF and 16 for VF device across different qede devices, so change here is to advertise only those many instead of returning max queues supported by HW. Fixes: 2ea6f76aff40 ("qede: add core driver") Signed-off-by: Harish Patil --- drivers/net/qede/qede_ethdev.c | 13 ++++++++++--- drivers/net/qede/qede_ethdev.h | 3 +++ drivers/net/qede/qede_main.c | 5 ----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index b5fa1a2e6a..258c599fb0 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -974,8 +974,15 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev, dev_info->max_rx_pktlen = (uint32_t)ETH_TX_MAX_NON_LSO_PKT_LEN; dev_info->rx_desc_lim = qede_rx_desc_lim; dev_info->tx_desc_lim = qede_tx_desc_lim; - dev_info->max_rx_queues = (uint16_t)QEDE_MAX_RSS_CNT(qdev); + + if (IS_PF(edev)) + dev_info->max_rx_queues = (uint16_t)RTE_MIN( + QEDE_MAX_RSS_CNT(qdev), QEDE_PF_NUM_CONNS / 2); + else + dev_info->max_rx_queues = (uint16_t)RTE_MIN( + QEDE_MAX_RSS_CNT(qdev), ECORE_MAX_VF_CHAINS_PER_PF); dev_info->max_tx_queues = dev_info->max_rx_queues; + dev_info->max_mac_addrs = qdev->dev_info.num_mac_addrs; dev_info->max_vfs = 0; dev_info->reta_size = ECORE_RSS_IND_TABLE_SIZE; @@ -2020,9 +2027,9 @@ static const struct eth_dev_ops qede_eth_vf_dev_ops = { static void qede_update_pf_params(struct ecore_dev *edev) { struct ecore_pf_params pf_params; - /* 32 rx + 32 tx */ + memset(&pf_params, 0, sizeof(struct ecore_pf_params)); - pf_params.eth_pf_params.num_cons = 64; + pf_params.eth_pf_params.num_cons = QEDE_PF_NUM_CONNS; qed_ops->common->update_pf_params(edev, &pf_params); } diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index bd85ba3e81..95e06ef0f1 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -115,6 +115,9 @@ extern char fw_file[]; +/* Number of PF connections - 32 RX + 32 TX */ +#define QEDE_PF_NUM_CONNS (64) + /* Port/function states */ enum qede_dev_state { QEDE_DEV_INIT, /* Init the chip and Slowpath */ diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index b76967314c..491c9210ab 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -402,11 +402,6 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info) if (edev->num_hwfns > 1) { ecore_vf_get_num_rxqs(&edev->hwfns[1], &queues); info->num_queues += queues; - /* Restrict 100G VF to advertise 16 queues till the - * required support is available to go beyond 16. - */ - info->num_queues = RTE_MIN(info->num_queues, - ECORE_MAX_VF_CHAINS_PER_PF); } ecore_vf_get_num_vlan_filters(&edev->hwfns[0], -- 2.20.1