From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 6BD0D376479 for ; Mon, 30 Mar 2026 16:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774889616; cv=none; b=Zce+Jifq4b7K1P+Gi/KC2MLMEhHOywSlPytrTnizpiTwfcFqL0/F1VCUMwhnc+t3rLHsfPaImPEnzSXajyUKxIytIY1+ljuMHFprlBYmjwEVydc83eevcnQ1LFKkepbqVRJk8ZrwyQwSMWXs7+mVu1M9fiKKVNIY2uuFmEP/PAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774889616; c=relaxed/simple; bh=ZbLN6tiDZAtL9QunsGUH8Hnlgt4gphbqagiH7nSCUCg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qDn29IDgSkmc9N5UJgrIJsIMUdqmcVh5UBIcs8AyYJa1uTI47Z6yKKFb23UK7NbwEL9TnzRtxxO3h+A9HWiy0JWiGHIw9vTlX9tdo+aFUVXSazhoT8XHN/D34tHoAHNcwz9/7/0HWthytFdbSXwS+685sA3HVz0FoVT+wuDH/rA= 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.20230601.gappssmtp.com header.i=@dama-to.20230601.gappssmtp.com header.b=kZRQALIc; arc=none smtp.client-ip=209.85.214.180 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.20230601.gappssmtp.com header.i=@dama-to.20230601.gappssmtp.com header.b="kZRQALIc" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2adff872068so19480895ad.1 for ; Mon, 30 Mar 2026 09:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20230601.gappssmtp.com; s=20230601; t=1774889615; x=1775494415; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=SsPHeBxmNzNHe7NLwlikS/LmdLqYQXVEehPrQIj9X+8=; b=kZRQALIcD1rzNdukz6+QyLBzGWid/mfo57RwriiYKfJxbv6dSUrT2XmxfF4CdhmS6y ZJ4qMu/Bo638avMzKi1vDkPi5B+QDgdm9vuzDEisLSjnX3z0/NPS7s8yBr9ptqmhYgOp jBv9ghbsZtquEAum9q3tWYmzjY6K4KZ9dl3eSg2YmHjCY3ZyMa+BJJaMjG26L+n7DD1y NAplg5DPFAT2WU4a6x62J+Ynsq36J6gFVRL+KL1ozhfcQV0Xbt/so6d3pcl5xPxtcuY3 g1nMFTwxU8KzXZptzdFekGD6BsIRrWu7MU2GMGou4DejVZkpVoYgpN0dQWSSsgLgdp4/ o0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774889615; x=1775494415; h=in-reply-to:content-disposition: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; bh=SsPHeBxmNzNHe7NLwlikS/LmdLqYQXVEehPrQIj9X+8=; b=jwN5r2nLotS3msdllPYIuyY/9QkDamgslwgQ7O2Ga/cFDGlfDtTHPJEpPMR2x5GQT4 JCxYWnqV7CijfVD3XtEz5TsleprKLR/+U2Xk4SryhvNcFZ7du0VhMEe+bPj1KGHt74Ol 9Pw5OsI9Ot4DScAWMb40HkyO5LM9ozaIkg83UcJziGmxuHZlcqDV7kEs/tQ5QwuvFJZb rT3/mET+2cBDF+g+FWlvwlNQ6eunOMllnzYNH9N3d6qqCoT4IytDnhIz0yI+Q36sc1LG d7ATBviIwFgysw3Kz60HN3ycT6LkU74UVfaaHAtPTMKtDMKsN++Y9d7GGg+jW9AvHZXC uCmA== X-Forwarded-Encrypted: i=1; AJvYcCWjel2W1B+xSu1fP9iWY0WMI9DvmOwaMuAON01XyEAchrRl5pG8s67TKfKjWCO/dK7PUH2hapsqCz5uh40=@vger.kernel.org X-Gm-Message-State: AOJu0YxWDZU3RG66taawtJlGROrtYW82MNz6B7nOZnty0ZNIzOX5c0qq 3E+Ca8C2f03biJMjgujXd915sNONKihio/0GVj12zKXGkj0w1/n3MD59nH2yFZPJl2hrqq91yx0 MjQSBZ7Y= X-Gm-Gg: ATEYQzwFRiacC/nsY6iZCtc3ff/iHfqyh6npr/VfMKBvjCpXVUZV1Kp/yQaP4uZFKBF 7oV3fNjoOgYzIvYz44OSLGa/SwWrlaRANeHZhz+3+CEUwLeuxcyvPWWgcTY+QfvNel1adqMjX/L uRy932WSf2WxuhexT/7H1r8VjyprytGCBQjAb5PYzlk/MTT068kP25+hgc6rPLoew6E1iKYtuJR jBwEkM+vXM7edx6taC7iuem6RkCS8U7pied3O0hZ/a33Y/OOfvWagTPnxiHOiDCAvGDGdEx3trM Qxf17ThAuC0O7IKfX+rsoTGGO63qzMQEltbh+k8uM2w/NTPUr2Vrt4lb3A/o+K9Y3heb/TCZ2xA MVLW6AbqQCqpxucDK66oRErAcnAR849WY4kD0hABPww2Jmr0DtZSL+9GyydoIe1YYRewQE12VaQ He+JuQ X-Received: by 2002:a17:903:46c4:b0:2b2:5840:808e with SMTP id d9443c01a7336-2b25840867dmr27494265ad.10.1774889614687; Mon, 30 Mar 2026 09:53:34 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:50::]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b25ca51aefsm10131965ad.16.2026.03.30.09.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 09:53:34 -0700 (PDT) Date: Mon, 30 Mar 2026 09:53:33 -0700 From: Joe Damato To: Jakub Kicinski Cc: netdev@vger.kernel.org, Michael Chan , "David S. Miller" , Eric Dumazet , Paolo Abeni , andrew+netdev@lunn.ch, horms@kernel.org, pavan.chebbi@broadcom.com, linux-kernel@vger.kernel.org, leon@kernel.org Subject: Re: [net-next v6 08/12] net: bnxt: Implement software USO Message-ID: Mail-Followup-To: Joe Damato , Jakub Kicinski , netdev@vger.kernel.org, Michael Chan , "David S. Miller" , Eric Dumazet , Paolo Abeni , andrew+netdev@lunn.ch, horms@kernel.org, pavan.chebbi@broadcom.com, linux-kernel@vger.kernel.org, leon@kernel.org References: <20260326235238.2940471-1-joe@dama.to> <20260326235238.2940471-9-joe@dama.to> <20260329152016.27646fab@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260329152016.27646fab@kernel.org> On Sun, Mar 29, 2026 at 03:20:16PM -0700, Jakub Kicinski wrote: > On Thu, 26 Mar 2026 16:52:27 -0700 Joe Damato wrote: > > + /* Upper bound on the number of descriptors needed. > > + * > > + * Each segment uses 1 long BD + 1 ext BD + payload BDs, which is > > + * at most num_segs + nr_frags (each frag boundary crossing adds at > > + * most 1 extra BD). > > + */ > > + bds_needed = 3 * num_segs + skb_shinfo(skb)->nr_frags + 1; > > + > > + if (unlikely(bnxt_tx_avail(bp, txr) < bds_needed)) { > > + netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr), > > + bp->tx_wake_thresh); > > + return NETDEV_TX_BUSY; > > + } > > + > > + slots = BNXT_SW_USO_MAX_SEGS - (txr->tx_inline_prod - txr->tx_inline_cons); > > + > > + if (unlikely(slots < num_segs)) { > > + netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr), > > This looks sus, try_stop() will evaluate the bnxt_tx_avail(bp, txr) > and leave the ring running. Yea, I think the slot check can actually be removed entirely. Each segment consumes 1 inline slot and at least 3 BDs. BNXT_SW_USO_MAX_SEGS is 64 and the ring's minimum size is 2 * BNXT_SW_USO_MAX_DESCS (420). Using 64 slots would consume at least 192 BDs, so the check above would fire first. I think as long as the ring size is constrained by the code in fix_features and set_ringparam then this if block can be removed. > > + bp->tx_wake_thresh); > > Is tx_wake_thresh larger than the max USO even for smallest ring size? Yes, it is. Maybe its worth adding a comment in the code somewhere to make this more clear? Not sure where would be an appropriate place, but maybe bnxt_init_tx_rings?