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 49F3FA04DB; Thu, 10 Dec 2020 00:54:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E69EFC996; Thu, 10 Dec 2020 00:53:59 +0100 (CET) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id DDC4FC962; Thu, 10 Dec 2020 00:53:56 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id bj5so1831643plb.4; Wed, 09 Dec 2020 15:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r2mmbYWfwWyqexB3MPBjTdy2n/fKd0DGojjC9WTubNI=; b=Vb0GlAq3nAbTVzen5Ici9I0SIFOHed3t//oeEm6AdvvoGH66iLhlw5uF4+70y3K3JD UtcH2VD1QeoYnOFO3XBe7dlu1GuygPZTcndqshzk89+BkpoyLOHKdQLqhsh8wSVfa2Uj ICvqPyelTRbHO70FtPIYWABRQO/7o96iS2qdHh7BCeqPk1mxSk2IqC+QmhB7CSRq/xVW 0rWAKsm9C865dK1nk5r9TlI7yLB55ryresqewqNN9m5P7GGUXowOurva3hD7X7uWsJ7X y6nTsUuv2iOKarBkgtwfaIZFYBa8/7KJB3HbZEZgis/kOnqNakXy4sDFURdJ75EKpPrg T11Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r2mmbYWfwWyqexB3MPBjTdy2n/fKd0DGojjC9WTubNI=; b=jUXu0XQMMjfG9s5r8n4kfQV7qyWV8pnjoI7LzsdMplve9rDOd5ruL32tTM6gRYBlu6 U5BJXs7XFUnagK8myb1I/wRJenA4gb6TtUyUsElhdyDHBMYRAVtfCL2rRi60JGF2XQwO wizH1x6nylVj6LjzSVYjT93uLPRuI6J2zfBwiCDTt1JnPT25nnf5U+ioUTOpwC4oGABH 3qjC52uPtnpgAsDdZle41Y9J0WOXS6jjPooe2XFwmSDFDITHkRBuqL5fidOhSttEcDgE HcihKIYcnodCrEbacw89JBPSs2Qa0/MxIbiZ09S4WH9+5mkRkLK48C/6PgG3azB4kQql aE7A== X-Gm-Message-State: AOAM532ZXJI0InREh8wECcWmN88CWyZ+zsLaWBkns7MNGB1rvbmGI9vn 9Rgik9vblx4NB9PFestu88GbcGq+IXf0TfJ9 X-Google-Smtp-Source: ABdhPJw3kZDPqfwH45IuCrd1sCDqukTAOjzY0CfjnkdxFervQbWLOo1ShI0DygIEsfHU913fVdRoyg== X-Received: by 2002:a17:902:c395:b029:da:9aca:c972 with SMTP id g21-20020a170902c395b02900da9acac972mr4407699plg.32.1607558034732; Wed, 09 Dec 2020 15:53:54 -0800 (PST) Received: from localhost.localdomain ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id s7sm4047693pfh.207.2020.12.09.15.53.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 15:53:54 -0800 (PST) From: Ajit Khaparde X-Google-Original-From: Ajit Khaparde To: dev@dpdk.org Cc: Samik Gupta , stable@dpdk.org, Lance Richardson , Somnath Kotur Date: Wed, 9 Dec 2020 15:53:32 -0800 Message-Id: <20201209235347.16180-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209235347.16180-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> <20201209235347.16180-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 02/17] net/bnxt: fix VNIC config on Rx queue stop 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" From: Samik Gupta This commit reconfigures a vnic's default ring if the current default ring is stopped by the application. It picks the lowest numbered ring that is currently active to be the new default, and issues the hwrm_vnic_cfg command to update the configuration. Applies to adapters that are not Thor-based. Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop") Cc: stable@dpdk.org Reviewed-by: Ajit Khaparde Reviewed-by: Lance Richardson Reviewed-by: Somnath Kotur Signed-off-by: Samik Gupta --- drivers/net/bnxt/bnxt_rxq.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index e0ec34216..61196eba9 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -557,12 +557,12 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) rc = bnxt_vnic_rss_configure(bp, vnic); } - if (BNXT_CHIP_THOR(bp)) { - /* Compute current number of active receive queues. */ - for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) - if (bp->rx_queues[i]->rx_started) - active_queue_cnt++; + /* Compute current number of active receive queues. */ + for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) + if (bp->rx_queues[i]->rx_started) + active_queue_cnt++; + if (BNXT_CHIP_THOR(bp)) { /* * For Thor, we need to ensure that the VNIC default receive * ring corresponds to an active receive queue. When no queue @@ -582,6 +582,22 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) /* Reconfigure default receive ring. */ bnxt_hwrm_vnic_cfg(bp, vnic); } + } else if (active_queue_cnt) { + /* + * If the queue being stopped is the current default queue and + * there are other active queues, pick one of them as the + * default and reconfigure the vnic. + */ + if (vnic->dflt_ring_grp == bp->grp_info[rx_queue_id].fw_grp_id) { + for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) { + if (bp->rx_queues[i]->rx_started) { + vnic->dflt_ring_grp = + bp->grp_info[i].fw_grp_id; + bnxt_hwrm_vnic_cfg(bp, vnic); + break; + } + } + } } if (rc == 0) -- 2.21.1 (Apple Git-122.3)