提交 78eb8877 编写于 作者: H Herbert Xu 提交者: David S. Miller

[BRIDGE]: Disable SG/GSO if TX checksum is off

When the bridge recomputes features, it does not maintain the
constraint that SG/GSO must be off if TX checksum is off.
This patch adds that constraint.

On a completely unrelated note, I've also added TSO6 and TSO_ECN
feature bits if GSO is enabled on the underlying device through
the new NETIF_F_GSO_SOFTWARE macro.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8311731a
...@@ -320,6 +320,9 @@ struct net_device ...@@ -320,6 +320,9 @@ struct net_device
#define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT) #define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT) #define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
/* List of features with software fallbacks. */
#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
......
...@@ -386,12 +386,17 @@ void br_features_recompute(struct net_bridge *br) ...@@ -386,12 +386,17 @@ void br_features_recompute(struct net_bridge *br)
checksum = 0; checksum = 0;
if (feature & NETIF_F_GSO) if (feature & NETIF_F_GSO)
feature |= NETIF_F_TSO; feature |= NETIF_F_GSO_SOFTWARE;
feature |= NETIF_F_GSO; feature |= NETIF_F_GSO;
features &= feature; features &= feature;
} }
if (!(checksum & NETIF_F_ALL_CSUM))
features &= ~NETIF_F_SG;
if (!(features & NETIF_F_SG))
features &= ~NETIF_F_GSO_MASK;
br->dev->features = features | checksum | NETIF_F_LLTX | br->dev->features = features | checksum | NETIF_F_LLTX |
NETIF_F_GSO_ROBUST; NETIF_F_GSO_ROBUST;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册