From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 DFAC74C77D9 for ; Tue, 9 Jun 2026 17:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781026480; cv=none; b=k8KwcQPgAPW9j+rlvX8JQ2Huc7KKnNoQqSX1jVRPwNqGE0TeJKJxEzp7jk8aAFbZ9Ayx3BC18k5CvAUdujIQfbzEvmJi3e+V+OOq90p7XYTrd4knTLu731QmlgPxtL6l+no6B9Ilx03nmBrjx6rU3C+zCM91j6i1UP7h/RK0aP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781026480; c=relaxed/simple; bh=8N7XuyRU6c4ER45QABIfU6iv2y0qjX2rwhUyYzCewtw=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tk2Gri+fBmiDnZ3G3FqGHlWOaewAi8VKPbwydiU2WmHd3BRlrEcwZ+cuX5yHxXDtSa/lfVOBs29gBrPpzdWZdyAC3zTCwNe+I8acFy00ievcHnk6B8466BdQb5EEe55dUFLzEPbBuMwGFyjp/KkzzXQ9vpammtjlyc8dTCbVbXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b=OpZ1b/mA; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b="OpZ1b/mA" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-c858b5de728so3757965a12.0 for ; Tue, 09 Jun 2026 10:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1781026478; x=1781631278; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=H0O37JLU9+UUO6RjfEV3qnVTJcbwi/sCUYtuia8QZ84=; b=OpZ1b/mAM7il9uLaDmV2dJfnKy7q0QPThcx2nA6IjX8bxsh6e7XaTsXd+Wof6Ww5Ap Y1WLFpxOgzjlLXSuzXP5+TDlJ71nFcdbNpxZKMvuWgVx3VuZ/JN1eaDKeedW/+syCUA0 tYgrE4GHaYtKFnwneCV3rWaqVNq/2eYhg5szLbsYhgLiKX1lZgTeaSNQKrt5fvXF6FI8 5eYa9eDXbSA7X6v3kmmoqXM20Um+z+mzTic4dqPtH3fsgcX1k3MX7CasgmGiphY3bIxZ 01kNywJk0sGhDcfJ+ceQs09n816BXtMDBYMPNkSQQwc5jaTe7qbus5l6Pj0TafgLFfF4 G57A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781026478; x=1781631278; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H0O37JLU9+UUO6RjfEV3qnVTJcbwi/sCUYtuia8QZ84=; b=me5XWjF/fOsnj8lysJjCohgPb/1OFgJ8GaZIlndTRJDbRHWpsrU0K4y1Y3m3hHjjRr BgBUK+CQuZjhO4+/NyLguiU347IiNDgijMQ94Ri3PEbANuF1xFdl4/TaXsHfmR4uwfYo p1D9UEfFZAr5fNppFWLIXUkgYyGxZdlXXUt5/vaA32nRO/dfuIjyJMjkSmbpZUe3EfnS V54NB3SxsY6+Xtk9XzhfcAeVwDcNLT1YYObIxAtZBIhxJ05DnuTcm88CF4nDOKBoftt9 NxkU8U23SEPiGwTjpPcFaD/3aeXz8+pw/bU0gGsq7xAFRHojuOs7gK/vctBMn/DJ40Hw 3f/g== X-Forwarded-Encrypted: i=1; AFNElJ/WdnkeKWAXHOZXQOLCwaRYZsiQPlwTJHXrKA+FPrJqGynEOyqUS1tvjN+LTU/6OIV6/19/3DU=@vger.kernel.org X-Gm-Message-State: AOJu0YwEx+lHyZ2kY2oR1mUpOPB7TBcrhDQ/GXw/eFIX1Wke7j8KySvC N9DxGKcVbboOziDWXFDWISmeUpzPNmtoJ9AIZnDuF9Qno67lchXi1oizpYntvd3tzHA= X-Gm-Gg: Acq92OGP9dCayXr5Y2z4gjdE5bNRVJnopPfdo5ntNPlnIlnkb2vngvPlbqWMJXcMB0L 09Qz3bSdbSNJvpE/DRkatSTKEhix3G4YYox1o4lGFr54C/+EQVazKFuODSk3XKoBp3U5gm/m8k1 5O6FtqnAYkL4eUHe6yuH7FJqQ3Bk41qdG96ZbfbFg+7I2CL+oStpJK+K1SwtH/mc9t04SSWLEil MMyf1RWe0r9mlUWk28qjk0vdTB6/B6s3x2FMzD4aW9Yu9gW8GTp0xowRUdg8+6+p8QqRPSlsBWx hInzKGAy+KTIDncXZlVdWVNoYVhGlp8zOdAkOsErsLQLrnzZCoPauq3XMvel7ViyMOW7N6C3I1D cJw/v7fhlN1NgJ1xwPVClmccH5xLD6T2srI5mThhy6lP1r3SgQcjtTjqzYWht4CjowF1G1TDdir ArimQXAc/Vb1jncqM= X-Received: by 2002:a05:6a00:908e:b0:842:459b:d61b with SMTP id d2e1a72fcca58-842b0f90d88mr21560405b3a.32.1781026478050; Tue, 09 Jun 2026 10:34:38 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:12::]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-842828e5638sm22758898b3a.50.2026.06.09.10.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 10:34:37 -0700 (PDT) Date: Tue, 9 Jun 2026 10:34:36 -0700 From: Joe Damato To: Michael Chan , netdev@vger.kernel.org, Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Somnath Kotur , Andy Gospodarek , horms@kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH net] bnxt: fix head underflow on XDP head-grow Message-ID: Mail-Followup-To: Joe Damato , Michael Chan , netdev@vger.kernel.org, Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Somnath Kotur , Andy Gospodarek , horms@kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org References: <20260608203129.920104-1-joe@dama.to> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Jun 09, 2026 at 10:22:12AM -0700, Joe Damato wrote: > On Tue, Jun 09, 2026 at 09:44:17AM -0700, Michael Chan wrote: > > On Tue, Jun 9, 2026 at 7:51 AM Joe Damato wrote: > > > > > > On Mon, Jun 08, 2026 at 09:22:07PM -0700, Michael Chan wrote: > > > > On Mon, Jun 8, 2026 at 1:31 PM Joe Damato wrote: > > > > > > > > > > To fix this, we need to do a bit of math to recover the offset if this > > > > > is a page fragment since it is not passed into rx_skb_func > > > > > (bnxt_rx_multi_page_skb, in this case). > > > > > > > > I wonder if we should add an offset field to struct bnxt_sw_rx_bd to > > > > simplify things for page mode. Struct bnxt_sw_rx_agg_bd has the > > > > offset field for a similar purpose. Thanks. > > > > > > I don't mind doing that, but I wonder if that's better material for net-next? > > > > > > In other words, we get the minimal fix in (this patch?) and then do the > > > cleanup and struct tweaking as a follow-up in net-next? > > > > > > I could definitely be wrong; I had just assumed patches for net were supposed > > > to be as minimal as possible. > > > > I think some minor refactoring/struct changes to make the fix > > cleaner/simpler should be fine for -net. I think the total number of > > line changes should be about the same either way. > > OK. Are you OK with changing the signature of rx_skb_func? I was going to add > offset as an argument so it can be passed through. Oh, actually nevermind. I think once offset is store in the struct we can derive like this? frag_start = page_address(page) + rxr->rx_buf_ring[cons].offset; And then the signature doesn't need to change.