aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnjali Singhai Jain <anjali.singhai@intel.com>2013-11-28 01:39:47 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-01-06 06:56:28 -0500
commit80f6428fa15bb5f0d1f1d3319eeb6ac87ff4ffc7 (patch)
treef0ec87343b2dc945ff2338232ad4d07985b3491d
parent37f0be6d297a5e32b7b2873a0d6d687e685948bc (diff)
i40e: Do not allow AQ calls from ndo-ops
If the device is not in a working state avoid making admin queue (AQ) calls that rely on a working AQ. Change-Id: Ifbba6d257b3a5b51bfe92938c04088c0baa21433 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index fd24ee47144f..483126cceade 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1215,6 +1215,10 @@ static int i40e_set_mac(struct net_device *netdev, void *p)
1215 if (ether_addr_equal(netdev->dev_addr, addr->sa_data)) 1215 if (ether_addr_equal(netdev->dev_addr, addr->sa_data))
1216 return 0; 1216 return 0;
1217 1217
1218 if (test_bit(__I40E_DOWN, &vsi->back->state) ||
1219 test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))
1220 return -EADDRNOTAVAIL;
1221
1218 if (vsi->type == I40E_VSI_MAIN) { 1222 if (vsi->type == I40E_VSI_MAIN) {
1219 i40e_status ret; 1223 i40e_status ret;
1220 ret = i40e_aq_mac_address_write(&vsi->back->hw, 1224 ret = i40e_aq_mac_address_write(&vsi->back->hw,
@@ -1779,7 +1783,6 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
1779{ 1783{
1780 struct i40e_mac_filter *f, *add_f; 1784 struct i40e_mac_filter *f, *add_f;
1781 bool is_netdev, is_vf; 1785 bool is_netdev, is_vf;
1782 int ret;
1783 1786
1784 is_vf = (vsi->type == I40E_VSI_SRIOV); 1787 is_vf = (vsi->type == I40E_VSI_SRIOV);
1785 is_netdev = !!(vsi->netdev); 1788 is_netdev = !!(vsi->netdev);
@@ -1805,13 +1808,6 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
1805 } 1808 }
1806 } 1809 }
1807 1810
1808 ret = i40e_sync_vsi_filters(vsi);
1809 if (ret) {
1810 dev_info(&vsi->back->pdev->dev,
1811 "Could not sync filters for vid %d\n", vid);
1812 return ret;
1813 }
1814
1815 /* Now if we add a vlan tag, make sure to check if it is the first 1811 /* Now if we add a vlan tag, make sure to check if it is the first
1816 * tag (i.e. a "tag" -1 does exist) and if so replace the -1 "tag" 1812 * tag (i.e. a "tag" -1 does exist) and if so replace the -1 "tag"
1817 * with 0, so we now accept untagged and specified tagged traffic 1813 * with 0, so we now accept untagged and specified tagged traffic
@@ -1848,10 +1844,13 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
1848 } 1844 }
1849 } 1845 }
1850 } 1846 }
1851 ret = i40e_sync_vsi_filters(vsi);
1852 } 1847 }
1853 1848
1854 return ret; 1849 if (test_bit(__I40E_DOWN, &vsi->back->state) ||
1850 test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))
1851 return 0;
1852
1853 return i40e_sync_vsi_filters(vsi);
1855} 1854}
1856 1855
1857/** 1856/**
@@ -1867,7 +1866,6 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
1867 struct i40e_mac_filter *f, *add_f; 1866 struct i40e_mac_filter *f, *add_f;
1868 bool is_vf, is_netdev; 1867 bool is_vf, is_netdev;
1869 int filter_count = 0; 1868 int filter_count = 0;
1870 int ret;
1871 1869
1872 is_vf = (vsi->type == I40E_VSI_SRIOV); 1870 is_vf = (vsi->type == I40E_VSI_SRIOV);
1873 is_netdev = !!(netdev); 1871 is_netdev = !!(netdev);
@@ -1878,12 +1876,6 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
1878 list_for_each_entry(f, &vsi->mac_filter_list, list) 1876 list_for_each_entry(f, &vsi->mac_filter_list, list)
1879 i40e_del_filter(vsi, f->macaddr, vid, is_vf, is_netdev); 1877 i40e_del_filter(vsi, f->macaddr, vid, is_vf, is_netdev);
1880 1878
1881 ret = i40e_sync_vsi_filters(vsi);
1882 if (ret) {
1883 dev_info(&vsi->back->pdev->dev, "Could not sync filters\n");
1884 return ret;
1885 }
1886
1887 /* go through all the filters for this VSI and if there is only 1879 /* go through all the filters for this VSI and if there is only
1888 * vid == 0 it means there are no other filters, so vid 0 must 1880 * vid == 0 it means there are no other filters, so vid 0 must
1889 * be replaced with -1. This signifies that we should from now 1881 * be replaced with -1. This signifies that we should from now
@@ -1926,6 +1918,10 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
1926 } 1918 }
1927 } 1919 }
1928 1920
1921 if (test_bit(__I40E_DOWN, &vsi->back->state) ||
1922 test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))
1923 return 0;
1924
1929 return i40e_sync_vsi_filters(vsi); 1925 return i40e_sync_vsi_filters(vsi);
1930} 1926}
1931 1927