From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 4641DA04B8;
	Tue,  5 May 2020 10:59:55 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 156A81D446;
	Tue,  5 May 2020 10:59:55 +0200 (CEST)
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 2FAB71D42B
 for <dev@dpdk.org>; Tue,  5 May 2020 10:59:53 +0200 (CEST)
IronPort-SDR: ipSnL3Z63fHk6xEKpoZxSs/dfww4q0So4MWeEErDLTQ2y2JsQ+jsr5ZCsTDvKuez1wPskBs9Wy
 Rip/yQTv6Mnw==
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 05 May 2020 01:59:51 -0700
IronPort-SDR: Ae2JQpn3cdXhktRq4ZYG/etkOClsryJ/Rlry7c6gb5dUTiSiSktOLFqyaep41NIE3gVZyoaMwE
 2JxAd6R7iBxQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.73,354,1583222400"; d="scan'208";a="259623974"
Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.213.213.211])
 ([10.213.213.211])
 by orsmga003.jf.intel.com with ESMTP; 05 May 2020 01:59:49 -0700
To: Jerin Jacob <jerinjacobk@gmail.com>, Rasesh Mody <rmody@marvell.com>
Cc: dpdk-dev <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
 GR-Everest-DPDK-Dev <GR-Everest-DPDK-Dev@marvell.com>,
 Igor Russkikh <irusskikh@marvell.com>, Thomas Monjalon
 <thomas@monjalon.net>, Andrew Rybchenko <arybchenko@solarflare.com>
References: <20200505030943.1091-1-rmody@marvell.com>
 <20200505030943.1091-2-rmody@marvell.com>
 <CALBAE1NnRgAQSXoCTNRzTj=3RVF-9NRZzEi1DO1Xqjcrmx4Q9Q@mail.gmail.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata=
 mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy
 qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6hxdzTmLRtGtwWzI9MwrUPj6n/ldiD58VAGQ
 +iR1I/z9UBUN/ZMksElA2D7Jgg7vZ78iKwNnd+vLBD6I61kVrZ45Vjo3r+pPOByUBXOUlxp9
 GWEKKIrJ4eogqkVNSixN16VYK7xR+5OUkBYUO+sE6etSxCr7BahMPKxH+XPlZZjKrxciaWQb
 +dElz3Ab4Opl+ZT/bK2huX+W+NJBEBVzjTkhjSTjcyRdxvS1gwWRuXqAml/sh+KQjPV1PPHF
 YK5LcqLkle+OKTCa82OvUb7cr+ALxATIZXQkgmn+zFT8UzSS3aiBBohg3BtbTIWy51jNlYdy
 ezUZ4UxKSsFuUTPt+JjHQBvF7WKbmNGS3fCid5Iag4tWOfZoqiCNzxApkVugltxoc6rG2TyX
 CmI2rP0mQ0GOsGXA3+3c1MCdQFzdIn/5tLBZyKy4F54UFo35eOX8/g7OaE+xrgY/4bZjpxC1
 1pd66AAtKb3aNXpHvIfkVV6NYloo52H+FUE5ZDPNCGD0/btFGPWmWRmkPybzColTy7fmPaGz
 cBcEEqHK4T0aY4UJmE7Ylvg255Kz7s6wGZe6IR3N0cKNv++O7QARAQABtCVGZXJydWggWWln
 aXQgPGZlcnJ1aC55aWdpdEBpbnRlbC5jb20+iQJsBBMBCgBWAhsDAh4BAheABQsJCAcDBRUK
 CQgLBRYCAwEABQkKqZZ8FiEE0jZTh0IuwoTjmYHH+TPrQ98TYR8FAl6ha3sXGHZrczovL2tl
 eXM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wjN6Wonokv
 ChAewHXPUadcJmCTj78Oeg9uXR6yjpxyFjx3vdijQIYgi5TEGpeTQBymLANOYxYWYOjXk+ae
 dYuOYKR9nbPv+2zK9pwwQ2NXbUBystaGyQ==
