]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices
authorAnjali Singhai <anjali.singhai@intel.com>
Wed, 6 Jan 2016 19:49:28 +0000 (11:49 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:37:15 +0000 (08:37 -0800)
Orabug: 22342532

This patch makes sure we check the GENEVE offload capable flag before
we attempt offload.
It also enables the Capability for XL710/X710 devices with FW API
version higher than 1.4

Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a340c7895a83501df68eb403496cec74bc363157)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 5cf3b11d0ec00ff18c108ff7072abb2deaedf8ea..128320ff69e840116b4e20d53fbd7b22c4ec2cae 100644 (file)
@@ -5307,7 +5307,8 @@ int i40e_open(struct net_device *netdev)
        vxlan_get_rx_port(netdev);
 #endif
 #ifdef CONFIG_I40E_GENEVE
-       geneve_get_rx_port(netdev);
+       if (pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE)
+               geneve_get_rx_port(netdev);
 #endif
 
        return 0;
@@ -8395,7 +8396,13 @@ static int i40e_sw_init(struct i40e_pf *pf)
                             I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE |
                             I40E_FLAG_100M_SGMII_CAPABLE |
                             I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
+       } else if ((pf->hw.aq.api_maj_ver > 1) ||
+                  ((pf->hw.aq.api_maj_ver == 1) &&
+                   (pf->hw.aq.api_min_ver > 4))) {
+               /* Supported in FW API version higher than 1.4 */
+               pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
        }
+
        pf->eeprom_version = 0xDEAD;
        pf->lan_veb = I40E_NO_VEB;
        pf->lan_vsi = I40E_NO_VSI;
@@ -8609,6 +8616,9 @@ static void i40e_add_geneve_port(struct net_device *netdev,
        u8 next_idx;
        u8 idx;
 
+       if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
+               return;
+
        if (sa_family == AF_INET6)
                return;
 
@@ -8656,6 +8666,9 @@ static void i40e_del_geneve_port(struct net_device *netdev,
        if (sa_family == AF_INET6)
                return;
 
+       if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
+               return;
+
        idx = i40e_get_udp_port_idx(pf, port);
 
        /* Check if port already exists */