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 22B4CA09E9; Tue, 8 Dec 2020 21:12:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACECFC982; 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 C3165C8FA for ; Tue, 8 Dec 2020 21:11:43 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id y10so6089089plr.10 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=1DPiCQMmtWqEoY73vSlXeoeOjxf5AB88I8TCGzGUEq0=; b=bEh4yKly+Y8bdc3YLfP/EfL2drjMAVLFh1oDQn7WDSVWw9WXY3ej+CICK7L/TCQTKh s3Vu8qrF/JHlFwoHsaXazFunImAL/+HCmzIpAJHHYjTCCOVVsvP5qmb9gmaCLoili3d1 MXeWYOgx1gr3r9eEVsHIheOUoX+We+3+wdrhE= 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=1DPiCQMmtWqEoY73vSlXeoeOjxf5AB88I8TCGzGUEq0=; b=Rg8rvQaQ2iYW99fS3t1AgvwW4508Ce8aSIF228VIc7ozkao/9X06he+R4pZYsxSJRP AVfZCAteIUAQeJKHBBC5/nM2+CiqviAjF/BbMg1HLhsxOj3tU8RNdQwxjNHBuTIUi+bA Hvh1k0kt9YXbKK/qn0NfcIrXhCPeB93DwIHb0rqua+r0Z8PoaWeJoBucaJXQQOOrzDo9 k/xxe8DuVRiceG3oJFlaQhZi6N2chQ0wHXCeVXRpHWkZGZJIaZn7edqErhiNjsuzvVdJ M6KmPLQPSxyUxddweC6eOH7moe8XHqPi4071fb9eJDLdPlKVzSAFcGHGxoFA3uQ4tRy8 anXw== X-Gm-Message-State: AOAM533mR9fROchCkyBQDDKlb68KTtvRWN5JOkPZ3v7mQxpBq0qGu/Qp FQaDW4jTP23rSbhM/6dSPWaWzWRf8aaukSIiEIMDlSOhjWX4gsjPvFyu/Qohly/sRop/HVs2lB8 LLFgjdUIWNwizz8J9bYFZkLN5MGk/Mci0lf8XDkV8volaCU5s2QYN8rrI2Fy53wLFIA== 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-dev] [PATCH 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) -- 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.