From patchwork Fri Dec 8 00:16:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13484498 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="g8HP4mby" Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805C019AF for ; Thu, 7 Dec 2023 16:17:26 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6d9e49ea4bdso307967a34.2 for ; Thu, 07 Dec 2023 16:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701994645; x=1702599445; 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=QPRFq3+2Q3Zal6GslCEmGg2pbRuDnfnW024J8m0KcAg=; b=g8HP4mbyYsoMJxZqWdUOu7RWnitCHhEiHqXDdq+S5ZkCpiyc8/sSjTRGX0VJmFyS6j FCV0IscNCZczmsyB9AI72EFF7CennwKGL6zU+BUMUVPYHetygIsiBDaoncX79Nghx2wR 9JhfZkgZGFtnyJffa7lOAv0yAuJSAIiW3oJog= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701994645; x=1702599445; 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=QPRFq3+2Q3Zal6GslCEmGg2pbRuDnfnW024J8m0KcAg=; b=rx7qfq03d1lC5ocslFmJ5qAUbMpTZBrxmZkpwgC1jRNYfZfAo/OOEKKxMdEWqm20v3 U/Gl5Z9YsN0dlSnjuNpmIOKOFx0xHOGQLvA3mXgNrAjse3R0/d8u+9AT4T1VKgZe+teo iJ9PQyMdb2L50CBnTcJvW+n8NjYUzugmfOd+jsGfMksKekIwC+9uXtfc6IKT0YmRkA3U RtUqd+ECePXnhDa3G2IQlSz04E5ak2aDoKCiC2dAFcPvGOhGOtJfJn3G98GNdt6TOJZP JsJv1zHw6yowBQdJqyVs2V+PYCY1JYFQjwTZemqEQRlfU8bHwnXVHIpufPV49kDz5cPD 3RkQ== X-Gm-Message-State: AOJu0YzLWiBU/VmGQDKp91OEZgg4u+W0WSRK7BUzUul14tsJM4n9wiNz 4cXso6Ki1nGypxI6z6KcIQ1+tg== X-Google-Smtp-Source: AGHT+IHjV+p1ItDpLNX2tazbMP+jg94WqdLl5wK9kCQUsihXQ/miSpnq7lXN+gCH7MkgTbKULDm1Pg== X-Received: by 2002:a05:6358:93a3:b0:170:17eb:1de with SMTP id h35-20020a05635893a300b0017017eb01demr3337849rwb.33.1701994645039; Thu, 07 Dec 2023 16:17:25 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id o4-20020a056a0015c400b006cdd369e3d0sm356493pfu.201.2023.12.07.16.17.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2023 16:17:24 -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 v3 2/4] bnxt_en: Fix skb recycling logic in bnxt_deliver_skb() Date: Thu, 7 Dec 2023 16:16:56 -0800 Message-Id: <20231208001658.14230-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231208001658.14230-1-michael.chan@broadcom.com> References: <20231208001658.14230-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); }