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 B6CB6A04DD for ; Wed, 28 Oct 2020 11:48:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF873C9C0; Wed, 28 Oct 2020 11:48:27 +0100 (CET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by dpdk.org (Postfix) with ESMTP id C7325C9FE for ; Wed, 28 Oct 2020 11:48:25 +0100 (CET) Received: by mail-wr1-f50.google.com with SMTP id w1so5162962wrm.4 for ; Wed, 28 Oct 2020 03:48:25 -0700 (PDT) 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=Tgcoj+q/HufSn7G13CmdQ7qowVLL+BgZ1GVJ0QkvjtE=; b=c5EGhYoevQR2KbqBTNrEb/RpXtf58pbRPlFbDcbsTm0QRIVNqyqo3i6l8pIvtytahk ZeGn9BCEY0YMAMasyqJkOkla5uVPdviKtAXDKuJq0Tev4ij4/DU7EAXlEDSb2v+PpUcr LXw0frzy6BC4UTfSlA+qzO3oJCH6NU3xKcG9o/cTVQSKiA7ziLAx+8Ob2Z+VxHl7lXxT R3WS+cQkVXIGjB5luR74TXlKrfKxdexF5uK2/Nf3QNXMDz0yixA3WsXYGtOtrdzwPzTr HRPMXl4/OCMGMk1wvtmqbSUddeQiL7XHTdJx30+FTUkeuAMHRWA13I1ySv29dnDEl5Ko oUNA== 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=Tgcoj+q/HufSn7G13CmdQ7qowVLL+BgZ1GVJ0QkvjtE=; b=St0PhFjA9IkXWVPn+BNY/LcfWAG5DzFwT67jRJLdVurUcxo6Stok6S3PqJGZYBxNUJ pr5VYg1m+Zt284Kk8TzMyRZef/UPvWwNR2sQuQcY9B0ibgbew/JHP23AVqc6WizEVTwl tcdpkvQCthjcTsnND8a5IXSFqcnu4wsN1OLDGSqlDJKTNYE3VQtFGGOJJZb1eu+Gf1ca +7sZJywSVHYSZ1c/WSPJZX/P22go9ny4vHpXoo4QzLRrm4Gs/cVRsXoh1g2iKrxwEdpc 5heZutgfyDnKn2r6Js4izi0Ka5Vyc0Ycuk0kJOQ8zoD1VWYI+X1p4OsHikclUzvwehYd Aiaw== X-Gm-Message-State: AOAM531EL2DhMvb2JkdriZk7c2a+mFdqC/F3zlEIcRaNZBfSCZG2pvqV o17lJic9SJl6mFDTU3JwlXSmPDn4jzPsB2Lw X-Google-Smtp-Source: ABdhPJwpObKwbANRl+9PBI9JEZAeK2oKZIbQVjRHDDFKJQzUCz/Fowjxy981MqbG3RM+Hu2Y3spx7A== X-Received: by 2002:adf:bc13:: with SMTP id s19mr8366438wrg.338.1603882104558; Wed, 28 Oct 2020 03:48:24 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x65sm6128935wmg.1.2020.10.28.03.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:48:23 -0700 (PDT) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Ajit Khaparde , dpdk stable Date: Wed, 28 Oct 2020 10:43:23 +0000 Message-Id: <20201028104606.3504127-44-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix checking VNIC in shutdown path' has been queued to stable release 19.11.6 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" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 590892526b436a852d0af36e55be8e15e110a1f1 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Thu, 10 Sep 2020 18:56:02 -0700 Subject: [PATCH] net/bnxt: fix checking VNIC in shutdown path [ upstream commit 4b029f02de3a0ce9cdd9a3475b84ca2e42d74281 ] Add a couple of NULL pointer checks in bnxt_free_all_filters() and bnxt_free_vnics() respectively to guard against certain error injection/recovery scenarios where it was found that the application was crashing with the bp->vnic_info pointer being NULL. Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array") Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_filter.c | 15 +++++++++------ drivers/net/bnxt/bnxt_vnic.c | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c index 622a9bb417..f4b18d5b84 100644 --- a/drivers/net/bnxt/bnxt_filter.c +++ b/drivers/net/bnxt/bnxt_filter.c @@ -81,6 +81,15 @@ void bnxt_free_all_filters(struct bnxt *bp) struct bnxt_filter_info *filter, *temp_filter; unsigned int i; + for (i = 0; i < bp->pf.max_vfs; i++) { + STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) { + bnxt_hwrm_clear_l2_filter(bp, filter); + } + } + + if (bp->vnic_info == NULL) + return; + for (i = 0; i < bp->nr_vnics; i++) { vnic = &bp->vnic_info[i]; filter = STAILQ_FIRST(&vnic->filter); @@ -94,12 +103,6 @@ void bnxt_free_all_filters(struct bnxt *bp) } STAILQ_INIT(&vnic->filter); } - - for (i = 0; i < bp->pf.max_vfs; i++) { - STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) { - bnxt_hwrm_clear_l2_filter(bp, filter); - } - } } void bnxt_free_filter_mem(struct bnxt *bp) diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index bc054a8e0e..ef07721148 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -78,6 +78,9 @@ void bnxt_free_all_vnics(struct bnxt *bp) struct bnxt_vnic_info *vnic; unsigned int i; + if (bp->vnic_info == NULL) + return; + for (i = 0; i < bp->max_vnics; i++) { vnic = &bp->vnic_info[i]; STAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic, next); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:13.164340871 +0000 +++ 0044-net-bnxt-fix-checking-VNIC-in-shutdown-path.patch 2020-10-28 10:35:11.504830024 +0000 @@ -1,33 +1,34 @@ -From 4b029f02de3a0ce9cdd9a3475b84ca2e42d74281 Mon Sep 17 00:00:00 2001 +From 590892526b436a852d0af36e55be8e15e110a1f1 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Thu, 10 Sep 2020 18:56:02 -0700 Subject: [PATCH] net/bnxt: fix checking VNIC in shutdown path +[ upstream commit 4b029f02de3a0ce9cdd9a3475b84ca2e42d74281 ] + Add a couple of NULL pointer checks in bnxt_free_all_filters() and bnxt_free_vnics() respectively to guard against certain error injection/recovery scenarios where it was found that the application was crashing with the bp->vnic_info pointer being NULL. Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array") -Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- - drivers/net/bnxt/bnxt_filter.c | 14 +++++++++----- + drivers/net/bnxt/bnxt_filter.c | 15 +++++++++------ drivers/net/bnxt/bnxt_vnic.c | 3 +++ - 2 files changed, 12 insertions(+), 5 deletions(-) + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c -index d822ff607c..6d85983242 100644 +index 622a9bb417..f4b18d5b84 100644 --- a/drivers/net/bnxt/bnxt_filter.c +++ b/drivers/net/bnxt/bnxt_filter.c @@ -81,6 +81,15 @@ void bnxt_free_all_filters(struct bnxt *bp) struct bnxt_filter_info *filter, *temp_filter; unsigned int i; -+ for (i = 0; i < bp->pf->max_vfs; i++) { -+ STAILQ_FOREACH(filter, &bp->pf->vf_info[i].filter, next) { ++ for (i = 0; i < bp->pf.max_vfs; i++) { ++ STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) { + bnxt_hwrm_clear_l2_filter(bp, filter); + } + } @@ -38,12 +39,13 @@ for (i = 0; i < bp->nr_vnics; i++) { vnic = &bp->vnic_info[i]; filter = STAILQ_FIRST(&vnic->filter); -@@ -95,11 +104,6 @@ void bnxt_free_all_filters(struct bnxt *bp) +@@ -94,12 +103,6 @@ void bnxt_free_all_filters(struct bnxt *bp) + } STAILQ_INIT(&vnic->filter); } - -- for (i = 0; i < bp->pf->max_vfs; i++) { -- STAILQ_FOREACH(filter, &bp->pf->vf_info[i].filter, next) { +- +- for (i = 0; i < bp->pf.max_vfs; i++) { +- STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) { - bnxt_hwrm_clear_l2_filter(bp, filter); - } - } @@ -51,7 +53,7 @@ void bnxt_free_filter_mem(struct bnxt *bp) diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c -index 326c0d1b6d..9a135ae881 100644 +index bc054a8e0e..ef07721148 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -78,6 +78,9 @@ void bnxt_free_all_vnics(struct bnxt *bp)