]> review.fuel-infra Code Review - packages/trusty/i40e-dkms.git/commitdiff
Update to 2.2.4 10/37010/2
authorIvan Suzdal <isuzdal@mirantis.com>
Fri, 27 Oct 2017 13:35:24 +0000 (16:35 +0300)
committerIvan Suzdal <isuzdal@mirantis.com>
Sat, 28 Oct 2017 08:03:10 +0000 (11:03 +0300)
Closes-Bug: #1728192

Change-Id: I03f3468be20f02adaa0cbb03addd9627e0fc0842

51 files changed:
debian/changelog
i40e-dkms/i40e-2.1.26/SUMS [deleted file]
i40e-dkms/i40e-2.2.4/COPYING [moved from i40e-dkms/i40e-2.1.26/COPYING with 100% similarity]
i40e-dkms/i40e-2.2.4/README [moved from i40e-dkms/i40e-2.1.26/README with 100% similarity]
i40e-dkms/i40e-2.2.4/SUMS [new file with mode: 0644]
i40e-dkms/i40e-2.2.4/i40e.7 [moved from i40e-dkms/i40e-2.1.26/i40e.7 with 100% similarity]
i40e-dkms/i40e-2.2.4/i40e.spec [moved from i40e-dkms/i40e-2.1.26/i40e.spec with 99% similarity]
i40e-dkms/i40e-2.2.4/pci.updates [moved from i40e-dkms/i40e-2.1.26/pci.updates with 99% similarity]
i40e-dkms/i40e-2.2.4/scripts/dump_tables [moved from i40e-dkms/i40e-2.1.26/scripts/dump_tables with 100% similarity]
i40e-dkms/i40e-2.2.4/scripts/set_irq_affinity [moved from i40e-dkms/i40e-2.1.26/scripts/set_irq_affinity with 100% similarity]
i40e-dkms/i40e-2.2.4/scripts/virt_perf_default [moved from i40e-dkms/i40e-2.1.26/scripts/virt_perf_default with 100% similarity]
i40e-dkms/i40e-2.2.4/src/Makefile [moved from i40e-dkms/i40e-2.1.26/src/Makefile with 100% similarity]
i40e-dkms/i40e-2.2.4/src/Module.supported [moved from i40e-dkms/i40e-2.1.26/src/Module.supported with 100% similarity]
i40e-dkms/i40e-2.2.4/src/common.mk [moved from i40e-dkms/i40e-2.1.26/src/common.mk with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e.h [moved from i40e-dkms/i40e-2.1.26/src/i40e.h with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_adminq.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_adminq.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_adminq.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_adminq.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_adminq_cmd.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_adminq_cmd.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_alloc.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_alloc.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_client.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_client.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_client.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_client.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_common.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_common.c with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_dcb.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_dcb.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_dcb.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_dcb.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_dcb_nl.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_dcb_nl.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_debugfs.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_debugfs.c with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_devids.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_devids.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_diag.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_diag.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_diag.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_diag.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_ethtool.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_ethtool.c with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_helper.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_helper.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_hmc.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_hmc.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_hmc.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_hmc.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_lan_hmc.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_lan_hmc.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_lan_hmc.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_lan_hmc.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_main.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_main.c with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_nvm.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_nvm.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_osdep.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_osdep.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_prototype.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_prototype.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_ptp.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_ptp.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_register.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_register.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_status.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_status.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_trace.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_trace.h with 98% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_txrx.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_txrx.c with 98% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_txrx.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_txrx.h with 98% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_type.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_type.h with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_virtchnl_pf.c [moved from i40e-dkms/i40e-2.1.26/src/i40e_virtchnl_pf.c with 99% similarity]
i40e-dkms/i40e-2.2.4/src/i40e_virtchnl_pf.h [moved from i40e-dkms/i40e-2.1.26/src/i40e_virtchnl_pf.h with 100% similarity]
i40e-dkms/i40e-2.2.4/src/kcompat.c [moved from i40e-dkms/i40e-2.1.26/src/kcompat.c with 100% similarity]
i40e-dkms/i40e-2.2.4/src/kcompat.h [moved from i40e-dkms/i40e-2.1.26/src/kcompat.h with 99% similarity]
i40e-dkms/i40e-2.2.4/src/virtchnl.h [moved from i40e-dkms/i40e-2.1.26/src/virtchnl.h with 100% similarity]

index 45ecd65dc6c16767884fc1c8feb5a466f33a597f..340bc3e7dde4ef4d58309cf6b373ed07c7242a53 100644 (file)
@@ -1,3 +1,9 @@
+i40e-dkms (2.2.4-1~u14.04+mos1) mos; urgency=low
+
+  * Update to version 2.2.4
+
+ -- Ivan Suzdal <mos-linux@mirantis.com>  Fri, 27 Oct 2017 16:34:44 +0300
+
 i40e-dkms (2.1.26-1~u14.04+mos1) mos; urgency=low
 
   * Update to version 2.1.26 (LP: 1712793)
diff --git a/i40e-dkms/i40e-2.1.26/SUMS b/i40e-dkms/i40e-2.1.26/SUMS
deleted file mode 100644 (file)
index 0bc6b87..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-23200     3 i40e-2.1.26/i40e.7
-41054    52 i40e-2.1.26/README
-42709     7 i40e-2.1.26/pci.updates
-23863    11 i40e-2.1.26/i40e.spec
-43521    19 i40e-2.1.26/COPYING
-11661   364 i40e-2.1.26/src/i40e_register.h
-36073     9 i40e-2.1.26/src/i40e_dcb_nl.c
-00545    82 i40e-2.1.26/src/i40e_adminq_cmd.h
-39134    46 i40e-2.1.26/src/i40e_nvm.c
-27049    47 i40e-2.1.26/src/i40e_type.h
-28147    22 i40e-2.1.26/src/i40e_prototype.h
-62648    57 i40e-2.1.26/src/kcompat.c
-58605     4 i40e-2.1.26/src/i40e_status.h
-38420   189 i40e-2.1.26/src/i40e_common.c
-25757     6 i40e-2.1.26/src/i40e_lan_hmc.h
-25014     2 i40e-2.1.26/src/i40e_diag.h
-25701     4 i40e-2.1.26/src/i40e_helper.h
-56270     8 i40e-2.1.26/src/i40e_hmc.h
-43670    23 i40e-2.1.26/src/i40e_client.c
-02605   177 i40e-2.1.26/src/i40e_ethtool.c
-35141     7 i40e-2.1.26/src/i40e_trace.h
-27367    30 i40e-2.1.26/src/i40e_adminq.c
-24070     2 i40e-2.1.26/src/i40e_devids.h
-13309     5 i40e-2.1.26/src/i40e_diag.c
-58300    36 i40e-2.1.26/src/i40e.h
-14892    19 i40e-2.1.26/src/i40e_txrx.h
-15513    23 i40e-2.1.26/src/virtchnl.h
-25383    27 i40e-2.1.26/src/i40e_ptp.c
-60199    35 i40e-2.1.26/src/i40e_lan_hmc.c
-22894    27 i40e-2.1.26/src/i40e_dcb.c
-64920   168 i40e-2.1.26/src/kcompat.h
-18552   366 i40e-2.1.26/src/i40e_main.c
-12661     7 i40e-2.1.26/src/i40e_client.h
-06581     6 i40e-2.1.26/src/Makefile
-38484     4 i40e-2.1.26/src/i40e_osdep.h
-03889     3 i40e-2.1.26/src/i40e_alloc.h
-27559    80 i40e-2.1.26/src/i40e_debugfs.c
-44588     1 i40e-2.1.26/src/Module.supported
-22387     6 i40e-2.1.26/src/i40e_virtchnl_pf.h
-58955     5 i40e-2.1.26/src/i40e_adminq.h
-28000    12 i40e-2.1.26/src/common.mk
-60958    93 i40e-2.1.26/src/i40e_virtchnl_pf.c
-32557   101 i40e-2.1.26/src/i40e_txrx.c
-12466     6 i40e-2.1.26/src/i40e_dcb.h
-03386    11 i40e-2.1.26/src/i40e_hmc.c
-33977     7 i40e-2.1.26/scripts/set_irq_affinity
-20875     2 i40e-2.1.26/scripts/dump_tables
-49876     5 i40e-2.1.26/scripts/virt_perf_default
diff --git a/i40e-dkms/i40e-2.2.4/SUMS b/i40e-dkms/i40e-2.2.4/SUMS
new file mode 100644 (file)
index 0000000..9c4f8c1
--- /dev/null
@@ -0,0 +1,48 @@
+23200     3 i40e-2.2.4/i40e.7
+41054    52 i40e-2.2.4/README
+57015     7 i40e-2.2.4/pci.updates
+46157    11 i40e-2.2.4/i40e.spec
+43521    19 i40e-2.2.4/COPYING
+11661   364 i40e-2.2.4/src/i40e_register.h
+36073     9 i40e-2.2.4/src/i40e_dcb_nl.c
+00545    82 i40e-2.2.4/src/i40e_adminq_cmd.h
+39134    46 i40e-2.2.4/src/i40e_nvm.c
+56456    47 i40e-2.2.4/src/i40e_type.h
+28147    22 i40e-2.2.4/src/i40e_prototype.h
+62648    57 i40e-2.2.4/src/kcompat.c
+58605     4 i40e-2.2.4/src/i40e_status.h
+04760   190 i40e-2.2.4/src/i40e_common.c
+25757     6 i40e-2.2.4/src/i40e_lan_hmc.h
+25014     2 i40e-2.2.4/src/i40e_diag.h
+25701     4 i40e-2.2.4/src/i40e_helper.h
+56270     8 i40e-2.2.4/src/i40e_hmc.h
+43670    23 i40e-2.2.4/src/i40e_client.c
+61287   178 i40e-2.2.4/src/i40e_ethtool.c
+06523     7 i40e-2.2.4/src/i40e_trace.h
+27367    30 i40e-2.2.4/src/i40e_adminq.c
+24070     2 i40e-2.2.4/src/i40e_devids.h
+13309     5 i40e-2.2.4/src/i40e_diag.c
+38197    36 i40e-2.2.4/src/i40e.h
+45149    19 i40e-2.2.4/src/i40e_txrx.h
+15513    23 i40e-2.2.4/src/virtchnl.h
+25383    27 i40e-2.2.4/src/i40e_ptp.c
+60199    35 i40e-2.2.4/src/i40e_lan_hmc.c
+22894    27 i40e-2.2.4/src/i40e_dcb.c
+15728   169 i40e-2.2.4/src/kcompat.h
+40073   366 i40e-2.2.4/src/i40e_main.c
+12661     7 i40e-2.2.4/src/i40e_client.h
+06581     6 i40e-2.2.4/src/Makefile
+38484     4 i40e-2.2.4/src/i40e_osdep.h
+03889     3 i40e-2.2.4/src/i40e_alloc.h
+12976    80 i40e-2.2.4/src/i40e_debugfs.c
+44588     1 i40e-2.2.4/src/Module.supported
+22387     6 i40e-2.2.4/src/i40e_virtchnl_pf.h
+58955     5 i40e-2.2.4/src/i40e_adminq.h
+28000    12 i40e-2.2.4/src/common.mk
+48557    93 i40e-2.2.4/src/i40e_virtchnl_pf.c
+62481   100 i40e-2.2.4/src/i40e_txrx.c
+12466     6 i40e-2.2.4/src/i40e_dcb.h
+03386    11 i40e-2.2.4/src/i40e_hmc.c
+33977     7 i40e-2.2.4/scripts/set_irq_affinity
+20875     2 i40e-2.2.4/scripts/dump_tables
+49876     5 i40e-2.2.4/scripts/virt_perf_default
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/i40e.spec
rename to i40e-dkms/i40e-2.2.4/i40e.spec
index e043254b336729bf2601309d0d7235848133fa6b..f5fb9f0acaa80117242372a535dd32efadb2a4ab 100644 (file)
@@ -1,6 +1,6 @@
 Name: i40e
 Summary: Intel(R) 40-10 Gigabit Ethernet Connection Network Driver
-Version: 2.1.26
+Version: 2.2.4
 Release: 1
 Source: %{name}-%{version}.tar.gz
 Vendor: Intel Corporation
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/pci.updates
rename to i40e-dkms/i40e-2.2.4/pci.updates
index 5e178aa718bc4cc4c81096c511fcec578c60b67a..3931711f932ced21a5cfb982281779e3b7fa8126 100644 (file)
                8086 0008  Ethernet Network Adapter OCP XXV710-1
                8086 0009  Ethernet 25G 2P XXV710 Adapter
                8086 4001  Ethernet Network Adapter XXV710-2
+       37cc  Ethernet Connection X722
        37ce  Ethernet Connection X722 for 10GbE backplane
                1590 0215  Ethernet 10Gb 2-port 568i Adapter
                17aa 4023  Ethernet Connection X722 for 10GbE backplane
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e.h
rename to i40e-dkms/i40e-2.2.4/src/i40e.h
index 3b9b11c926038d7aba58d0c4b1858032b94e2e5d..be0459d388d761eec372edf176fb1a502c7c2386 100644 (file)
 #define I40E_CURRENT_NVM_VERSION_LO    0x40
 
 #define I40E_RX_DESC(R, i)     \
-       (&(((union i40e_32byte_rx_desc *)((R)->desc))[i]))
+       (&(((union i40e_rx_desc *)((R)->desc))[i]))
 #define I40E_TX_DESC(R, i)     \
        (&(((struct i40e_tx_desc *)((R)->desc))[i]))
 #define I40E_TX_CTXTDESC(R, i) \
@@ -1064,9 +1064,6 @@ static inline void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector)
        struct i40e_hw *hw = &pf->hw;
        u32 val;
 
-       /* definitely clear the PBA here, as this function is meant to
-        * clean out all previous interrupts AND enable the interrupt
-        */
        val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
              I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
              (I40E_ITR_NONE << I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT);
@@ -1075,7 +1072,7 @@ static inline void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector)
 }
 
 void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf);
