* [PATCH net-next 1/7] be2net: change to call pmac_del only if necessary
@ 2010-07-23 11:49 Ajit Khaparde
2010-07-23 19:43 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Ajit Khaparde @ 2010-07-23 11:49 UTC (permalink / raw)
To: David Miller; +Cc: netdev
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>
---
drivers/net/benet/be.h | 1 +
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 f17428c..c730bd6 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -221,6 +221,7 @@ struct be_rx_obj {
};
#define BE_NUM_MSIX_VECTORS 2 /* 1 each for Tx and Rx */
+#define BE_INVALID_PMAC_ID 0xffffffff
struct be_adapter {
struct pci_dev *pdev;
struct net_device *netdev;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index e6ca923..899881b 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)
if (!is_valid_ether_addr(mac) || (vf >= num_vfs))
return -EINVAL;
- status = be_cmd_pmac_del(adapter, adapter->vf_if_handle[vf],
- adapter->vf_pmac_id[vf]);
+ if (adapter->vf_pmac_id[vf] != BE_INVALID_PMAC_ID)
+ status = be_cmd_pmac_del(adapter, adapter->vf_if_handle[vf],
+ adapter->vf_pmac_id[vf]);
status = be_cmd_pmac_add(adapter, mac, adapter->vf_if_handle[vf],
&adapter->vf_pmac_id[vf]);
@@ -1910,6 +1911,7 @@ static int be_setup(struct be_adapter *adapter)
"Interface Create failed for VF %d\n", vf);
goto if_destroy;
}
+ adapter->vf_pmac_id[vf] = BE_INVALID_PMAC_ID;
vf++;
}
} else if (!be_physfn(adapter)) {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next 1/7] be2net: change to call pmac_del only if necessary
2010-07-23 11:49 [PATCH net-next 1/7] be2net: change to call pmac_del only if necessary Ajit Khaparde
@ 2010-07-23 19:43 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-07-23 19:43 UTC (permalink / raw)
To: ajitk; +Cc: netdev
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:19:04 +0530
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-23 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 11:49 [PATCH net-next 1/7] be2net: change to call pmac_del only if necessary Ajit Khaparde
2010-07-23 19:43 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).