This compatibility code was only needed for Linux 2.6.36 and older. With the
support for versions older than 3.10 dropped, this code is not needed anymore.
The style for checking for mpls was kept in case some other protocol type is
added in the future.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
#include "gso.h"
#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION
#include "gso.h"
#ifdef OVS_USE_COMPAT_GSO_SEGMENTATION
-static bool dev_supports_vlan_tx(struct net_device *dev)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
- return true;
-#elif defined(HAVE_VLAN_BUG_WORKAROUND)
- return dev->features & NETIF_F_HW_VLAN_TX;
-#else
- /* Assume that the driver is buggy. */
- return false;
-#endif
-}
-
/* Strictly this is not needed and will be optimised out
* as this code is guarded by if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0).
* It is here to make things explicit should the compatibility
/* Strictly this is not needed and will be optimised out
* as this code is guarded by if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0).
* It is here to make things explicit should the compatibility
{
#undef dev_queue_xmit
int err = -ENOMEM;
{
#undef dev_queue_xmit
int err = -ENOMEM;
/* Avoid traversing any VLAN tags that are present to determine if
* the ethtype is MPLS. Instead compare the mac_len (end of L2) and
/* Avoid traversing any VLAN tags that are present to determine if
* the ethtype is MPLS. Instead compare the mac_len (end of L2) and
if (skb->mac_len != skb_network_offset(skb) && !supports_mpls_gso())
mpls = true;
if (skb->mac_len != skb_network_offset(skb) && !supports_mpls_gso())
mpls = true;
- if (skb_vlan_tag_present(skb) && !dev_supports_vlan_tx(skb->dev))
- vlan = true;
-
- if (vlan || mpls) {
int features;
features = netif_skb_features(skb);
int features;
features = netif_skb_features(skb);
- if (vlan) {
- skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
- skb_vlan_tag_get(skb));
- if (unlikely(!skb))
- return err;
- skb->vlan_tci = 0;
- }
-
/* As of v3.11 the kernel provides an mpls_features field in
* struct net_device which allows devices to advertise which
* features its supports for MPLS. This value defaults to
/* As of v3.11 the kernel provides an mpls_features field in
* struct net_device which allows devices to advertise which
* features its supports for MPLS. This value defaults to