Why not replace NETIF_F_UDP_GRO_FWD and NETIF_F_GRO_FRAGLIST with the same trick used by NETIF_F_UDP_GRO_FWD and rename it NETIF_F_UDP_GRO?
Subsystems (2)
Quoted 9 lines · Shi Xudong
i understand:
- bothNETIF_F_UDP_GRO_FWDandNETIF_F_GRO_FRAGLISTis off - no UDP GRO;
-NETIF_F_UDP_GRO_FWDis on,NETIF_F_GRO_FRAGLISTis off - classic GRO;
- bothNETIF_F_UDP_GRO_FWDandNETIF_F_GRO_FRAGLISTis on - fraglisted UDP GRO.
and
Plain UDP GRO forwarding even shows better performance than fraglisted UDP GRO in some cases due to not wasting oneskbuff_headper every segment. but i have a question?
Why not replaceNETIF_F_UDP_GRO_FWDandNETIF_F_GRO_FRAGLISTwith the same trick used byNETIF_F_UDP_GRO_FWDand rename itNETIF_F_UDP_GRO,
What trick are you referring to?
Quoted 2 lines
implement local input and forward using plain UDP GRO packets, because "Classic" UDP GRO shows better performance when forwarding to a NIC that supports GSO UDP L4.
There are three targets for UDP GRO
1. local sockets
2. forwarding without hardware offload
3. forwarding with hardware offload
Non-fraglist is preferable for 1 and 3. But at GRO time it is not possible to distinguish between 2 and 3.
This discussion is largely independent from the below bug report. Those need a narrow fix, not a feature change.
Quoted 43 lines
________________________________
[email protected]From: Willem de Bruijn
Date: 2024-04-07 06:35
To: Shi Xudong
CC: [email protected]; [email protected]
Subject: Re: fix bridge,bonding,team: advertiseNETIF_F_GSO_SOFTWAREand extendNETIF_F_GSO_SOFTWAREinclude NETIF_F_SG,NETIF_F_FRAGLISTQuoted 18 lines · Shi Xudong
According to https://github.com/torvalds/linux/commit/2e4ef10f58502323ea470bc30ba84d5ddd4e77f0
bridge,bonding,team seem to use
netdev_increment_featuresto fix logical netdevs'feature,cause them to lose theNETIF_F_GSO_SOFTWAREfeature (unless the real netdevs have theNETIF_F_GSO_SOFTWAREfeature).In addition, plain UDP GSO/GRO, like TSO, also relies onNETIF_F_SG. UDP fraglist GRO/GSO also depends onNETIF_F_FRAGLIST.
Therefore, the following two modifications are recommended for bridge,bonding, and team:1.netdev_features.h
#defineNETIF_F_GSO_SOFTWARE(NETIF_F_ALL_TSO|NETIF_F_GSO_SCTP| \
+NETIF_F_SG|NETIF_F_FRAGLIST| \NETIF_F_GSO_UDP_L4|NETIF_F_GSO_FRAGLIST)
2.netdevice.h(quoted diff) +1
-1-/* Allow TSO being used on stacked device : +/* Allow TSO/USO being used on stacked device : * Performing the GSO segmentation before last device * is a performance improvement. */Quoted 6 lines
static inline
netdev_features_tnetdev_add_tso_features(netdev_features_t features,
netdev_features_tmask)
{
- returnnetdev_increment_features(features, NETIF_F_ALL_TSO, mask);
+ returnnetdev_increment_features(features, NETIF_F_ALL_TSO|NETIF_F_GSO_SOFTWARE, mask);
}Thanks for the report.
Happy to respond, if you don't mind me cc:ing the public [email protected] list.
The list has more experts on this code, and such discussions are better public and archived for later understanding.