-void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf, bool clearpba);
+void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf);
 int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
 int i40e_open(struct net_device *netdev);
 int i40e_close(struct net_device *netdev);
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e_common.c
rename to i40e-dkms/i40e-2.2.4/src/i40e_common.c
index 0e864bd63992854d4a31c0a9c15ca38648b7dfd8..89521a4f62e056dd598824131f468d73436c8d3e 100644 (file)
@@ -1552,31 +1552,47 @@ i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
 {
        struct i40e_aq_desc desc;
        i40e_status status;
+       u16 max_delay = I40E_MAX_PHY_TIMEOUT, total_delay = 0;
        u16 abilities_size = sizeof(struct i40e_aq_get_phy_abilities_resp);
 
        if (!abilities)
                return I40E_ERR_PARAM;
 
-       i40e_fill_default_direct_cmd_desc(&desc,
-                                         i40e_aqc_opc_get_phy_abilities);
+       do {
+               i40e_fill_default_direct_cmd_desc(&desc,
+                                              i40e_aqc_opc_get_phy_abilities);
 
-       desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
-       if (abilities_size > I40E_AQ_LARGE_BUF)
-               desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);
+               desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
+               if (abilities_size > I40E_AQ_LARGE_BUF)
+                       desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);
 
-       if (qualified_modules)
-               desc.params.external.param0 |=
+               if (qualified_modules)
+                       desc.params.external.param0 |=
                        CPU_TO_LE32(I40E_AQ_PHY_REPORT_QUALIFIED_MODULES);
 
