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 4E4D8A09E9 for ; Tue, 8 Dec 2020 21:11:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B3E6C974; Tue, 8 Dec 2020 21:11:47 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 5E12DA3 for ; Tue, 8 Dec 2020 21:11:43 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id x15so7557708pll.2 for ; Tue, 08 Dec 2020 12:11:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=qnn/CA2dwbZUD/wRDvrakjzgjk+swreuP2sFn2iKmL8=; b=ZoNb2q2Vp51ZENl80RT1zoQiMhcmXIJlqB4SjGHucuTHHjI6wpWHUOhD4li4nT4IrO wLnYRNsttfe8Yq9WUIJMUgJ580TXob+aAN1jOZIFXUTzK5z7LMNy93mfkvzy43ZR2aAe 6rr5sQaCaDHba36WIkMZTJz4sV/2zPBaZZ6q8= 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; bh=qnn/CA2dwbZUD/wRDvrakjzgjk+swreuP2sFn2iKmL8=; b=h9gAJfVcLSQkTF1m293zp7VVVmSEjO+Z2VVJv1/ot5/0307SkIGPWzUVCTPWZjKQz4 GQTIfmFp8t1oEQXQ7EL9iRm+cufayMf0Vu25sOS+ipkO2wyLE8h2GJAZgWXpxZDtpQCP ScjCbRO8QUhpndC5cAnh78snWeGiHbmyHzSn5OEPTVugBCiALc33u+Oc7wgigZCago4k WrqHP0k3JjC5wp5y4M5kSWvn+CCdTQMu+qozetqNCKaGBZdJWqS6cGVSlQxClgUfMVSD fmRYg0fFg4m405U9vwMkD25IkiJ1jAdYL0alcaFd6w9fR43VFSI6mkPhzHBPhca2xh2+ //4A== X-Gm-Message-State: AOAM533S9YjLfcQNiuc+sBAUsIkUr95vZDsSTi+xqU6/u+oJIJ/vQQ5E oKb1k9U4vRrCDFfsW0zyELWyI7Mw/Kik+tmAhAuWck6+z6uTJBQr5JwXnM0nORtEpA5JnPNKtA= = X-Google-Smtp-Source: ABdhPJwc91gCR0M1Va0Hqq3faWNu0Z6mmAvXDjR3Ga+6lbtZoSHn6RvRzlxSD5W5C6QSpgo2kGNjOA== X-Received: by 2002:a17:902:8a93:b029:d9:d4a5:dc3c with SMTP id p19-20020a1709028a93b02900d9d4a5dc3cmr22260833plo.19.1607458301478; Tue, 08 Dec 2020 12:11:41 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x10sm5729187pfc.157.2020.12.08.12.11.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 12:11:40 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Samik Gupta , stable@dpdk.org, Lance Richardson , Somnath Kotur Date: Tue, 8 Dec 2020 12:11:19 -0800 Message-Id: <20201208201134.47844-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201208201134.47844-1-ajit.khaparde@broadcom.com> References: <20201208201134.47844-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-stable] [PATCH 02/17] net/bnxt: fix VNIC config on Rx queue stop 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" 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) -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.