From patchwork Thu Feb 8 17:13:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 136546 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A47B43AE1; Thu, 8 Feb 2024 18:14:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF73242E63; Thu, 8 Feb 2024 18:13:44 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id D9F7340273 for ; Thu, 8 Feb 2024 18:13:42 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6d9f94b9186so52144b3a.0 for ; Thu, 08 Feb 2024 09:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1707412422; x=1708017222; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=dly0MEkgCBsHlqOFaZT+sNc9znn4AWPiGFTD3r/FLCE=; b=PNIXefENpfCenzIXSVvY/nyRO3pFqkK8UGwtPP4xioIwhoKD/v2xpRgOaNL2AY2+Wi /Tk1vrt/9+dYZyb4FEpR+lllwfe6KyKGnbSGz5zBLdBzHM+K3VyIyPzSHCM7BwM0h+iG 1YOnTTes22Vuo9Vnq4U4ZgA9+xpZQGWbs74WM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707412422; x=1708017222; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dly0MEkgCBsHlqOFaZT+sNc9znn4AWPiGFTD3r/FLCE=; b=WP7k2QmJ5yP1TV8ev7DqmMl2sUo4qOVhzp4sWVqnYzywaez6ysOm/r5m5L2FTmqRlY VWa/yOwJuFpfpntQs3uKrt7L5/IUqMkeJAhPv4rkCWcfkvtnno8Im+K3fPKhvioyNrPI 9he9M4XtVx/f9t5r8gh1iCOMDSPF2u0wuyZ6Lrmuo8HmbyhW4OuRm836XmciqUMJsrb5 12uJsxdNm2RA1onARgaQvE769FrzXG71V4zm/om3fB8fLpFNgf8wKUU6b0nKc5umOQ7s LHLiaxlmwZB1DQCpkSaenazioEOkFqTe5K8VeLjtNnDRNDim1kJ8aRQDGkTawRRHzR3L lUgw== X-Gm-Message-State: AOJu0YxRz57HW3e4AkphVLF61JPnS7r4iIqt1iZLKMprvS5Jf/CFcIcY +0C8P4dJgQovbi6Y1IodqM1cKBOSWTsg0eXFQLPGYDT9UQojsu9OG8zTruPIKjA+9gObZBxNza3 GZPhNM8gumdSV0fmLe2aH8Xn0N3EVNZ6nslycUUewZ3gcnnJuiK7Yh3HlVtY6EejX0CS+qhIxDw p8BIY9bgMH4s+M4ihwbJxvIwrmwaU4 X-Google-Smtp-Source: AGHT+IGe5KQHy/vemi/M9W66LmHoBxi219+XrMCENUecv38t6+qb5NEhNVvPWfJtm8YwuAh2psAIPA== X-Received: by 2002:aa7:85d6:0:b0:6e0:35e9:a78e with SMTP id z22-20020aa785d6000000b006e035e9a78emr6316997pfn.21.1707412421028; Thu, 08 Feb 2024 09:13:41 -0800 (PST) Received: from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id p15-20020aa79e8f000000b006e0527ffe88sm3966204pfq.213.2024.02.08.09.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:13:40 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Damodharam Ammepalli Subject: [PATCH 4/7] net/bnxt: cleanup vnic ref count Date: Thu, 8 Feb 2024 09:13:27 -0800 Message-Id: <20240208171330.31139-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240208171330.31139-1-ajit.khaparde@broadcom.com> References: <20240208171330.31139-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Damodharam Ammepalli Cleanup vnic ref count when port is stopped. When vlan strip is set/unset the current active vnics are destroyed and recreated with VNIC id provided by firmware. The default vnic at index 0 still has ref_cnt=1 while rx_queues are reset to 0, which fails the check under bnxt_vnic_rss_action_free() Resetting the vnic->ref_cnt in bnxt_free_all_hwrm_resources() post FW handshake in clean-up path. Signed-off-by: Damodharam Ammepalli Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 397b4a0e05..1d523d6dec 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -3584,6 +3584,8 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp) rte_free(vnic->fw_grp_ids); vnic->fw_grp_ids = NULL; + if (vnic->ref_cnt && !vnic->rx_queue_cnt) + vnic->ref_cnt--; } /* Ring resources */ bnxt_free_all_hwrm_rings(bp);