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 C8D3DA04DB; Wed, 9 Dec 2020 20:27:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F157CA32; Wed, 9 Dec 2020 20:23:05 +0100 (CET) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id AFDE8C9E7; Wed, 9 Dec 2020 20:22:56 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id f9so1657220pfc.11; Wed, 09 Dec 2020 11:22:56 -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=9PzNizc9U1DdhSspnLOvIwGQMtCcM4ukiufiC7APRkg=; b=W18wYEPorU/MfLYLEssCnh7roRThHJ3UiqWVRQRYmWOdKpJ5T1p1vhJ/N/2fNCnSC7 YAANzxGiuFLL0UDvb1+ZclIYuttlB4DX2gXdwY2eha4hHfiSkrX8NzJIf9xmp0nPWqyt Rn51fCFOnNIzngM61+vGX6BxmcjKjY80tkw4ZXzdqoCTUltuomRsMCTBoNSPO5FBNLOu Xp6Fx9k6OQv0f4heyFrtexr7uBLAiLYi+ZSCgbFSXDNHX7hQ1JgpzSnftDynQXWADHvR jxYwsE8MStqHPmDJMY6wPiE7rBrS3Pjv8QAZ0AlgfHJ5hca+f1mRU+3H+RN2qFUsLfEj Yk8w== 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=9PzNizc9U1DdhSspnLOvIwGQMtCcM4ukiufiC7APRkg=; b=d1xAeudAUWG0haq1leQvJDL3bdrrtmg7GPoKQB8rXXnrvq9LvXdaalDbA3Ibj2752c ZSUOkdwdUEUI0Zn52cpbqwWO0EMHL+WlcN1Zd0f7j+5/XRsfxsxtB3+wbYubUShzj9Pf 7msuagZ8Xuj5qJvJet5iwgNnV3BGVQGH+QskmQ5QhkNAeSqQ6/AnTnXwGhzUy+pje5wV +ztTb6F/vIsu3TpLBQjsQkBD7kpm3XPIbOBBJTgQPMG/kYsTWEb2ZJADGv2X/rR7KPes 70ATAGANQ/uyIqixzW64P4Z6+Fe69PIRfMDsooKA7j1MdIWO4IYX6/2sp+XcFn9yGNZS zkjQ== X-Gm-Message-State: AOAM532vO+1pmPopMSyd1ahAkN5eIlBSGQ/XiPsL/8dMAL3JHqHNprcJ 4zqDP5nODKZC45KJ+DkW7wSLu3cMMR33AP3n X-Google-Smtp-Source: ABdhPJwMEbpjK9xdCLNd3NAaU+dehOyiFDhQ9F+Czfk94UqmCCw1iT2hn0z2ucIL7vubfu9+fUpfhw== X-Received: by 2002:aa7:9af1:0:b029:19e:568e:c452 with SMTP id y17-20020aa79af10000b029019e568ec452mr3663399pfp.28.1607541775728; Wed, 09 Dec 2020 11:22:55 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y1sm3342449pfe.80.2020.12.09.11.22.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 11:22:55 -0800 (PST) From: Ajit Khaparde X-Google-Original-From: Ajit Khaparde To: dev@dpdk.org Cc: Kalesh AP , stable@dpdk.org, Somnath Kotur Date: Wed, 9 Dec 2020 11:22:29 -0800 Message-Id: <20201209192233.6518-14-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 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)