Skip to content

Commit a547224

Browse files
Alexander Duyckdavem330
authored andcommitted
mlx4e: Do not attempt to offload VXLAN ports that are unrecognized
The mlx4e driver does not support more than one port for VXLAN offload. As such expecting the hardware to offload other ports is invalid since it appears the parsing logic is used to perform Tx checksum and segmentation offloads. Use the vxlan_port number to determine in which cases we can apply the offload and in which cases we can not. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 17471c7 commit a547224

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,9 +2447,14 @@ static netdev_features_t mlx4_en_features_check(struct sk_buff *skb,
24472447
* strip that feature if this is an IPv6 encapsulated frame.
24482448
*/
24492449
if (skb->encapsulation &&
2450-
(skb->ip_summed == CHECKSUM_PARTIAL) &&
2451-
(ip_hdr(skb)->version != 4))
2452-
features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
2450+
(skb->ip_summed == CHECKSUM_PARTIAL)) {
2451+
struct mlx4_en_priv *priv = netdev_priv(dev);
2452+
2453+
if (!priv->vxlan_port ||
2454+
(ip_hdr(skb)->version != 4) ||
2455+
(udp_hdr(skb)->dest != priv->vxlan_port))
2456+
features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
2457+
}
24532458

24542459
return features;
24552460
}

0 commit comments

Comments
 (0)