-       if (report_init)
-               desc.params.external.param0 |=
+               if (report_init)
+                       desc.params.external.param0 |=
                        CPU_TO_LE32(I40E_AQ_PHY_REPORT_INITIAL_VALUES);
 
-       status = i40e_asq_send_command(hw, &desc, abilities, abilities_size,
-                                   cmd_details);
+               status = i40e_asq_send_command(hw, &desc, abilities,
+                                              abilities_size, cmd_details);
 
-       if (hw->aq.asq_last_status == I40E_AQ_RC_EIO)
-               status = I40E_ERR_UNKNOWN_PHY;
+               if (status != I40E_SUCCESS)
+                       break;
+
+               if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) {
+                       status = I40E_ERR_UNKNOWN_PHY;
+                       break;
+               } else if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) {
+                       usleep_range(1000, 2000);
+                       total_delay++;
+                       status = I40E_ERR_TIMEOUT;
+               }
+       } while ((hw->aq.asq_last_status != I40E_AQ_RC_OK) &&
+                (total_delay < max_delay));
+
+       if (status != I40E_SUCCESS)
+               return status;
 
        if (report_init) {
                if (hw->mac.type ==  I40E_MAC_XL710 &&
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e_debugfs.c
rename to i40e-dkms/i40e-2.2.4/src/i40e_debugfs.c
index 3033c849a927f6e81ba5b6b19058b75375bc2e1e..64c32e8363dafd2bdbbde05b26710bfd9ee0af66 100644 (file)
@@ -584,6 +584,15 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)
        }
 }
 
