Skip to contentSkip to conversation

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?

DISCUSSION Willem de Bruijn 1 participant 1 message Apr 30, 2024 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CA+FuTScLvHFVqC-kqWdR9fWaLc_S=7SGMEhq09kKgZDQ0AtAfg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 9 lines · Shi Xudong

i understand:
- both NETIF_F_UDP_GRO_FWD and NETIF_F_GRO_FRAGLIST is off - no UDP GRO;
- NETIF_F_UDP_GRO_FWD is on, NETIF_F_GRO_FRAGLIST is off - classic GRO;
- both NETIF_F_UDP_GRO_FWD and NETIF_F_GRO_FRAGLIST is on - fraglisted UDP GRO.
and
Plain UDP GRO forwarding even shows better performance than fraglisted UDP GRO in some cases due to not wasting one skbuff_head per every segment. but i have a question?
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,

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: advertise NETIF_F_GSO_SOFTWARE and extend NETIF_F_GSO_SOFTWARE include NETIF_F_SG,NETIF_F_FRAGLIST

Quoted 18 lines · Shi Xudong

According to https://github.com/torvalds/linux/commit/2e4ef10f58502323ea470bc30ba84d5ddd4e77f0

bridge,bonding,team seem to use netdev_increment_features to fix logical netdevs'feature,cause them to lose the NETIF_F_GSO_SOFTWARE feature (unless the real netdevs have the NETIF_F_GSO_SOFTWARE feature).In addition, plain UDP GSO/GRO, like TSO, also relies on NETIF_F_SG. UDP fraglist GRO/GSO also depends on NETIF_F_FRAGLIST.
Therefore, the following two modifications are recommended for bridge,bonding, and team:
1.netdev_features.h
#define NETIF_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_t netdev_add_tso_features(netdev_features_t features,
netdev_features_t mask)
{
- return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
+ return netdev_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.