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 08470A04DB; Wed, 9 Dec 2020 20:23:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 81468C97A; Wed, 9 Dec 2020 20:22:47 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 41367C926; Wed, 9 Dec 2020 20:22:42 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id o5so1811701pgm.10; Wed, 09 Dec 2020 11:22:42 -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=gigQk4+WOD+UR0x14lcqgbJ9Hdm7u1+H5WNBk+BY73qGD/98SO6IR/Y8VmwtiN4Udm o4SL7NSDojFCqW1J835sglXH/3oxnv4e49FC3Hp5dP+a2GklZ8F6+4gEiUpyA6WIm0TT Y3bqk3nav1x2AR/s7bw/3J7/6DyVHo6fcioWleCRgZ48NxU7oHb0CQ5K7SPtWc3joPjP ySBnufq0xZw/MewQ4zbV3NgZqy0pVxMcX8LmUmOSKo7atFh6e9V0cvaqiVOOy6f8c68w DntLx25sfGo17zZLDm5uKkNsBup70zCaYEGrXK9aYrxLK31BIzybNfHBuCj+MV8nwrfm RGdQ== 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=J+EiO/+nvqeNryUcOzpWAb96rxUjU0YWDjE1D/E7S+bUazLR2gTR4tIY/oSryQ4R2/ 97UWqzh/01tpr3XlDgSygWgb/4MBE84EMxqbyL+qfX/IftrArU5fLzd8NG5TSsNRaFuB 9SMVDYzzruPg5JmOZ0sVlaWFk1nys+LaAzeiNjkU9AxerZw735aPkZbANBKHbgA4vDRA SuV4XO24PK/Nz5XOIR678dLtJEcNT9omWxU6Xke97ykZkGD4n0s/uZe8qMFKVX4mH6gP usyZZPEYtQLhgSESKrAoXRhsqW6NKQHZZX75ZZrw7N3ckOo+wIx6u5WQDy8nJOC0qPuz /EkA== X-Gm-Message-State: AOAM533cI7bHag13vCl0/dZZziMo37Kev//xBdFjt9Z8/05/jnBB7Uv5 UjXoqwavuNoxqB7t4ReUXhciaf5rUw/aZZTf X-Google-Smtp-Source: ABdhPJx+oKsCGbTF8zQLpFH3CE1L6PfxEf2iXj1l4LrjuADBv6oKPExK/Nk2foE0d69kT5/x48De7g== X-Received: by 2002:a17:90a:db4e:: with SMTP id u14mr3494202pjx.184.1607541760976; Wed, 09 Dec 2020 11:22:40 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y1sm3342449pfe.80.2020.12.09.11.22.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 11:22:40 -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 11:22:18 -0800 Message-Id: <20201209192233.6518-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209192233.6518-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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)