+/* Helper macros for printing upper half of the 32byte descriptor. */
+#ifdef I40E_32BYTE_RX
+#define RXD_RSVD1(_rxd) ((_rxd)->read.rsvd1)
+#define RXD_RSVD2(_rxd) ((_rxd)->read.rsvd2)
+#else
+#define RXD_RSVD1(_rxd) 0ULL
+#define RXD_RSVD2(_rxd) 0ULL
+#endif
+
 /**
  * i40e_dbg_dump_desc - handles dump desc write into command datum
  * @cnt: number of arguments that the user supplied
@@ -644,7 +653,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
                                         "   d[%03x] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
                                         i, rxd->read.pkt_addr,
                                         rxd->read.hdr_addr,
-                                        rxd->read.rsvd1, rxd->read.rsvd2);
+                                        RXD_RSVD1(rxd), RXD_RSVD2(rxd));
                        }
                }
        } else if (cnt == 3) {
@@ -665,7 +674,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
                                 "vsi = %02i rx ring = %02i d[%03x] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n",
                                 vsi_seid, ring_id, desc_n,
                                 rxd->read.pkt_addr, rxd->read.hdr_addr,
-                                rxd->read.rsvd1, rxd->read.rsvd2);
+                                RXD_RSVD1(rxd), RXD_RSVD2(rxd));
                }
        } else {
                dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n");
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e_ethtool.c
rename to i40e-dkms/i40e-2.2.4/src/i40e_ethtool.c
index 8d6e04e8ee7a04e19aa3d4196e64ce9e205f308d..dde2251cd8047996df019788ff87a63705ae152e 100644 (file)
@@ -1431,6 +1431,8 @@ static int i40e_set_link_settings(struct net_device *netdev,
        u8 autoneg;
        struct ethtool_link_ksettings ksettings_real, *ksettings;
        u32 advertise[ETHTOOL_LINK_MODE_MASK_U32];
+       u32 safe_supported[ETHTOOL_LINK_MODE_MASK_U32];
+       int i;
 
        ksettings = &ksettings_real;
        memcpy(ksettings,
@@ -1461,6 +1463,24 @@ static int i40e_set_link_settings(struct net_device *netdev,
                return -EOPNOTSUPP;
        }
 
+       /* save autoneg and speed out of ksettings */
+       autoneg = ksettings->base.autoneg;
+       memcpy(advertise, &ksettings->link_modes.advertising,
+              sizeof(advertise));
+
+       memset(&safe_ksettings, 0, sizeof(safe_ksettings));
+       /* Get link modes supported by hardware... */
+       i40e_get_link_settings_link_down(hw, &safe_ksettings, pf);
+       memcpy(safe_supported, &safe_ksettings.link_modes.supported,
+              sizeof(safe_supported));
+       /* ...and check against modes requested by user.
+        * Return an error if unsupported mode was set.
+        */
+       for (i = 0; i < ETHTOOL_LINK_MODE_MASK_U32; i++) {
+               if ((advertise[i] & safe_supported[i]) != advertise[i])
+                       return -EINVAL;
+       }
+
        /* get our own copy of the bits to check against */
        memset(&safe_ksettings, 0, sizeof(struct ethtool_link_ksettings));
        safe_ksettings.base.cmd                    = ksettings->base.cmd;
