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 B8F0BA09E9; Tue, 8 Dec 2020 21:16:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B9A1CA32; Tue, 8 Dec 2020 21:12:06 +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 D770BC950 for ; Tue, 8 Dec 2020 21:11:57 +0100 (CET) Received: by mail-pg1-f193.google.com with SMTP id m9so13206564pgb.4 for ; Tue, 08 Dec 2020 12:11:57 -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=sZAcDBgkksUSYauHI9bABm7FFGXtOiUqMDjQSbk7hE4=; b=U5fHjhw/s7mes6oXQz/TB5WnM3/JsoWrMpIYA25N/1Qmb1spWnLdihL5XZbicQxCwC +wp5BpU/CAtu20xOVUQazIEk8O9cyE/ieMJUSbK0tSU62bAYsPwXTZj61ALLcEAJfzNG hVG+lC43A8OSvOn1YmwjorlJ7g8+ovJ89qem0= 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=sZAcDBgkksUSYauHI9bABm7FFGXtOiUqMDjQSbk7hE4=; b=KQ8O18BqkJxQUTe/ziY84DpdAXdPNeymG7lQdGR8bxzUd5rLMP2DileYs+BkuUk1RN 1C309EeR5QZO6XRpn6lkKBK41J2rlctXf/6Q+RCL8UymXORtRUUCYoUKvOk5jlA3q/y1 hDPXtUCMNOaXfnU14s6sS14CGJe6dD+YNxjNwSv/Crlt+ha3+1Z1ovDq3rolkCM5V9ml Wx4Ndpd9HAlADTn8OFLU/NjS9zj2hJ+cVwwXJPY/skprsHdG5Uh7BXz6m1ZCcEq0DXcF oQrKWIxxpFtHckYf07oyEf9PYmXUcc/K8d/LpY0a35E1Kqa5yKD/rqYzfcsTscChOiah KHUw== X-Gm-Message-State: AOAM530iIyJyNTYWEin+XD7mA9+rQpxC2XdkOR+FmREhJk20YbJUjn0I 2uRr0MI8eOt1cTsskzp6rxdAgborEd9mj3LGhfSyiJcebpahuyzuQ1EWlLt3I6vhN3SWZ5EpVYA lE2VKK5oe3f35z6PA5oXdE11fyn3P4wYEKAOWb/zQlM/UmIfPjIrANEOjxzt9QMaDeA== 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-dev] [PATCH 13/17] net/bnxt: fix vnic RSS configure function 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: 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.