Patchwork [net-next-2.6] enic: Fix addr valid check in enic_set_vf_mac

login
register
mail settings
Submitter Roopa Prabhu
Date March 7, 2012, 1:50 p.m.
Message ID <20120307135044.17957.92254.stgit@savbu-pc100.cisco.com>
Download mbox | patch
Permalink /patch/145275/
State Accepted
Delegated to: David Miller
Headers show

Comments

Roopa Prabhu - March 7, 2012, 1:50 p.m.
From: Roopa Prabhu <roprabhu@cisco.com>

zero mac address is a valid address for VIC dynamic vnic and sriov Vf's.
Fix the check in enic_set_vf_mac appropriately

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
---
 drivers/net/ethernet/cisco/enic/enic.h      |    2 +-
 drivers/net/ethernet/cisco/enic/enic_main.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - March 8, 2012, 8:28 a.m.
From: Roopa Prabhu <roprabhu@cisco.com>
Date: Wed, 07 Mar 2012 05:50:44 -0800

> From: Roopa Prabhu <roprabhu@cisco.com>
> 
> zero mac address is a valid address for VIC dynamic vnic and sriov Vf's.
> Fix the check in enic_set_vf_mac appropriately
> 
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
> Signed-off-by: Christian Benvenuti <benve@cisco.com>
> Signed-off-by: Sujith Sankar <ssujith@cisco.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/cisco/enic/enic.h b/drivers/net/ethernet/cisco/enic/enic.h
index cf1fb4b..afe9b16 100644
--- a/drivers/net/ethernet/cisco/enic/enic.h
+++ b/drivers/net/ethernet/cisco/enic/enic.h
@@ -32,7 +32,7 @@ 
 
 #define DRV_NAME		"enic"
 #define DRV_DESCRIPTION		"Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION		"2.1.1.38"
+#define DRV_VERSION		"2.1.1.39"
 #define DRV_COPYRIGHT		"Copyright 2008-2011 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 9080ed6..77b4e87 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1069,7 +1069,7 @@  static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
 	if (err)
 		return err;
 
-	if (is_valid_ether_addr(mac)) {
+	if (is_valid_ether_addr(mac) || is_zero_ether_addr(mac)) {
 		if (vf == PORT_SELF_VF) {
 			memcpy(pp->vf_mac, mac, ETH_ALEN);
 			return 0;