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 6496DA0C47 for ; Tue, 10 Aug 2021 17:40:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F7364014F; Tue, 10 Aug 2021 17:40:51 +0200 (CEST) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by mails.dpdk.org (Postfix) with ESMTP id AC2AB4014F for ; Tue, 10 Aug 2021 17:40:50 +0200 (CEST) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 9434E3F0A4 for ; Tue, 10 Aug 2021 15:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610050; bh=6lQu6R6WYvICvZmTEa918g602WrHr4piRsS/CI+Hje8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TDM6Lzo1PtC5R6xrnIKkMHSGQTneGBKfPHAMxboPkD7A2vUzTU3eNmeIG/JYHLFao JDg0Rv9mquro3x/5NRk/QMXB2Jsf1i1LVWPQcxWgsI/ExAV6A1PpJiiC9VRogtSZzQ EDt1WTa68g1Jjq2Dux8pgwkNUtCdgH4VFa8zUlxydsFSmhfOEOrwr1hse5Jd3ErxfA OTjcpRbUYS56Mxuop0Wbkh93lboeDasniQGjvlkII0l9zZjv+6w1e00VeINHDM02zC +4QqbRM6KYIn/EpAC4hpHk0ecknaHLlNrGqHiNeDKvfses7NLhgXNrij6ujcImsNuN q58pN4xUy0iog== Received: by mail-ej1-f70.google.com with SMTP id zp23-20020a17090684f7b02905a13980d522so5748737ejb.2 for ; Tue, 10 Aug 2021 08:40:50 -0700 (PDT) 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=6lQu6R6WYvICvZmTEa918g602WrHr4piRsS/CI+Hje8=; b=XO3k1kfFhteVUrBKEqbfPivVx6eSE5uPJxOInBD46jYsClRc6I4gfwf0p4S1hsiGdi 1rDlUNYLVr4rbLUlXssB6B4hYHtT2kaMvXmA1J1qcAl0QIoNeZnatgC//xJ6Mc5+O7Lx IwIjhThIQn/EquzZJUqlWc39yfOe8Inn8PsygXhPdDtJFwjyq0YuQ/JmEwZE9ygJWARZ FFgfqGqM0AWQklCCT25Z50m+RnOW+4ZccsYz9cjduoHE5hyGJg6dP8MfcKoIJgFlkBmV 8eBYrJ7zFG7Ib/iTVFGsd4nfhmDofz7kw1yO724rBuI0x3VeqjMPATDJxJCXaQypw5mV kbdg== X-Gm-Message-State: AOAM531/GtAn3Mla4xaq+HYBpl5pXvzH8e+Iccd1esJ9U/RqsWOHBsnl /VA1/oNWbz6OSOxlc7jbAjVxCfcRHbN0kdf4tvzlWtgKCErjbIS1jQbCcYnN+N4FV8QtdsOJyAW RI0MinehZDxYCJgGcqTwElkQi X-Received: by 2002:a17:906:a883:: with SMTP id ha3mr2063887ejb.215.1628610050274; Tue, 10 Aug 2021 08:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpjLtFtAIqUiveJ2OTpzb+p2WkhSKghilTBuiYiT0gwvAS4teHIKtm6yi6EpyOfYSIfLElNQ== X-Received: by 2002:a17:906:a883:: with SMTP id ha3mr2063863ejb.215.1628610050043; Tue, 10 Aug 2021 08:40:50 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id i16sm9725499edr.38.2021.08.10.08.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:40:49 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Kalesh AP Cc: Somnath Kotur , Ajit Khaparde , dpdk stable Date: Tue, 10 Aug 2021 17:38:46 +0200 Message-Id: <20210810154022.749358-6-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.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 19.11.10 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 19.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/12/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/ec9a4839b5a2e2c53cab9e52d8d8518c5529e9cd Thanks. Christian Ehrhardt --- >From ec9a4839b5a2e2c53cab9e52d8d8518c5529e9cd 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 c3f360d47a..82203c2411 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -916,6 +916,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) @@ -946,8 +959,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); @@ -983,9 +994,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.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:13.317989320 +0200 +++ 0006-net-bnxt-fix-error-handling-in-VNIC-prepare.patch 2021-08-10 15:11:12.898637234 +0200 @@ -1 +1 @@ -From 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 Mon Sep 17 00:00:00 2001 +From ec9a4839b5a2e2c53cab9e52d8d8518c5529e9cd 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 c3f360d47a..82203c2411 100644 @@ -28 +29 @@ -@@ -919,6 +919,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, +@@ -916,6 +916,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, @@ -48 +49 @@ -@@ -949,8 +962,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, +@@ -946,8 +959,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, @@ -57 +58 @@ -@@ -986,9 +997,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, +@@ -983,9 +994,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,