Thread (5 messages) 5 messages, 2 authors, 2014-08-02

[PATCH net-next 2/3] be2net: ignore VF mac address setting for the same mac

flat view
STALE4453d SUPERSEDED

From: Sathya Perla <hidden>
Date: 2014-08-01 12:15:44
Subsystem: emulex 10gbps nic be2, be3-r, lancer, skyhawk-r driver (be2net), networking drivers, the rest · Maintainers: Ajit Khaparde, Sriharsha Basavapatna, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 16 in this series.

Revisions (16)
  1. v1
  2. v1
  3. v1
  4. v1
  5. v1
  6. v1
  7. v2 [diff vs current]
  8. v1
  9. v2 [diff vs current]
  10. v1
  11. v1 current
  12. v1
  13. v2 [diff vs current]
  14. v1
  15. v1
  16. v1
From: Vasundhara Volam <redacted>

ndo_set_vf_mac() call may be issued for a mac-addr that is already
active on a VF. If so, silently ignore the request.

Signed-off-by: Vasundhara Volam <redacted>
Signed-off-by: Sathya Perla <redacted>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index da4d386..db4ff14 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1270,6 +1270,12 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
 	if (!is_valid_ether_addr(mac) || vf >= adapter->num_vfs)
 		return -EINVAL;
 
+	/* Proceed further only if user provided MAC is different
+	 * from active MAC
+	 */
+	if (ether_addr_equal(mac, vf_cfg->mac_addr))
+		return 0;
+
 	if (BEx_chip(adapter)) {
 		be_cmd_pmac_del(adapter, vf_cfg->if_handle, vf_cfg->pmac_id,
 				vf + 1);
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help