Message-ID: <e888385e-de46-1cc8-7031-1133c0c3f966@intel.com>
Date: Tue, 5 May 2020 09:59:46 +0100
MIME-Version: 1.0
In-Reply-To: <CALBAE1NnRgAQSXoCTNRzTj=3RVF-9NRZzEi1DO1Xqjcrmx4Q9Q@mail.gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Subject: Re: [dpdk-dev] [PATCH 2/2] net/qede: restore Tx queue setup
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 5/5/2020 7:44 AM, Jerin Jacob wrote:
> On Tue, May 5, 2020 at 8:39 AM Rasesh Mody <rmody@marvell.com> wrote:
>>
>> Some applications do not explicitly restore Tx queues setup during
>> port re-configuration. This patch adds changes to check for
>> released Tx queues and restore the setup if application doesn't
>> explicitly does that.
> 
> +ethdev maintainers.
> 
> I think, Ideally, the fix should be in common code if we need to
> support such applications.

Is this a case application re-configures to increase the number of queues but
doesn't setup new queues?
If so this looks like application error and application should be fixed instead
of recover this in the ethdev.

> 
> This would avoid the following case
> - The application works only on a specific PMD.
> - every PMD duplicating such restoration code.
> 
> 
>>
>> Signed-off-by: Rasesh Mody <rmody@marvell.com>
>> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
>> ---
>>  drivers/net/qede/qede_ethdev.h |  3 +++
>>  drivers/net/qede/qede_rxtx.c   | 25 ++++++++++++++++++++++++-
>>  2 files changed, 27 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
>> index b988a73f2..2e8e5febc 100644
>> --- a/drivers/net/qede/qede_ethdev.h
>> +++ b/drivers/net/qede/qede_ethdev.h
>> @@ -235,6 +235,9 @@ struct qede_dev {
>>         bool enable_lro;
>>         uint8_t num_rx_queues;
>>         uint8_t num_tx_queues;
>> +       uint16_t num_rx_desc;
>> +       uint16_t num_tx_desc;
>> +       const struct rte_eth_txconf *tx_conf;
>>         SLIST_HEAD(vlan_list_head, qede_vlan_entry)vlan_list_head;
>>         uint16_t configured_vlans;
>>         bool accept_any_vlan;
>> diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
>> index b81788ca4..1b212a4fb 100644
>> --- a/drivers/net/qede/qede_rxtx.c
>> +++ b/drivers/net/qede/qede_rxtx.c
>> @@ -151,6 +151,7 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
>>         rxq->qdev = qdev;
>>         rxq->mb_pool = mp;
>>         rxq->nb_rx_desc = nb_desc;
>> +       qdev->num_rx_desc = rxq->nb_rx_desc;
>>         rxq->queue_id = queue_idx;
>>         rxq->port_id = dev->data->port_id;
>>
>> @@ -405,6 +406,7 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
>>         }
>>
>>         txq->nb_tx_desc = nb_desc;
>> +       qdev->num_tx_desc = txq->nb_tx_desc;
>>         txq->qdev = qdev;
>>         txq->port_id = dev->data->port_id;
>>
>> @@ -443,6 +445,7 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
>>
>>         txq->nb_tx_avail = txq->nb_tx_desc;
>>
>> +       qdev->tx_conf = tx_conf;
>>         txq->tx_free_thresh =
>>             tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh :
>>             (txq->nb_tx_desc - QEDE_DEFAULT_TX_FREE_THRESH);
>> @@ -593,7 +596,7 @@ 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;
>> @@ -1005,9 +1008,29 @@ static int qede_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
>>  int qede_start_queues(struct rte_eth_dev *eth_dev)
>>  {
>>         struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
>> +       struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
>> +       struct qede_tx_queue *txq;
>> +       struct qede_fastpath *fp;
>>         uint8_t id;
>>         int rc = -1;
>>
>> +       /* Restore setup of Tx queues */
>> +       for (id = 0; id < qdev->num_tx_queues; id++) {
>> +               fp = &qdev->fp_array[id];
>> +               txq = fp->txq;
>> +
>> +               if (!txq) {
>> +                       rc = qede_tx_queue_setup(eth_dev, id, qdev->num_tx_desc,
>> +                                                eth_dev->data->numa_node,
>> +                                                qdev->tx_conf);
>> +                       if (rc != ECORE_SUCCESS) {
>> +                               DP_ERR(edev, "TX queue %u not setup rc=%d\n",
>> +                                      id, rc);
>> +                               return -1;
>> +                       }
>> +               }
>> +       }
>> +
>>         for (id = 0; id < qdev->num_rx_queues; id++) {
>>                 rc = qede_rx_queue_start(eth_dev, id);
>>                 if (rc != ECORE_SUCCESS)
>> --
>> 2.18.0
>>