From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2F36A0C4C for ; Mon, 12 Jul 2021 15:09:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A95154069D; Mon, 12 Jul 2021 15:09:37 +0200 (CEST) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mails.dpdk.org (Postfix) with ESMTP id 1D1134069D for ; Mon, 12 Jul 2021 15:09:37 +0200 (CEST) Received: by mail-wm1-f47.google.com with SMTP id i2-20020a05600c3542b02902058529ea07so11481153wmq.3 for ; Mon, 12 Jul 2021 06:09:37 -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=6ksC3fXbAsLZtyesCxuJyvLcm1inqXYDPAiLDWFvxF8=; b=VrZ8QxtJ+s3yBMjPoUFsUDao3e+lanJ/DqIpt/nfimfFKCe7eYMefloj7PfYa5MAO8 SG2/7FGorKm0VvOLjdE03BFrQDK0aff2kY+EwbgcaqhbjBPecG17q3HaafgSLWR89cYz qi5bXNwpRotnW1TLAJCGBY9JwO4eZiboeqAbgVNZ2G5bemaEz02Ykixhy03+xHk9PtbH zWarZY6GZzLGwDrwIe243Qy/o1CjQtyD3cavxE6Oc7g0D1CB3T+oozUkG8y814NJb65j 6pRzvhRG8bVjC+mPt9ivjJBbPu1viM+7l4zBaegmxU5d0Q/dXQYb2ZjrY31s4b8Ywpfl bKTg== 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=6ksC3fXbAsLZtyesCxuJyvLcm1inqXYDPAiLDWFvxF8=; b=glNG8SacB/0kjBWRvE1We9wK/lpJ9jIy07BWFSK6xcSwXh3cynD7qA094y7r/iynKn rjm/AhDs9qV1Hq8YOVPDfLw/Wbp4Z45YVcSkZHN94Txbsqxkp6OtY1kVsMdmj6RV29OW bIq7Cl9VjTOWax5dP0YgCvx+rgLmtvp5eY6+7uBgKZNGzP45fflAuCnF3eMztKee9YGh JGRs2tDZfLPMqX4CXYK3WhYI6suOyqUIHyThFvAcyvTrlAilulFUsiXY0PAFDkw4i7X5 rDQgQpCmMn0fTV34HQ2x+sRhAMNYjIjDBYOGERRos+xisTJmRa7pq3g/33G1QShpzBUw aHnA== X-Gm-Message-State: AOAM531vtxV1vVCYH8V1tmrFM1wx9XFD444MqWXtStAnTVBc7EJDQ6Uh VV1Mu3+akfhWFZn30qsaMUA= X-Google-Smtp-Source: ABdhPJz2uc+sSEANWNjSXyLiIrVjSsevNFjs+SuL9hEI2RIHYJqbet5ELtlyBeVdc87zxNVac6YI0A== X-Received: by 2002:a1c:4405:: with SMTP id r5mr17148016wma.181.1626095376917; Mon, 12 Jul 2021 06:09:36 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id g3sm10861262wru.95.2021.07.12.06.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:09:32 -0700 (PDT) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Somnath Kotur , Ajit Khaparde , dpdk stable Date: Mon, 12 Jul 2021 14:04:06 +0100 Message-Id: <20210712130551.2462159-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix error handling in VNIC prepare' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/2f6cc4ff5f580eee7aa247558219352c7425120b Thanks. Luca Boccassi --- >From 2f6cc4ff5f580eee7aa247558219352c7425120b Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Mon, 31 May 2021 12:56:39 +0530 Subject: [PATCH] net/bnxt: fix error handling in VNIC prepare [ upstream commit 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 ] Resources should be freed on error conditions. i.e, VNIC and VNIC context created in HW and memory allocated in bnxt_vnic_grp_alloc() should be freed. Added a new function bnxt_vnic_destroy() to do the cleanup. This lightweight function can be used in flow destroy/flush path to avoid duplicate code as well. Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_flow.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index 83b92845a2..1ef6009bc7 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -919,6 +919,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, return l2_filter; } +static void bnxt_vnic_cleanup(struct bnxt *bp, struct bnxt_vnic_info *vnic) +{ + if (vnic->rx_queue_cnt > 1) + bnxt_hwrm_vnic_ctx_free(bp, vnic); + + bnxt_hwrm_vnic_free(bp, vnic); + + rte_free(vnic->fw_grp_ids); + vnic->fw_grp_ids = NULL; + + vnic->rx_queue_cnt = 0; +} + static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, const struct rte_flow_action *act, struct rte_flow_error *error) @@ -949,8 +962,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, goto ret; } - bp->nr_vnics++; - /* RSS context is required only when there is more than one RSS ring */ if (vnic->rx_queue_cnt > 1) { rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0); @@ -986,9 +997,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, goto ret; } + bp->nr_vnics++; + return 0; ret: + bnxt_vnic_cleanup(bp, vnic); return rc; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:37.445679941 +0100 +++ 0011-net-bnxt-fix-error-handling-in-VNIC-prepare.patch 2021-07-12 13:41:36.190116361 +0100 @@ -1 +1 @@ -From 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 Mon Sep 17 00:00:00 2001 +From 2f6cc4ff5f580eee7aa247558219352c7425120b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index d23f8cff6c..03c71732e7 100644 +index 83b92845a2..1ef6009bc7 100644