From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 18B3FA00C3 for ; Fri, 15 May 2020 08:35:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF1021DA42; Fri, 15 May 2020 08:35:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 01AE81DA22; Fri, 15 May 2020 08:35:17 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04F6XwG4026436; Thu, 14 May 2020 23:35:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=mhirpFc2M6/3KfGTHxXcw9nmQSMeJw7ZY+vHWI+o2V4=; b=Z9mAZO4vjnQRwBFgM7lGsYVQtUmJcwN/1MgB4b+ynLZtsu5enOPsb5iaLC6vtnVUg0tN 0ymDveoX1wFeN6ZxKSNtt+/ZCoTeDnbivficqQ8FgTe8oJjOsGX5DnknTPM9QfniVy2g 9qvKc4uJyqo75iUjt31N3vOgSX/2UtAEaXYSuYa2lQbHvXUlsz1yt3tC0vTVtBAcws5T HA4iitPQQtXf3s2qLzWXcL7IeUFJ+NgZCB6Mjda+WZ5dSN50xTzrJ3ySZu6CveftMrNR 4Ewxy3AHNvP5OP1IROkV+ds7hIkp8hJZhItPq+zeDaPgSHTApAeEI8Pm0JbfBagiRetw FQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 3100xapknx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 23:35:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 May 2020 23:35:15 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 14 May 2020 23:35:14 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 14 May 2020 23:35:14 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 85EB03F703F; Thu, 14 May 2020 23:35:14 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 04F6ZESV015115; Thu, 14 May 2020 23:35:14 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: , , CC: Rasesh Mody , , , Igor Russkikh Date: Thu, 14 May 2020 23:34:19 -0700 Message-ID: <20200515063419.14525-2-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200505030943.1091-1-rmody@marvell.com> References: <20200505030943.1091-1-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-15_02:2020-05-14, 2020-05-15 signatures=0 Subject: [dpdk-stable] [PATCH v3 2/2] net/qede: fix port reconfiguration X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" This patch fixes deallocation of all fastpath resources unconditionally, when re-configuring the device. When re-allocating resources PMD depends on application to explicitly setup the Rx/Tx queue. Deallocation of all the resources is only required if the Rx/Tx queue configuration changes. For other scenarios like KNI MTU change we'd keep existing configuration. Fixes: 8de0c4201926 ("net/qede: fix odd number of queues usage in 100G mode") Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence") Cc: stable@dpdk.org Signed-off-by: Rasesh Mody Signed-off-by: Igor Russkikh --- drivers/net/qede/qede_ethdev.c | 19 +++++++++++++------ drivers/net/qede/qede_rxtx.c | 4 +++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index d3d916e81..c4f8f1258 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1273,6 +1273,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); struct rte_eth_rxmode *rxmode = ð_dev->data->dev_conf.rxmode; + uint8_t num_rxqs; + uint8_t num_txqs; int ret; PMD_INIT_FUNC_TRACE(edev); @@ -1305,12 +1307,17 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev) if (qede_check_fdir_support(eth_dev)) return -ENOTSUP; - qede_dealloc_fp_resc(eth_dev); - qdev->num_tx_queues = eth_dev->data->nb_tx_queues * edev->num_hwfns; - qdev->num_rx_queues = eth_dev->data->nb_rx_queues * edev->num_hwfns; - - if (qede_alloc_fp_resc(qdev)) - return -ENOMEM; + /* Allocate/reallocate fastpath resources only for new queue config */ + num_txqs = eth_dev->data->nb_tx_queues * edev->num_hwfns; + num_rxqs = eth_dev->data->nb_rx_queues * edev->num_hwfns; + if (qdev->num_tx_queues != num_txqs || + qdev->num_rx_queues != num_rxqs) { + qede_dealloc_fp_resc(eth_dev); + qdev->num_tx_queues = num_txqs; + qdev->num_rx_queues = num_rxqs; + if (qede_alloc_fp_resc(qdev)) + return -ENOMEM; + } /* If jumbo enabled adjust MTU */ if (rxmode->offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index b81788ca4..9878ba50e 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -593,12 +593,14 @@ qede_alloc_mem_sb(struct qede_dev *qdev, struct ecore_sb_info *sb_info, int qede_alloc_fp_resc(struct qede_dev *qdev) { - struct ecore_dev *edev = &qdev->edev; + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); struct qede_fastpath *fp; uint32_t num_sbs; uint16_t sb_idx; int i; + PMD_INIT_FUNC_TRACE(edev); + if (IS_VF(edev)) ecore_vf_get_num_sbs(ECORE_LEADING_HWFN(edev), &num_sbs); else -- 2.18.0