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 44062A04AE; Tue, 5 May 2020 08:44:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C765E1D15D; Tue, 5 May 2020 08:44:33 +0200 (CEST) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id C10681D158 for ; Tue, 5 May 2020 08:44:31 +0200 (CEST) Received: by mail-io1-f66.google.com with SMTP id c2so831985iow.7 for ; Mon, 04 May 2020 23:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/u7X36LATtxJqrOBpcFAobyw5NyQaKpp8DxCh6QZw5o=; b=fEg2s21gtaOD2yme5nsTh9+DOfG7wdxiTftrog+YXTbTmY981gqnPKF12vVzMScisR Fjya/B/fIxtYzWMFU/FJTfFkxQd6n+gpyd5vuv3fWjFaCJciob7A89RyMoQ5ti5Q2Ct1 b2uvrajsjIuOVR9Tflu1UsEfn9sUz5QdkOGQ3F0yhjcdzy+6K+/cPiFt4CZFdYDJZKPo fYYVL9LH4k3vbDlhItwPlzkQc1wmF4nfj8mYh54WOzFE1rjm+6lzMxfrsu3y8S2btO85 iQ7K+AohUqLfLeaSHY31a4ncmCPQTitXvcq9gETTAnpdU2zUlKcxFGfQYMBmn2nvViN1 AEDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/u7X36LATtxJqrOBpcFAobyw5NyQaKpp8DxCh6QZw5o=; b=ofLn+FmyYPK2FcJUhhbW1RS7Ez9g2efx0qcxf779dfkfAf6j24mT7aRc31+pX5OFbF bEyhiKN6/lz65l/HeraecOSiTo6H3nWq9PEzNVNOV19touzKmOilM+VoS1dSyDM7eKQL zsYdcNG8MQAngQ2HfbP2MptAmDfVuT5KVrSa6YnFIwLaubgqNLTd44dbIVRFPdOpmKu4 8HX77Z1JLAVt8BLJKo5pEZOrt6U9kS5bZn7TCXzWKx33bXTkTj+idxq5N8G2mgsK1R8F DUNB4H6cOU+QCSM1D5ZGPOkTKvbEWDVXDPCT4pnIaWKqbTRtzrXbCi8J2zPwLFg7Xau+ GLhQ== X-Gm-Message-State: AGi0PubXlOrkksEkkc/MzGTTOJaHg5zjS8rm7uWHx3bVCKmTYqm4LNXa G4ToOE0KjX2LFePBRl8a0mnPq3YtjjAiyld8hZ4= X-Google-Smtp-Source: APiQypJq+k6w03eU/jQcYZPoaIQTs9Xzb4RGzRr0BHdLq/TX+X4I2Wk9oMocv2ZB+xZIgvRPw+qkvbYh+K/5EFyniYU= X-Received: by 2002:a05:6638:2a2:: with SMTP id d2mr2137996jaq.104.1588661070864; Mon, 04 May 2020 23:44:30 -0700 (PDT) MIME-Version: 1.0 References: <20200505030943.1091-1-rmody@marvell.com> <20200505030943.1091-2-rmody@marvell.com> In-Reply-To: <20200505030943.1091-2-rmody@marvell.com> From: Jerin Jacob Date: Tue, 5 May 2020 12:14:14 +0530 Message-ID: To: Rasesh Mody Cc: dpdk-dev , Jerin Jacob , Ferruh Yigit , GR-Everest-DPDK-Dev , Igor Russkikh , Thomas Monjalon , Andrew Rybchenko Content-Type: text/plain; charset="UTF-8" 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, May 5, 2020 at 8:39 AM Rasesh Mody 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. 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 > Signed-off-by: Igor Russkikh > --- > 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 >