From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 6D17941A914 for ; Fri, 9 Oct 2026 19:45:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791575126; cv=none; b=SC6wwg0vKsZpgVzbqT5st4HRcbWTr4gPt5qCxEfm8LXhzazaaQL8C+vNU3uOqNNCqsG/NSOb8yy69sVm5k03S/elEimo60y47HhaYJ4yNJgHc2wysoch5PuEX16bAkt6YUGueDVORlkToV/aG/UbqhIPHr18t3IfbpEUs78E8kM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791575126; c=relaxed/simple; bh=EloxsBTAFGMBBEvrMxew3OZ84oY2809c07/0bEzcf38=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IOEP24hqZwV4oUNVy5vrBUQbE+XX6mO58/JX7IVJdwFzahFKV3ZnbOJhJS5RyAWl9pI3ICiFvFzSgQLf/aBkmSetRGIfCpVPwS7lGJr37ETv3fXpnZVrMdkKPyoL4+7Lk2WWXNZM1Q0rUI3NeweYIYyqIJ7gFjVd8i4tSxEPbCE= 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=ejfygQK2; arc=none smtp.client-ip=209.85.214.169 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="ejfygQK2" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2dd9ec41bc4so420455ad.2 for ; Fri, 09 Oct 2026 12:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1791575115; x=1792179915; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:mail-followup-to:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zRktNQAINep5jabUt0Um43RJIzgR/yjHPucefqAmOec=; b=ejfygQK2nn5qCHhMJwV7MsO/8AtAu0S8FcCGpKndwEWBgMn1+77n4FVrFfrIM5i62V 1CbLz05BBF7qrvOLFqzhPvEpY6GcvZA2tINAtdbzyeDy6JCUc+1Zoxqa3+LBGJx+jMQ8 GY3zlV2EQnoHZNtE9EiE3UPLcvtMShKZSi3DoBo6dyjZHtIS+qXfnWmZohJzQpINjG3L hKABRUnVypZvLSzxHMvhFeCJW9FFfoGrFwDB0HEfquWzg5zMzvv18RRj36lO32JjDJ6C lu8WqyYIP4zLSM3tWb/Ggb9tnDV0i4GTqKHvrb24pHzpwZEseysJYOqT9yswKW+b39rj pSQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791575115; x=1792179915; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:mail-followup-to:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=zRktNQAINep5jabUt0Um43RJIzgR/yjHPucefqAmOec=; b=NNSoVhJQ3iuxnb1ogaeom54w9CfM/kHLDIhy0Cha7Fa7Ar2ZIfoXHeQIkLWtGs8jUf GKPsjErmeu8j6Hlyva2AshRRj+U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90b:1e4a:b0:3a7:933a:3195 with SMTP id 98e67ed59e1d1-3ab3a236a1bmr2644773a91.7.1791575115460; Fri, 09 Oct 2026 12:45:15 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:7::]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ab36ed0332sm5135080a91.3.2026.10.09.12.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:45:14 -0700 (PDT) Date: Fri, 9 Oct 2026 12:45:14 -0700 From: Joe Damato To: Michael Chan Cc: netdev@vger.kernel.org, Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , edumazet@google.com, horms@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH net 2/2] bnxt_en: Pad short SW USO segments to BNXT_MIN_PKT_SIZE 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 , edumazet@google.com, horms@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20261008191114.3736826-1-joe@dama.to> <20261008191114.3736826-3-joe@dama.to> Precedence: bulk X-Mailing-List: linux-kernel@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 Fri, Oct 09, 2026 at 11:33:07AM -0700, Michael Chan wrote: > On Fri, Oct 9, 2026 at 10:33 AM Joe Damato wrote: > > > > On Thu, Oct 08, 2026 at 10:26:06PM -0700, Michael Chan wrote: > > > On Thu, Oct 8, 2026 at 12:11 PM Joe Damato wrote: > > > > > > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c > > > > index ef04c9d08066..f87e02ef3033 100644 > > > > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c > > > > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c > > > > @@ -82,11 +82,14 @@ int bnxt_sw_udp_gso_xmit(struct bnxt *bp, struct bnxt_tx_ring_info *txr, > > > > if (unlikely(num_segs <= 1)) > > > > goto drop; > > > > > > > > + if (unlikely(bnxt_sw_gso_pad_len(hdr_len, mss))) > > > > + goto drop; > > > > + > > > > > > This looks redundant since you already have the same check in > > > bnxt_features_check(). > > > > It's redundant for skbs that go through validate_xmit_skb(), but generic XDP > > doesn't AFAIU. Not sure how else to handle this case, but open to suggestions. > > > > Did you mean generic XDP turning around incoming packets with XDP_TX > actions and transmitting them through the software stack? This path > cannot generate USO packets, right? Hm, I'm probably missing something, but the case I'm describing is generic XDP bouncing received packets back out with XDP_TX. I could be wrong (and if so I am happy to drop this if statement from the code), but IIUC generic XDP runs from __netif_receive_skb_core() after software GRO, so the packet it sees can be a GRO'd UDP packet with SKB_GSO_UDP_L4 set (because maybe the socket had UDP_GRO set?). The generic XDP path seems to keep all of the gso fields. Later generic XDP TX calls netdev_start_xmit without validate_xmit_skb being called and so gso_size could potentially be some tiny value. LMK if that makes sense? I think that's what happens and if so, it is a weird corner case that is probably pretty unlikely to happen so it felt like drop might be the most appropriate thing to do.