[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fa78f511-6a66-43fe-a41e-771f97ada21c@linux.microsoft.com>
Date: Tue, 18 Nov 2025 16:38:20 +0530
From: Aditya Garg <gargaditya@...ux.microsoft.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, longli@...rosoft.com,
kotaranov@...rosoft.com, horms@...nel.org, shradhagupta@...ux.microsoft.com,
ssengar@...ux.microsoft.com, ernis@...ux.microsoft.com,
dipayanroy@...ux.microsoft.com, shirazsaleem@...rosoft.com, leon@...nel.org,
mlevitsk@...hat.com, yury.norov@...il.com, sbhatta@...vell.com,
linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
gargaditya@...rosoft.com
Subject: Re: [PATCH net-next v5 1/2] net: mana: Handle SKB if TX SGEs exceed
hardware limit
On 18-11-2025 09:16, Jakub Kicinski wrote:
> On Fri, 14 Nov 2025 13:16:42 -0800 Aditya Garg wrote:
>> The MANA hardware supports a maximum of 30 scatter-gather entries (SGEs)
>> per TX WQE. Exceeding this limit can cause TX failures.
>> Add ndo_features_check() callback to validate SKB layout before
>> transmission. For GSO SKBs that would exceed the hardware SGE limit, clear
>> NETIF_F_GSO_MASK to enforce software segmentation in the stack.
>> Add a fallback in mana_start_xmit() to linearize non-GSO SKBs that still
>> exceed the SGE limit.
>
>> + BUILD_BUG_ON(MAX_TX_WQE_SGL_ENTRIES != MANA_MAX_TX_WQE_SGL_ENTRIES);
>> +#if (MAX_SKB_FRAGS + 2 > MANA_MAX_TX_WQE_SGL_ENTRIES)
>> + if (skb_shinfo(skb)->nr_frags + 2 > MAX_TX_WQE_SGL_ENTRIES) {
>
> nit: please try to avoid the use of ifdef if you can. This helps to
> avoid build breakage sneaking in as this code will be compiled out
> on default config on all platforms.
>
> Instead you should be able to simply add the static condition to the
> if statement:
>
> if (MAX_SKB_FRAGS + 2 > MANA_MAX_TX_WQE_SGL_ENTRIES &&
> skb_shinfo(skb)->nr_frags + 2 > MAX_TX_WQE_SGL_ENTRIES) {
>
> and let the compiler (rather than preprocessor) eliminate this if ()
> block.
>
Thanks for review and explanation Jakub, I will incorporate this change
in next revision.
Regards,
Aditya
Powered by blists - more mailing lists