From patchwork Wed Jul 3 18:01:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13722656 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54D8EF9D4 for ; Wed, 3 Jul 2024 18:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720029746; cv=none; b=VpJf1IC9LLP0iB44eZLpG82f99bVZ6V/dLNzBluJ/tGWZkSaERe31vUiq365UI31kKbxlWo9OoZ/Vx3Wv3vVGdl0m9w+iLYDh98cFYQ/Hpf5qSEMXSyRGZhqSAGU2ZZOVp4PtEM4f+/W85ndviziibT8H69qwxao6+cqUpjHQSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720029746; c=relaxed/simple; bh=F9nHxlnyXHVV5RIFTG6aBn32HRMhciXjX3eJfj7oG/I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=J+GL1/WVZsTvNeU7JRKYNPuNZKfHbH3bN2IkFdROEN+L0m+SQ97t3uwlDT+M2Akc+X1VvW89TV3w4b/Tq5cF+U6AiduJGFDMWh9+VtnOpV3KPocYENdkQfrParXiq3ftXZAH3CVss3C3vLbdIuJUk1vG+Sg9cY2swS6aLfQq658= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=dgeSCjgS; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dgeSCjgS" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6b5d6ba7c90so10839746d6.1 for ; Wed, 03 Jul 2024 11:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720029743; x=1720634543; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=rB6dcb5WZZlPSUIDBnbEUmItfLs1hpxNG1MYaLccRsQ=; b=dgeSCjgSZWMzif93ODJUxacGcxg178dlBkuuoRChmm7XhSWoJU46ZQDvzEwB//+LR7 SVDjDVgYdH4/axrVuDlbNdFT9rUL6IfRIQeNzBo4tBJRE5OWVHu2z6N5BtnzZRBDuEZz s7LFM9U7KZx9cyrfpuxfUufjY0zkTM/93OhFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720029743; x=1720634543; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rB6dcb5WZZlPSUIDBnbEUmItfLs1hpxNG1MYaLccRsQ=; b=ffAWz1aKQFKY0qzxrggBJ0IGFklWki73qX95Bl7Q2aI88hV4UqTlWxDfhlhlgGpxJs uYXZVhfqQArRRol1+GRjd/0xkftj4Vn3byP+K9FvLrLWZmRcBq6OrR1cFW9JYrnrUElT XfynR2MXZrkPhXjnLPz6bNHPS9nRAAXqnEMoCxFD4MbBlr3Cn1lc/44rPBDIpgpWJW+a e+bMwKXlU62Ip+1I2OH9dJoFvb9IIMcGpJRws3zuhIQApuPxpwT1ucLHwTamDUIPD1oJ SGaQFZ2rQvH8lNNi2bBL4ZzuLs3rUEeMDDQVak3+IczzFz8jk4fEm4bTlX42HJicVxFJ BXxQ== X-Gm-Message-State: AOJu0YxVmDXMF4RHeMHA5F796jlkeuTs4mtakiUkNMjMyRuN2PLdBLuB ddQn2u742NUSt3lz48VTUq8nHMy8423wtC2QLmNLbVMsmpzWadPe9NosXxTHkg== X-Google-Smtp-Source: AGHT+IGuhX0zfF1yHujGenJ83iPbKcIOkVAlODYf63eqwBFFbqCuvPg/UhkrcIKikn1oW0lIxgQPKQ== X-Received: by 2002:a05:6214:dc1:b0:6b2:b11b:c326 with SMTP id 6a1803df08f44-6b5b716a36amr143463426d6.48.1720029742850; Wed, 03 Jul 2024 11:02:22 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b5c516069fsm28492466d6.121.2024.07.03.11.02.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jul 2024 11:02:22 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com Subject: [PATCH net] bnxt_en: Fix the resource check condition for RSS contexts Date: Wed, 3 Jul 2024 11:01:12 -0700 Message-ID: <20240703180112.78590-1-michael.chan@broadcom.com> X-Mailer: git-send-email 2.43.4 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Pavan Chebbi While creating a new RSS context, bnxt_rfs_capable() currently makes a strict check to see if the required VNICs are already available. If the current VNICs are not what is required, either too many or not enough, it will call the firmware to reserve the exact number required. There is a bug in the firmware when the driver tries to relinquish some reserved VNICs and RSS contexts. It will cause the default VNIC to lose its RSS configuration and cause receive packets to be placed incorrectly. Workaround this problem by skipping the resource reduction. The driver will not reduce the VNIC and RSS context reservations when a context is deleted. The resources will be available for use when new contexts are created later. Potentially, this workaround can cause us to run out of VNIC and RSS contexts if there are a lot of VF functions creating and deleting RSS contexts. In the future, we will conditionally disable this workaround when the firmware fix is available. Fixes: 438ba39b25fe ("bnxt_en: Improve RSS context reservation infrastructure") Reported-by: Jakub Kicinski Link: https://lore.kernel.org/netdev/20240625010210.2002310-1-kuba@kernel.org/ Reviewed-by: Andy Gospodarek Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Reviewed-by: Simon Horman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index a6d69a45fa01..53085058100c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -12669,7 +12669,11 @@ bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx) if (!BNXT_NEW_RM(bp)) return true; - if (hwr.vnic == bp->hw_resc.resv_vnics && + /* Do not reduce VNIC and RSS ctx reservations. There is a FW + * issue that will mess up the default VNIC if we reduce the + * reservations. + */ + if (hwr.vnic <= bp->hw_resc.resv_vnics && hwr.rss_ctx <= bp->hw_resc.resv_rsscos_ctxs) return true;