From patchwork Thu Dec 7 00:05:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13482500 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="GiFhWmG6" Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD4B310E9 for ; Wed, 6 Dec 2023 16:06:09 -0800 (PST) Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-77dd08f75afso4641585a.3 for ; Wed, 06 Dec 2023 16:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701907569; x=1702512369; 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=+mB9gUa23RohakNlMFBITu+1FaqVvCzODMcmo2iBtTA=; b=GiFhWmG6oojvGx0+tH09ogKNxL4jyvCnTJOLKYvxRyf6sPCIgWWgkCU6ixOPo1fl4U 1bZNoW0mywZ8dQoN6+8H0iDA3DJiqeL7dLw7sXKNJfuo5QTUugQ3L8S3jRpR4LMLMdKH BZ5H+6QUL4XvDEKOi/6qa5LEeUZsmJ+ZrMeTk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701907569; x=1702512369; 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=+mB9gUa23RohakNlMFBITu+1FaqVvCzODMcmo2iBtTA=; b=elV+NVi8Rh9d+PiEnT3tJRlKrpZjTm5cmI3tQ3Zt+s4kwreDwXH0u2ef5kosCIMU5L +pMpfLoEMTMyLSL4gfAwANZWYbSoMZLgxS/NTP+UUQO/0LERJJlij57LhOvFM0Hhl5Ec hw5WDLu2KMZ5r7FvKnTnoapILlfsseJ556ElhlOYpU9N85vE3OnZVOC09rJu+Su77g9I +LNy6+gq8V/7avFaPnPB2mHm+Ye5bFM8Mud0gf7W9JcbShpgbW4wkdAg9ZvDQSO6MG2n 7MY0NajhGudA0x+fG2SieRSplTXptTPZ2KCtVRa8GOj8fKqD8RYUgyIa7QUFnmMhh3rT JK5g== X-Gm-Message-State: AOJu0YzYc5HyN1L6bLuLVQRD2mhpQ1V3qvJGC4DQaVuRG3aN1pTlD52I 9UnSYi6DC7+eqVx8sxdF3ykGBA== X-Google-Smtp-Source: AGHT+IHyVHZOHrAl0SSERf9qI+0tT6m+tC5vw1YAT97HVRu+dd77WffLBA8GygYskM//NAQKJjlP2w== X-Received: by 2002:a05:6214:2ad:b0:67a:afde:81d with SMTP id m13-20020a05621402ad00b0067aafde081dmr1536219qvv.32.1701907568636; Wed, 06 Dec 2023 16:06:08 -0800 (PST) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id a11-20020a05620a102b00b0077d78afc513sm23091qkk.110.2023.12.06.16.06.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2023 16:06:08 -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 v2 2/4] bnxt_en: Fix skb recycling logic in bnxt_deliver_skb() Date: Wed, 6 Dec 2023 16:05:49 -0800 Message-Id: <20231207000551.138584-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231207000551.138584-1-michael.chan@broadcom.com> References: <20231207000551.138584-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); }