diff options
author | Ajit Khaparde <ajitk@serverengines.com> | 2010-07-22 21:49:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-23 15:40:52 -0400 |
commit | 9cd9000bdee9131ffd2ce92ca6ef9c86467edd25 (patch) | |
tree | c021e89e872654bc481e52fee9314d3f08b1e548 /drivers/net/benet | |
parent | 37773e8b2da813045d79b38e973cb07b5df788dd (diff) |
be2net: change to call pmac_del only if necessary
If a mac address has not been configured for a VF,
there is no need to call be_cmd_pmac_del.
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r-- | drivers/net/benet/be.h | 1 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index f17428caecf1..c730bd64628a 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -221,6 +221,7 @@ struct be_rx_obj { | |||
221 | }; | 221 | }; |
222 | 222 | ||
223 | #define BE_NUM_MSIX_VECTORS 2 /* 1 each for Tx and Rx */ | 223 | #define BE_NUM_MSIX_VECTORS 2 /* 1 each for Tx and Rx */ |
224 | #define BE_INVALID_PMAC_ID 0xffffffff | ||
224 | struct be_adapter { | 225 | struct be_adapter { |
225 | struct pci_dev *pdev; | 226 | struct pci_dev *pdev; |
226 | struct net_device *netdev; | 227 | struct net_device *netdev; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index e6ca92334d6d..899881b5aab9 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -656,8 +656,9 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) | |||
656 | if (!is_valid_ether_addr(mac) || (vf >= num_vfs)) | 656 | if (!is_valid_ether_addr(mac) || (vf >= num_vfs)) |
657 | return -EINVAL; | 657 | return -EINVAL; |
658 | 658 | ||
659 | status = be_cmd_pmac_del(adapter, adapter->vf_if_handle[vf], | 659 | if (adapter->vf_pmac_id[vf] != BE_INVALID_PMAC_ID) |
660 | adapter->vf_pmac_id[vf]); | 660 | status = be_cmd_pmac_del(adapter, adapter->vf_if_handle[vf], |
661 | adapter->vf_pmac_id[vf]); | ||
661 | 662 | ||
662 | status = be_cmd_pmac_add(adapter, mac, adapter->vf_if_handle[vf], | 663 | status = be_cmd_pmac_add(adapter, mac, adapter->vf_if_handle[vf], |
663 | &adapter->vf_pmac_id[vf]); | 664 | &adapter->vf_pmac_id[vf]); |
@@ -1910,6 +1911,7 @@ static int be_setup(struct be_adapter *adapter) | |||
1910 | "Interface Create failed for VF %d\n", vf); | 1911 | "Interface Create failed for VF %d\n", vf); |
1911 | goto if_destroy; | 1912 | goto if_destroy; |
1912 | } | 1913 | } |
1914 | adapter->vf_pmac_id[vf] = BE_INVALID_PMAC_ID; | ||
1913 | vf++; | 1915 | vf++; |
1914 | } | 1916 | } |
1915 | } else if (!be_physfn(adapter)) { | 1917 | } else if (!be_physfn(adapter)) { |