@@ -1468,22 +1488,16 @@ static int i40e_set_link_settings(struct net_device *netdev,
                ksettings->base.link_mode_masks_nwords;
        i40e_get_link_settings(netdev, &safe_ksettings);
 
-       /* save autoneg and speed out of ksettings */
-       autoneg = ksettings->base.autoneg;
-       memcpy((void *)advertise,
-              &ksettings->base.link_mode_masks[ETHTOOL_LINK_MODE_MASK_U32],
-              sizeof(advertise));
-
        /* set autoneg and speed back to what they currently are */
        ksettings->base.autoneg = safe_ksettings.base.autoneg;
        memcpy((void *)ksettings->link_modes.advertising,
               safe_ksettings.link_modes.advertising,
               sizeof(advertise));
 
-       /* If ksettings and safe_ksettings are not the same now, then they are
-        * trying to set something that we do not support
+       /* If ksettings.base and safe_ksettings.base are not the same now,
+        * then they are trying to set something that we do not support.
         */
-       if (memcmp(ksettings, &safe_ksettings,
+       if (memcmp(&ksettings->base, &safe_ksettings.base,
                   sizeof(struct ethtool_link_settings)))
                return -EOPNOTSUPP;
 
@@ -1546,6 +1560,7 @@ static int i40e_set_link_settings(struct net_device *netdev,
                        autoneg_changed = true;
                }
        }
+
        if (advertise[0] & ADVERTISED_100baseT_Full)
                config.link_speed |= I40E_LINK_SPEED_100MB;
        if (advertise[0] & ADVERTISED_1000baseT_Full ||
@@ -4077,7 +4092,7 @@ static int i40e_add_cloud_filter_ethtool(struct i40e_vsi *vsi,
        if (!vf) {
                if (ring >= vsi->num_queue_pairs)
                        return -EINVAL;
-               dest_seid = vsi->id;
+               dest_seid = vsi->seid;
        } else {
                /* VFs are zero-indexed, so we subtract one here */
                vf--;
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e_main.c
rename to i40e-dkms/i40e-2.2.4/src/i40e_main.c
index 4c70594534bcf579f4144af3a2b033ff803b3662..5bc0f4cb557d725328db55b04aa5b9edefc12125 100644 (file)
@@ -59,8 +59,8 @@ static const char i40e_driver_string[] =
 #define DRV_VERSION_DESC ""
 
 #define DRV_VERSION_MAJOR 2
-#define DRV_VERSION_MINOR 1
-#define DRV_VERSION_BUILD 26
+#define DRV_VERSION_MINOR 2
+#define DRV_VERSION_BUILD 4
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
        __stringify(DRV_VERSION_MINOR) "." \
        __stringify(DRV_VERSION_BUILD) \
@@ -3094,35 +3094,46 @@ static void i40e_vsi_free_rx_resources(struct i40e_vsi *vsi)
  **/
 static void i40e_config_xps_tx_ring(struct i40e_ring *ring)
 {
+#ifndef HAVE_XPS_QOS_SUPPORT
        struct i40e_vsi *vsi = ring->vsi;
+#endif
        int cpu;
 
        if (!ring->q_vector || !ring->netdev)
                return;
 
+#ifndef HAVE_XPS_QOS_SUPPORT
+       /* Some older kernels do not support XPS with QoS */
+       if (vsi->tc_config.numtc > 1) {
 #ifndef HAVE_NETDEV_TC_RESETS_XPS
-       /* Older kernels do not reset the XPS map when configuring traffic
-        * classes. To allow selection based on TC we need to clear the
-        * mapping here.
-        */
-       if ((vsi->tc_config.numtc > 1) &&
-           test_and_clear_bit(__I40E_TX_XPS_INIT_DONE, ring->state)) {
+               /* Additionally, some kernels do not properly clear the XPS
+                * mapping when the number of traffic classes is changed. In
+                * order to support these kernels we work around this by
+                * setting the XPS mapping to the empty cpu set.
+                */
                cpumask_var_t mask;
 
+               /* Only clear the settings if we initialized XPS */
+               if (!test_and_clear_bit(__I40E_TX_XPS_INIT_DONE, ring->state))
+                       return;
+
                if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
                        return;
+
                netif_set_xps_queue(ring->netdev, mask, ring->queue_index);
                free_cpumask_var(mask);
+#endif /* !HAVE_NETDEV_TC_RESETS_XPS */
                return;
        }
 
-#endif
-       if ((vsi->tc_config.numtc <= 1) &&
-           !test_and_set_bit(__I40E_TX_XPS_INIT_DONE, ring->state)) {
-               cpu = cpumask_local_spread(ring->q_vector->v_idx, -1);
-               netif_set_xps_queue(ring->netdev, get_cpu_mask(cpu),
-                                   ring->queue_index);
-       }
+#endif /* !HAVE_XPS_QOS_SUPPORT */
+       /* We only initialize XPS once, so as not to overwrite user settings */
+       if (test_and_set_bit(__I40E_TX_XPS_INIT_DONE, ring->state))
+               return;
+
+       cpu = cpumask_local_spread(ring->q_vector->v_idx, -1);
+       netif_set_xps_queue(ring->netdev, get_cpu_mask(cpu),
+                           ring->queue_index);
 }
 
 /**
@@ -3247,7 +3258,12 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
        rx_ctx.qlen = ring->count;
 
        /* use 32 byte descriptors */
+#ifdef I40E_32BYTE_RX
        rx_ctx.dsize = 1;
+#else
+       /* use 16 byte descriptors */
+       rx_ctx.dsize = 0;
+#endif
 
        /* descriptor type is always zero
         * rx_ctx.dtype = 0;
@@ -3255,7 +3271,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
        rx_ctx.hsplit_0 = 0;
 
        rx_ctx.rxmax = min_t(u16, vsi->max_frame, chain_len * ring->rx_buf_len);
-       rx_ctx.lrxqthresh = 2;
+       rx_ctx.lrxqthresh = 1;
        rx_ctx.crcstrip = 1;
        rx_ctx.l2tsel = 1;
        /* this controls whether VLAN is stripped from inner headers */
@@ -3629,15 +3645,14 @@ void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf)
 /**
  * i40e_irq_dynamic_enable_icr0 - Enable default interrupt generation for icr0
  * @pf: board private structure
- * @clearpba: true when all pending interrupt events should be cleared
  **/
-void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf, bool clearpba)
+void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf)
 {
        struct i40e_hw *hw = &pf->hw;
        u32 val;
 
        val = I40E_PFINT_DYN_CTL0_INTENA_MASK   |
-             (clearpba ? I40E_PFINT_DYN_CTL0_CLEARPBA_MASK : 0) |
+             I40E_PFINT_DYN_CTL0_CLEARPBA_MASK |
              (I40E_ITR_NONE << I40E_PFINT_DYN_CTL0_ITR_INDX_SHIFT);
 
        wr32(hw, I40E_PFINT_DYN_CTL0, val);
@@ -3831,7 +3846,7 @@ static int i40e_vsi_enable_irq(struct i40e_vsi *vsi)
                for (i = 0; i < vsi->num_q_vectors; i++)
                        i40e_irq_dynamic_enable(vsi, i);
        } else {
-               i40e_irq_dynamic_enable_icr0(pf, true);
+               i40e_irq_dynamic_enable_icr0(pf);
        }
 
        i40e_flush(&pf->hw);
@@ -3981,7 +3996,7 @@ enable_intr:
        wr32(hw, I40E_PFINT_ICR0_ENA, ena_mask);
        if (!test_bit(__I40E_DOWN, pf->state)) {
                i40e_service_event_schedule(pf);
-               i40e_irq_dynamic_enable_icr0(pf, false);
+               i40e_irq_dynamic_enable_icr0(pf);
        }
 
        return ret;
@@ -8664,7 +8679,7 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf)
 
        i40e_flush(hw);
 
-       i40e_irq_dynamic_enable_icr0(pf, true);
+       i40e_irq_dynamic_enable_icr0(pf);
 
        return err;
 }
@@ -9277,8 +9292,8 @@ static int i40e_sw_init(struct i40e_pf *pf)
                    I40E_FLAG_MSIX_ENABLED;
 
        /* Set default ITR */
-       pf->rx_itr_default = I40E_ITR_DYNAMIC | I40E_ITR_RX_DEF;
-       pf->tx_itr_default = I40E_ITR_DYNAMIC | I40E_ITR_TX_DEF;
+       pf->rx_itr_default = I40E_ITR_RX_DEF;
+       pf->tx_itr_default = I40E_ITR_TX_DEF;
        /* Depending on PF configurations, it is possible that the RSS
         * maximum might end up larger than the available queues
         */
similarity index 98%
rename from i40e-dkms/i40e-2.1.26/src/i40e_trace.h
rename to i40e-dkms/i40e-2.2.4/src/i40e_trace.h
index 5ea346ed30ffdb9f606c16743a75b9924bec25b6..929a6e6b343e534a6f5130849824345c11fe77f4 100644 (file)
@@ -149,7 +149,7 @@ DECLARE_EVENT_CLASS(
        i40e_rx_template,
 
        TP_PROTO(struct i40e_ring *ring,
-                union i40e_32byte_rx_desc *desc,
+                union i40e_rx_desc *desc,
                 struct sk_buff *skb),
 
        TP_ARGS(ring, desc, skb),
@@ -177,7 +177,7 @@ DECLARE_EVENT_CLASS(
 DEFINE_EVENT(
        i40e_rx_template, i40e_clean_rx_irq,
        TP_PROTO(struct i40e_ring *ring,
-                union i40e_32byte_rx_desc *desc,
+                union i40e_rx_desc *desc,
                 struct sk_buff *skb),
 
        TP_ARGS(ring, desc, skb));
@@ -185,7 +185,7 @@ DEFINE_EVENT(
 DEFINE_EVENT(
        i40e_rx_template, i40e_clean_rx_irq_rx,
        TP_PROTO(struct i40e_ring *ring,
-                union i40e_32byte_rx_desc *desc,
+                union i40e_rx_desc *desc,
                 struct sk_buff *skb),
 
        TP_ARGS(ring, desc, skb));
similarity index 98%
rename from i40e-dkms/i40e-2.1.26/src/i40e_txrx.c
rename to i40e-dkms/i40e-2.2.4/src/i40e_txrx.c
index cbd49a9adcf3f0a2e0443aa367ee4d196d5f1d52..bfa529b20b07ccaed2dcb234385839326688f56a 100644 (file)
@@ -1220,7 +1220,7 @@ int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring)
 #endif /* HAVE_NDO_GET_STATS64 */
 
        /* Round up to nearest 4K */
-       rx_ring->size = rx_ring->count * sizeof(union i40e_32byte_rx_desc);
+       rx_ring->size = rx_ring->count * sizeof(union i40e_rx_desc);
        rx_ring->size = ALIGN(rx_ring->size, 4096);
        rx_ring->desc = dma_alloc_coherent(dev, rx_ring->size,
                                           &rx_ring->dma, GFP_KERNEL);
@@ -1418,6 +1418,15 @@ bool i40e_alloc_rx_buffers(struct i40e_ring *rx_ring, u16 cleaned_count)
        union i40e_rx_desc *rx_desc;
        struct i40e_rx_buffer *bi;
 
+       /* Hardware only fetches new descriptors in cache lines of 8,
+        * essentially ignoring the lower 3 bits of the tail register. We want
+        * to ensure our tail writes are aligned to avoid unnecessary work. We
+        * can't simply round down the cleaned count, since we might fail to
+        * allocate some buffers. What we really want is to ensure that
+        * next_to_used + cleaned_count produces an aligned value.
+        */
+       cleaned_count -= (ntu + cleaned_count) & 0x7;
+
        /* do nothing if no valid netdev defined */
        if (!rx_ring->netdev || !cleaned_count)
                return false;
@@ -2275,9 +2284,7 @@ static u32 i40e_buildreg_itr(const int type, const u16 itr)
        u32 val;
 
        val = I40E_PFINT_DYN_CTLN_INTENA_MASK |
-             /* Don't clear PBA because that can cause lost interrupts that
-              * came in while we were cleaning/polling
-              */
+             I40E_PFINT_DYN_CTLN_CLEARPBA_MASK |
              (type << I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT) |
              (itr << I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT);
 
@@ -2314,7 +2321,7 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
 
        /* If we don't have MSIX, then we only need to re-enable icr0 */
        if (!(vsi->back->flags & I40E_FLAG_MSIX_ENABLED)) {
-               i40e_irq_dynamic_enable_icr0(vsi->back, false);
+               i40e_irq_dynamic_enable_icr0(vsi->back);
                return;
        }
 
@@ -3343,40 +3350,12 @@ static inline int i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
        /* write last descriptor with EOP bit */
        td_cmd |= I40E_TX_DESC_CMD_EOP;
 
-       /* We can OR these values together as they both are checked against
-        * 4 below and at this point desc_count will be used as a boolean value
-        * after this if/else block.
+       /* We OR these values together to check both against 4 (WB_STRIDE)
+        * below. This is safe since we don't re-use desc_count afterwards.
         */
        desc_count |= ++tx_ring->packet_stride;
 
-       /* Algorithm to optimize tail and RS bit setting:
-        * if queue is stopped
-        *      mark RS bit
-        *      reset packet counter
-        * else if xmit_more is supported and is true
-        *      advance packet counter to 4
-        *      reset desc_count to 0
-        *
-        * if desc_count >= 4
-        *      mark RS bit
-        *      reset packet counter
-        * if desc_count > 0
-        *      update tail
-        *
-        * Note: If there are less than 4 descriptors
-        * pending and interrupts were disabled the service task will
-        * trigger a force WB.
-        */
-       if (netif_xmit_stopped(txring_txq(tx_ring))) {
-               goto do_rs;
-#ifdef HAVE_SKB_XMIT_MORE
-       } else if (skb->xmit_more) {
-               /* set stride to arm on next packet and reset desc_count */
-               tx_ring->packet_stride = WB_STRIDE;
-               desc_count = 0;
-#endif /* HAVE_SKB_XMIT_MORE */
-       } else if (desc_count >= WB_STRIDE) {
-do_rs:
+       if (desc_count >= WB_STRIDE) {
                /* write last descriptor with RS bit set */
                td_cmd |= I40E_TX_DESC_CMD_RS;
                tx_ring->packet_stride = 0;
@@ -3398,7 +3377,7 @@ do_rs:
 
        /* notify HW of packet */
 #ifdef HAVE_SKB_XMIT_MORE
-       if (desc_count) {
+       if (netif_xmit_stopped(txring_txq(tx_ring)) || !skb->xmit_more) {
                writel(i, tx_ring->tail);
 
                /* we need this if more than one processor can write to our tail
similarity index 98%
rename from i40e-dkms/i40e-2.1.26/src/i40e_txrx.h
rename to i40e-dkms/i40e-2.2.4/src/i40e_txrx.h
index 451043de13bba3d28c4728538d3c409c0efd1ffc..ffcc5857b0f3a483ae8faa6991f54a8d69fda8a9 100644 (file)
 #define I40E_ITR_8K                0x003E
 #define I40E_ITR_4K                0x007A
 #define I40E_MAX_INTRL             0x3B    /* reg uses 4 usec resolution */
-#define I40E_ITR_RX_DEF            I40E_ITR_20K
-#define I40E_ITR_TX_DEF            I40E_ITR_20K
+#define I40E_ITR_RX_DEF            (ITR_REG_TO_USEC(I40E_ITR_20K) | \
+                                   I40E_ITR_DYNAMIC)
+#define I40E_ITR_TX_DEF            (ITR_REG_TO_USEC(I40E_ITR_20K) | \
+                                   I40E_ITR_DYNAMIC)
 #define I40E_ITR_DYNAMIC           0x8000  /* use top bit as a flag */
 #define I40E_MIN_INT_RATE          250     /* ~= 1000000 / (I40E_MAX_ITR * 2) */
 #define I40E_MAX_INT_RATE          500000  /* == 1000000 / (I40E_MIN_ITR * 2) */
@@ -128,7 +130,11 @@ enum i40e_dyn_idx_t {
  */
 #define I40E_RX_HDR_SIZE I40E_RXBUFFER_256
 #define I40E_PACKET_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2))
+#ifdef I40E_32BYTE_RX
 #define i40e_rx_desc i40e_32byte_rx_desc
+#else
+#define i40e_rx_desc i40e_16byte_rx_desc
+#endif
 
 #ifdef HAVE_STRUCT_DMA_ATTRS
 #define I40E_RX_DMA_ATTR NULL
@@ -207,7 +213,7 @@ static inline bool i40e_test_staterr(union i40e_rx_desc *rx_desc,
 }
 
 /* How many Rx Buffers do we bundle into one write to the hardware ? */
-#define I40E_RX_BUFFER_WRITE   16      /* Must be power of 2 */
+#define I40E_RX_BUFFER_WRITE   32      /* Must be power of 2 */
 #define I40E_RX_INCREMENT(r, i) \
        do {                                    \
                (i)++;                          \
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e_type.h
rename to i40e-dkms/i40e-2.2.4/src/i40e_type.h
index 3d37e3aad4952eb04c2adb6a060461430cbc5a76..a380f7d91a6a830146c9cad2a7c4218a8eba7ad4 100644 (file)
@@ -43,6 +43,9 @@
 /* Max default timeout in ms, */
 #define I40E_MAX_NVM_TIMEOUT           18000
 
+/* Max timeout in ms for the phy to respond */
+#define I40E_MAX_PHY_TIMEOUT           500
+
 /* Switch from ms to the 1usec global time (this is the GTIME resolution) */
 #define I40E_MS_TO_GTIME(time)         ((time) * 1000)
 
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/i40e_virtchnl_pf.c
rename to i40e-dkms/i40e-2.2.4/src/i40e_virtchnl_pf.c
index 8270b67e759e36d541426ed25d72446b6cd8482d..19accdd8fe27b9ca96e813cc6b133733e33a35ca 100644 (file)
@@ -274,7 +274,7 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
        struct i40e_hw *hw = &pf->hw;
        u16 vsi_queue_id, pf_queue_id;
        enum i40e_queue_type qtype;
-       u16 next_q, vector_id;
+       u16 next_q, vector_id, size;
        u32 reg, reg_idx;
        u16 itr_idx = 0;
 
@@ -304,9 +304,11 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
                                     vsi_queue_id + 1));
        }
 
-       next_q = find_first_bit(&linklistmap,
-                               (I40E_MAX_VSI_QP *
-                                I40E_VIRTCHNL_SUPPORTED_QTYPES));
+       size = I40E_MAX_VSI_QP * I40E_VIRTCHNL_SUPPORTED_QTYPES;
+       next_q = find_first_bit(&linklistmap, size);
+       if (unlikely(next_q == size))
+               goto irq_list_done;
+
        vsi_queue_id = next_q / I40E_VIRTCHNL_SUPPORTED_QTYPES;
        qtype = next_q % I40E_VIRTCHNL_SUPPORTED_QTYPES;
        pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id, vsi_queue_id);
@@ -314,7 +316,7 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
 
        wr32(hw, reg_idx, reg);
 
-       while (next_q < (I40E_MAX_VSI_QP * I40E_VIRTCHNL_SUPPORTED_QTYPES)) {
+       while (next_q < size) {
                switch (qtype) {
                case I40E_QUEUE_TYPE_RX:
                        reg_idx = I40E_QINT_RQCTL(pf_queue_id);
@@ -328,12 +330,8 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
                        break;
                }
 
-               next_q = find_next_bit(&linklistmap,
-                                      (I40E_MAX_VSI_QP *
-                                       I40E_VIRTCHNL_SUPPORTED_QTYPES),
-                                      next_q + 1);
-               if (next_q <
-                   (I40E_MAX_VSI_QP * I40E_VIRTCHNL_SUPPORTED_QTYPES)) {
+               next_q = find_next_bit(&linklistmap, size, next_q + 1);
+               if (next_q < size) {
                        vsi_queue_id = next_q / I40E_VIRTCHNL_SUPPORTED_QTYPES;
                        qtype = next_q % I40E_VIRTCHNL_SUPPORTED_QTYPES;
                        pf_queue_id = i40e_vc_get_pf_queue_id(vf, vsi_id,
@@ -637,7 +635,7 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id,
        rx_ctx.dsize = 1;
 
        /* default values */
-       rx_ctx.lrxqthresh = 2;
+       rx_ctx.lrxqthresh = 1;
        rx_ctx.crcstrip = 1;
        rx_ctx.prefena = 1;
        rx_ctx.l2tsel = 1;
@@ -1364,7 +1362,7 @@ err_alloc:
                i40e_free_vfs(pf);
 err_iov:
        /* Re-enable interrupt 0. */
-       i40e_irq_dynamic_enable_icr0(pf, false);
+       i40e_irq_dynamic_enable_icr0(pf);
        return ret;
 }
 
@@ -2908,6 +2906,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
        struct i40e_mac_filter *f;
        struct i40e_vf *vf;
        int ret = 0;
+       struct hlist_node *h;
        int bkt;
 
        /* validate the request */
@@ -2946,12 +2945,11 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
        /* Delete all the filters for this VSI - we're going to kill it
         * anyway.
         */
-       hash_for_each(vsi->mac_filter_hash, bkt, f, hlist)
+       hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist)
                __i40e_del_filter(vsi, f);
 
        spin_unlock_bh(&vsi->mac_filter_hash_lock);
 
-       dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n", mac, vf_id);
        /* program mac filter */
        if (i40e_sync_vsi_filters(vsi)) {
                dev_err(&pf->pdev->dev, "Unable to program ucast filters\n");
@@ -2959,7 +2957,16 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
                goto error_param;
        }
        ether_addr_copy(vf->default_lan_addr.addr, mac);
-       vf->pf_set_mac = true;
+
+       if (is_zero_ether_addr(mac)) {
+               vf->pf_set_mac = false;
+               dev_info(&pf->pdev->dev, "Removing MAC on VF %d\n", vf_id);
+       } else {
+               vf->pf_set_mac = true;
+               dev_info(&pf->pdev->dev, "Setting MAC %pM on VF %d\n",
+                        mac, vf_id);
+       }
+
        /* Force the VF driver stop so it has to reload with new MAC address */
        i40e_vc_disable_vf(vf);
        dev_info(&pf->pdev->dev, "Reload the VF driver to make this change effective.\n");
similarity index 99%
rename from i40e-dkms/i40e-2.1.26/src/kcompat.h
rename to i40e-dkms/i40e-2.2.4/src/kcompat.h
index 477e6be52998651f28267b26887c74c602840032..08d6e2f57693ef8e1a4ea450a2dbec013ee6de8b 100644 (file)
@@ -4789,6 +4789,7 @@ extern int __kc_pcie_get_minimum_link(struct pci_dev *dev,
 #endif
 #endif /* < 4.8.0 */
 #define HAVE_NDO_GET_PHYS_PORT_ID
+#define HAVE_NETIF_SET_XPS_QUEUE_CONST_MASK
 #endif /* >= 3.12.0 */
 
 /*****************************************************************************/
@@ -5111,6 +5112,11 @@ extern unsigned int __kc_eth_get_headlen(unsigned char *data, unsigned int max_l
 #define HAVE_SKBUFF_CSUM_LEVEL
 #endif /* >= RH 7.1 */
 
+/* RHEL 7.3 backported xmit_more */
+#if (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,3))
+#define HAVE_SKB_XMIT_MORE
+#endif /* >= RH 7.3 */
+
 #undef GENMASK
 #define GENMASK(h, l) \
        (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
@@ -5526,7 +5532,6 @@ pci_release_mem_regions(struct pci_dev *pdev)
 #endif /* !SLE_VERSION(12,3,0) */
 #else
 #define HAVE_UDP_ENC_RX_OFFLOAD
-#define HAVE_XPS_QOS_SUPPORT
 #endif /* 4.8.0 */
 
 /*****************************************************************************/
@@ -5540,8 +5545,12 @@ pci_release_mem_regions(struct pci_dev *pdev)
 
 /*****************************************************************************/
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
+#if (RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,4)))
+#define HAVE_DEV_WALK_API
+#endif
 #if (SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0)))
 #define HAVE_STRUCT_DMA_ATTRS
+#define HAVE_NETDEVICE_MIN_MAX_MTU
 #endif
 
 #if !(SLE_VERSION_CODE && (SLE_VERSION_CODE >= SLE_VERSION(12,3,0)))
@@ -5587,10 +5596,12 @@ static inline void __page_frag_cache_drain(struct page *page,
 #ifndef ETH_MIN_MTU
 #define ETH_MIN_MTU 68
 #endif /* ETH_MIN_MTU */
-#else
+#else /* >= 4.10 */
 #define HAVE_NETDEVICE_MIN_MAX_MTU
 #define HAVE_SWIOTLB_SKIP_CPU_SYNC
 #define HAVE_NETDEV_TC_RESETS_XPS
+#define HAVE_XPS_QOS_SUPPORT
+#define HAVE_DEV_WALK_API
 #endif /* 4.10.0 */
 
 /*****************************************************************************/
@@ -5613,4 +5624,10 @@ static inline void __page_frag_cache_drain(struct page *page,
 #define HAVE_PCI_ERROR_HANDLER_RESET_PREPARE
 #endif /* 4.13.0 */
 
+/*****************************************************************************/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0))
+#else /* > 4.14 */
+#define HAVE_NDO_SETUP_TC_REMOVE_TC_TO_NETDEV
+#endif /* 4.14.0 */
+
 #endif /* _KCOMPAT_H_ */