From patchwork Tue Dec 5 23:44:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13480874 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="HLZE+tSw" Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 816ED18B for ; Tue, 5 Dec 2023 15:44:29 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-77d6b28aa9aso417415485a.3 for ; Tue, 05 Dec 2023 15:44:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701819868; x=1702424668; darn=vger.kernel.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=3v7nQAZ/o1oMxvh2SOa6aPUCXJcA8Pml3tMPIXUrIlk=; b=HLZE+tSw3z4jol7w9CWO6cJYFn1m2NF6adOGY2R2mdhlvixcVNMCYZczaL4lnilC2F VIxYBbUWEmRinumw/ZN2RMH18GNrtFllSWmxCGM1Gnb4DWBUnFBw3mdCaZi3fTIetzvI BjUdg03X2flIfJQ6nxV3eAxfj3nXKwMWSxTxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701819868; x=1702424668; 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=3v7nQAZ/o1oMxvh2SOa6aPUCXJcA8Pml3tMPIXUrIlk=; b=Vm0/3e2o0jZbazm7VxCqmxN2YrFumhXsQpIY6QuzUblwkGBihCybl6ic9YmZAwj0zw RfiQFy0jgxzbeU6BqoiKUmSwhrnWMuOg4HOBUrNsKo6iPHRv2NqXt9u+51QpBg493C/6 wccLhsObvuw1vquYtLbbx2eIreo+urFUhtlrn0OJv/GLdLQv7KiWxgy4/3LG9XDpAzlL ddW9JttjwD4+WPj4JnyZQFeImcQub4mOA6LKE9dOOl0ExP5pNpbbDzEHqPw+yefgZ3zh MX9I0qXM2iMfeeZ9m13qh8sxK2a6HcNJLkPhiKfU76jMQYEzEBZgzku4faNveYaqxw/q llxQ== X-Gm-Message-State: AOJu0Yx/l87E95J3uXau7R88AbnazZYjjhpLXY1BZvPsJnqCLSJP4BRM oKdZgD/8hg2zIWYnmy5bbR+Pqg== X-Google-Smtp-Source: AGHT+IE3AEZa0WV3P/5uVm+s0T9ygp/kY5lhS4rgqO8AzMR9AjgZSn+lMZ5ZWjX5firQAqBFzKZIRQ== X-Received: by 2002:a05:620a:3951:b0:76d:2725:f36f with SMTP id qs17-20020a05620a395100b0076d2725f36fmr61966qkn.71.1701819868156; Tue, 05 Dec 2023 15:44:28 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id y15-20020a37e30f000000b007788bb0ab8esm5450429qki.19.2023.12.05.15.44.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2023 15:44:27 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Sreekanth Reddy , Somnath Kotur , Andy Gospodarek , Vikas Gupta Subject: [PATCH net 2/4] bnxt_en: Fix skb recycling logic in bnxt_deliver_skb() Date: Tue, 5 Dec 2023 15:44:02 -0800 Message-Id: <20231205234404.17501-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231205234404.17501-1-michael.chan@broadcom.com> References: <20231205234404.17501-1-michael.chan@broadcom.com> 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: Sreekanth Reddy Receive SKBs can go through the VF-rep path or the normal path. skb_mark_for_recycle() is only called for the normal path. Fix it to do it for both paths to fix possible stalled page pool shutdown errors. Fixes: 86b05508f775 ("bnxt_en: Use the unified RX page pool buffers for XDP and non-XDP") Reviewed-by: Somnath Kotur Reviewed-by: Andy Gospodarek Reviewed-by: Vikas Gupta Signed-off-by: Sreekanth Reddy Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 72f2fc983940..b4a5311bdeb5 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1748,13 +1748,14 @@ static void bnxt_tpa_agg(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi, struct sk_buff *skb) { + skb_mark_for_recycle(skb); + if (skb->dev != bp->dev) { /* this packet belongs to a vf-rep */ bnxt_vf_rep_rx(bp, skb); return; } skb_record_rx_queue(skb, bnapi->index); - skb_mark_for_recycle(skb); napi_gro_receive(&bnapi->napi, skb); }