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 33C5CA00E6 for ; Wed, 10 Jul 2019 16:24:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F4665680; Wed, 10 Jul 2019 16:24:22 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id C6CC2231E for ; Wed, 10 Jul 2019 16:24:20 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id p10so1355421pgn.1 for ; Wed, 10 Jul 2019 07:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=2Yirjc9V2H1+46XYiTVrkCwW9ZMPuq3tsReh7R0i3KI=; b=EhkVYgSEUEcM/mw29KaNK+3nX+QI0Tiudpr8yBcNup+ag5M27veSXo/VUjCbMOQUJm +IqtMaAmWQSwsPB8wJatlCidH/0oJoIknO0GYLln3t7sUbnZ1ev3CuVDN7U3oLiGmFHm /DekJshIVhb1VU2dXsXuQOkNQh/8UzzTZ4e8w= 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; bh=2Yirjc9V2H1+46XYiTVrkCwW9ZMPuq3tsReh7R0i3KI=; b=dYXitOqh3R7K4EMnfJU1lNCWhAiiuJaxoHWqMOCtDh+4E6pco1qQPT7i+T8ShOXJZw prQP9OcNpziHbkQKxhyCvkxp/9awC0baakTJIB8JojXZhC7ijl+YSBAVhnMpW/FS88S/ tzx0+bUSdAWCwtl1hn1agE6z4NMv3QPTro0L7k08aEpflZqs55VFl9uPE/SKpzd+kZBY TjtNXmpAYOcKJFFwy1EwGu5rTuQqeoHXTJ37yGd5MqSwUhfjvJvc+9ItkjRDh5eOJRgJ v/2VmkYUeA3gK66p7jUcjf6IWUmpBsA7Suyw3sAeiXyVWkR4KFYEk4dL4jV8cfV/XeFM EL4w== X-Gm-Message-State: APjAAAU+u+BQvstaOWb9kWdxxICVPMtK/wq/DzOseD404hGxngzZjsPn h37M1jWRQXXdhGXnw2tvrkY7HGG4MwMwA3ARQfWPwqXwIkiu5gJS5B8gOQrpKuV9vAflIEN6pJC P+Dl7ZiODroEVek/ZGK27GCrWPTzexHdUE/vVDRFhtzSNhGvVUS2pgwkF9diPzErl X-Google-Smtp-Source: APXvYqz/+RWeQvh39GyxQLOkqiiSW2v3X9UCV2uDR4OST7/gOIi/gLNNEDJfHYGnrB1TuO+ydsWrDQ== X-Received: by 2002:a17:90a:26a1:: with SMTP id m30mr7462565pje.59.1562768659891; Wed, 10 Jul 2019 07:24:19 -0700 (PDT) Received: from lrichardson-VirtualBox.dhcp.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id r9sm4883796pjq.3.2019.07.10.07.24.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 10 Jul 2019 07:24:19 -0700 (PDT) From: Lance Richardson To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com, Lance Richardson Date: Wed, 10 Jul 2019 10:24:09 -0400 Message-Id: <20190710142409.5618-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/bnxt: fix logic error when freeing RSS context 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" The conditional used to determine whether freeing RSS contexts for thor vs. non-thor controller was reversed. Fix this, also reset number of active RSS contexts to zero after release in the thor case. Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers") Signed-off-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 696974c83..71f03775a 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2312,12 +2312,13 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp) bnxt_clear_hwrm_vnic_filters(bp, vnic); - if (!BNXT_CHIP_THOR(bp)) { + if (BNXT_CHIP_THOR(bp)) { for (j = 0; j < vnic->num_lb_ctxts; j++) { bnxt_hwrm_vnic_ctx_free(bp, vnic, vnic->fw_grp_ids[j]); vnic->fw_grp_ids[j] = INVALID_HW_RING_ID; } + vnic->num_lb_ctxts = 0; } else { bnxt_hwrm_vnic_ctx_free(bp, vnic, vnic->rss_rule); vnic->rss_rule = INVALID_HW_RING_ID; -- 2.17.1