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 49D17A0577; Mon, 6 Apr 2020 08:20:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F16002BE9; Mon, 6 Apr 2020 08:20:14 +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 8A32D2BE2; Mon, 6 Apr 2020 08:20:13 +0200 (CEST) Received: by mail-io1-f66.google.com with SMTP id c16so14515203iod.6; Sun, 05 Apr 2020 23:20:13 -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=58e1SXwoQMyP0D3xXdeyW9zu1t0LCpTgRJfUcje0FJc=; b=iRfFUo2lkuqesb58CFWHEjeDI2Chl9gX7K2pKWWmhU96A5LfSGxOQBuqnILdlMdqQE f6UXsY6cI3tfCEhJ3u5VAB+1UDfyM3ZhU3tVcmtlaGi1Ot+qxIOeQLMCQOHfNMz7CD1b SvV3AJOe+9D0yH9WUCjx9AkRa6d/p2sbNPRVemRIWQ4EAEiDWw+PVFUccjUbwrGEE02+ 2lITjIxcdUYDIlL47oMo9lN2VaqpxMqcb7zAUxBMRmaX8rrANMO+55edR4w8WeJiv1NO frgWw4MpLALQgfKLbod5Jp+G510g6mh5rFsgDwuP3a+OKZGG9BLsgRjqXBg3fI4gQHya GF7Q== 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=58e1SXwoQMyP0D3xXdeyW9zu1t0LCpTgRJfUcje0FJc=; b=BeHDZxqOQ3D6ys+WazmIjSOPoWWz/jL+sr0z8T4khd0ByaAdKMz1jDquhik2sPP6xa J6KSL+t0gi97VAHvCUJQwjxEDma6+cNu8On469Wvi7oZcnkordFfu0u+7X5Ab4UWU3Kj 3KerzmWJA6YhZYKzSKcFpwxQKcu5yLuA5fBFfx1USyqdyoabLetOV4LIZTGXXO44sjjm TtoBiwHldwVurgT2OMR5vo/7Xx0eFAlBSEnwBAQUH/Eg/JJnmY9H30Rp7+8q05RSMuSX hyc0GZ6l8HSTm8qAp2pZ9/sBI/rWkuBYABYLvnKIs1yHwF3/CNunPbIjnbUKUQ+egolS fV9A== X-Gm-Message-State: AGi0PuYC0trhhu7ALwOvDW7CpVhXiE9bHxIOaKMPsC2ZsB2eMVlPgbi7 1AlIWRvocu7XS6EJVwX/b6AkO0kyIlXkojc7nNY= X-Google-Smtp-Source: APiQypJbqcGZxCJNANZbnqavOw1w/LCVsZEZ6n35DYj9SI1UwP7bZtekUqHQIn5JQGCGSCdS8iowEvxaRWRC+LgIRgY= X-Received: by 2002:a6b:14d4:: with SMTP id 203mr3438786iou.123.1586154012892; Sun, 05 Apr 2020 23:20:12 -0700 (PDT) MIME-Version: 1.0 References: <20200404151951.1013-1-pbhagavatula@marvell.com> In-Reply-To: <20200404151951.1013-1-pbhagavatula@marvell.com> From: Jerin Jacob Date: Mon, 6 Apr 2020 11:49:57 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , dpdk-dev , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] net/octeontx2: fix device configuration sequence 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 Sat, Apr 4, 2020 at 8:50 PM wrote: > > From: Pavan Nikhilesh > > When an application invokes rte_eth_dev_configure consecutively without > setting up Rx/Tx queues, it will incorrectly return error while trying > to restore Rx/Tx queue configuration. > > Fix configuration sequence by checking if any Rx/Tx queues are > previously configured before trying to restore them. > > Fixes: 548b5839a32b ("net/octeontx2: add device configure operation") > Cc: stable@dpdk.org > > Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/master. Thanks > --- > drivers/net/octeontx2/otx2_ethdev.c | 16 ++++++++++++---- > drivers/net/octeontx2/otx2_ethdev.h | 1 + > 2 files changed, 13 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c > index e60f4901c..9fbca2b05 100644 > --- a/drivers/net/octeontx2/otx2_ethdev.c > +++ b/drivers/net/octeontx2/otx2_ethdev.c > @@ -1132,10 +1132,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) > txq = (struct otx2_eth_txq **)eth_dev->data->tx_queues; > for (i = 0; i < nb_txq; i++) { > if (txq[i] == NULL) { > - otx2_err("txq[%d] is already released", i); > - goto fail; > + tx_qconf[i].valid = false; > + otx2_info("txq[%d] is already released", i); > + continue; > } > memcpy(&tx_qconf[i], &txq[i]->qconf, sizeof(*tx_qconf)); > + tx_qconf[i].valid = true; > otx2_nix_tx_queue_release(txq[i]); > eth_dev->data->tx_queues[i] = NULL; > } > @@ -1143,10 +1145,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) > rxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues; > for (i = 0; i < nb_rxq; i++) { > if (rxq[i] == NULL) { > - otx2_err("rxq[%d] is already released", i); > - goto fail; > + rx_qconf[i].valid = false; > + otx2_info("rxq[%d] is already released", i); > + continue; > } > memcpy(&rx_qconf[i], &rxq[i]->qconf, sizeof(*rx_qconf)); > + rx_qconf[i].valid = true; > otx2_nix_rx_queue_release(rxq[i]); > eth_dev->data->rx_queues[i] = NULL; > } > @@ -1201,6 +1205,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) > * queues are already setup in port_configure(). > */ > for (i = 0; i < nb_txq; i++) { > + if (!tx_qconf[i].valid) > + continue; > rc = otx2_nix_tx_queue_setup(eth_dev, i, tx_qconf[i].nb_desc, > tx_qconf[i].socket_id, > &tx_qconf[i].conf.tx); > @@ -1216,6 +1222,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) > free(tx_qconf); tx_qconf = NULL; > > for (i = 0; i < nb_rxq; i++) { > + if (!rx_qconf[i].valid) > + continue; > rc = otx2_nix_rx_queue_setup(eth_dev, i, rx_qconf[i].nb_desc, > rx_qconf[i].socket_id, > &rx_qconf[i].conf.rx, > diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h > index e5684f9f0..238afb3a8 100644 > --- a/drivers/net/octeontx2/otx2_ethdev.h > +++ b/drivers/net/octeontx2/otx2_ethdev.h > @@ -196,6 +196,7 @@ struct otx2_eth_qconf { > void *mempool; > uint32_t socket_id; > uint16_t nb_desc; > + uint8_t valid; > }; > > struct otx2_fc_info { > -- > 2.17.1 >