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 D96D6A09EA for ; 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 891C4CA37; Tue, 8 Dec 2020 21:12:07 +0100 (CET) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 78686C9F0 for ; Tue, 8 Dec 2020 21:11:58 +0100 (CET) Received: by mail-pg1-f193.google.com with SMTP id v29so84943pgk.12 for ; Tue, 08 Dec 2020 12:11:58 -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=ydCBAxo/7W1gw1q+RkBsKoZB7s+Z+DI6/S1I8CtCZGo=; b=eRT92Y1NXeg0djPMfqPC5VYpZvl89l0lwCWbuU2PEc6sqMQcZXujDoOAck9iWNdRs3 BM208I5SB83ipDXEvc5DcY/iXZ9Ylxy/rkw2rfbND4w0aRlg+EERJDQuOV4B+6MKENDv TSTnCR/4ExO6ZUtlnoijpDe8FY490TtUsa5Dg= 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=ydCBAxo/7W1gw1q+RkBsKoZB7s+Z+DI6/S1I8CtCZGo=; b=uS+vjnOj4mqOtjH8xKiPtju/fRh7xHkii3XbDw46LOlxX+ooYtFdyCkLGrm3QX1WDx 6XL9NHL5JcHAf4qfskDwhLgwieUkzuEAG+aBvO70bRYim5kYOGL+beVmdAmgWehKoJ7H m9iR9pxXc+0n0IXTGxJ+PKjcxwu+8zfGqJiufPwK68TPoyScU2zQ5oLTAkvxC5xbpeyR j9UB9THNXUCAGgrNBLuWkxB6mM7mbWVvDYYaHYt+u3EdRCMn1miWqU/lO5DxAvz3KDZ2 wxofJcnWxEP7ph9EiYstmCnanEje5He2Y1fdU4xXtIz5UGITvzo8e6QL42/FuTiYXJbg OrdQ== X-Gm-Message-State: AOAM532hB4qXsiRJ6t8vx9GwyFVEi4nB0wJt2x/Pd34KDJt8rbllIuFE UKk5ly//c/rJUgBB6thiOHrMBLcNb1TvsLdgPi9+2bXhwHl+47q0MmRX/0OCLEcIgncksFEQKA= = X-Google-Smtp-Source: ABdhPJx0I4DJVXWH7HopHLj8U69ukzWaU9el/W0ZT49dbOT3ZKq/QbqXSeWtgys2PID/6sdFkgMtcw== X-Received: by 2002:a62:1409:0:b029:19e:14d1:efb0 with SMTP id 9-20020a6214090000b029019e14d1efb0mr9681379pfu.14.1607458316661; Tue, 08 Dec 2020 12:11:56 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x10sm5729187pfc.157.2020.12.08.12.11.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 12:11:55 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Kalesh AP , stable@dpdk.org, Somnath Kotur Date: Tue, 8 Dec 2020 12:11:30 -0800 Message-Id: <20201208201134.47844-14-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 13/17] net/bnxt: fix vnic RSS configure function 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: Kalesh AP 1. moved invalid VNIC id check to the beginning of the function. 2. removed a duplicate check which avoids unnecessary code indentation. Fixes: 49d0709b257fc ("net/bnxt: delete and flush L2 filters cleanly") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 42 +++++++++++++++++------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 6f5402070..cee2656c1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -4896,37 +4896,35 @@ int bnxt_vnic_rss_configure(struct bnxt *bp, struct bnxt_vnic_info *vnic) { unsigned int rss_idx, fw_idx, i; + if (vnic->fw_vnic_id == INVALID_HW_RING_ID) + return 0; + if (!(vnic->rss_table && vnic->hash_type)) return 0; if (BNXT_CHIP_P5(bp)) return bnxt_vnic_rss_configure_p5(bp, vnic); - if (vnic->fw_vnic_id == INVALID_HW_RING_ID) - return 0; - - if (vnic->rss_table && vnic->hash_type) { - /* - * Fill the RSS hash & redirection table with - * ring group ids for all VNICs - */ - for (rss_idx = 0, fw_idx = 0; rss_idx < HW_HASH_INDEX_SIZE; - rss_idx++, fw_idx++) { - for (i = 0; i < bp->rx_cp_nr_rings; i++) { - fw_idx %= bp->rx_cp_nr_rings; - if (vnic->fw_grp_ids[fw_idx] != - INVALID_HW_RING_ID) - break; - fw_idx++; - } - if (i == bp->rx_cp_nr_rings) - return 0; - vnic->rss_table[rss_idx] = vnic->fw_grp_ids[fw_idx]; + /* + * Fill the RSS hash & redirection table with + * ring group ids for all VNICs + */ + for (rss_idx = 0, fw_idx = 0; rss_idx < HW_HASH_INDEX_SIZE; + rss_idx++, fw_idx++) { + for (i = 0; i < bp->rx_cp_nr_rings; i++) { + fw_idx %= bp->rx_cp_nr_rings; + if (vnic->fw_grp_ids[fw_idx] != INVALID_HW_RING_ID) + break; + fw_idx++; } - return bnxt_hwrm_vnic_rss_cfg(bp, vnic); + + if (i == bp->rx_cp_nr_rings) + return 0; + + vnic->rss_table[rss_idx] = vnic->fw_grp_ids[fw_idx]; } - return 0; + return bnxt_hwrm_vnic_rss_cfg(bp, vnic); } static void bnxt_hwrm_set_coal_params(struct bnxt_coal *hw_coal, -- 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.