mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[NET]: Added GSO toggle
This patch adds a generic segmentation offload toggle that can be turned on/off for each net device. For now it only supports in TCPv4. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
f4c50d990d
commit
37c3185a02
5 changed files with 47 additions and 6 deletions
|
|
@ -376,15 +376,20 @@ void br_features_recompute(struct net_bridge *br)
|
|||
features = br->feature_mask & ~NETIF_F_ALL_CSUM;
|
||||
|
||||
list_for_each_entry(p, &br->port_list, list) {
|
||||
if (checksum & NETIF_F_NO_CSUM &&
|
||||
!(p->dev->features & NETIF_F_NO_CSUM))
|
||||
unsigned long feature = p->dev->features;
|
||||
|
||||
if (checksum & NETIF_F_NO_CSUM && !(feature & NETIF_F_NO_CSUM))
|
||||
checksum ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM;
|
||||
if (checksum & NETIF_F_HW_CSUM &&
|
||||
!(p->dev->features & NETIF_F_HW_CSUM))
|
||||
if (checksum & NETIF_F_HW_CSUM && !(feature & NETIF_F_HW_CSUM))
|
||||
checksum ^= NETIF_F_HW_CSUM | NETIF_F_IP_CSUM;
|
||||
if (!(p->dev->features & NETIF_F_IP_CSUM))
|
||||
if (!(feature & NETIF_F_IP_CSUM))
|
||||
checksum = 0;
|
||||
features &= p->dev->features;
|
||||
|
||||
if (feature & NETIF_F_GSO)
|
||||
feature |= NETIF_F_TSO;
|
||||
feature |= NETIF_F_GSO;
|
||||
|
||||
features &= feature;
|
||||
}
|
||||
|
||||
br->dev->features = features | checksum | NETIF_F_LLTX;
|
||||
|
|
|
|||
Loading…
Reference in a new issue