lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <PH0PR10MB450433FDBA4561A330FE27B0AC3D9@PH0PR10MB4504.namprd10.prod.outlook.com>
Date:   Wed, 2 Jun 2021 22:31:07 +0000
From:   Venkat Venkatsubra <venkat.x.venkatsubra@...cle.com>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Geneve udp tx checksum offload not working over mlx5 when options
 included 

With mlx5 (Mellanox CX5), UDP tx csum offload is not happening
on geneve packets when "options" are present in the geneve header.
The kernel computes it instead.

The offload feature gets disabled by mlx5e_features_check
because it is expecting a 8 byte regular (vxlan) header.
Whereas with OVN we include 8 byte options to make it a 16 byte geneve header.

[drivers/net/ethernet/mellanox/mlx5/core/en_main.c]

netdev_features_t mlx5e_features_check(struct sk_buff *skb,
                                       struct net_device *netdev,
                                       netdev_features_t features)
{
        struct mlx5e_priv *priv = netdev_priv(netdev);

        features = vlan_features_check(skb, features);
        features = vxlan_features_check(skb, features);     <-------
        ...
}

[include/net/vxlan.h]
static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
                                                     netdev_features_t features)
{
        ...
        if ((l4_hdr == IPPROTO_UDP) &&
            (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
             skb->inner_protocol != htons(ETH_P_TEB) ||
             (skb_inner_mac_header(skb) - skb_transport_header(skb) !=
              sizeof(struct udphdr) + sizeof(struct vxlanhdr)) ||
             (skb->ip_summed != CHECKSUM_NONE &&
              !can_checksum_protocol(features, inner_eth_hdr(skb)->h_proto))))
                return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
        ...
}

This

(skb_inner_mac_header(skb) - skb_transport_header(skb) !=
              sizeof(struct udphdr) + sizeof(struct vxlanhdr))

restricts the header size to 8 bytes.

Why is the geneve tx offloads limited to 8 byte headers only ?

Thanks for your help.

Venkat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