enic: Bug Fix: Dont reset ENIC_SET_APPLIED flag on port profile disassociate
authorRoopa Prabhu <roprabhu@cisco.com>
Thu, 20 Jan 2011 14:35:54 +0000 (14:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jan 2011 00:59:34 +0000 (16:59 -0800)
enic_get_vf_port returns port profile operation status only if ENIC_SET_APPLIED
flag is set. A recent rework of enic_set_port_profile added code to reset this
flag on disassociate. As a result of which a client calling enic_get_vf_port
to get the status of port profile disassociate will always get a return value
of ENODATA. This patch renames ENIC_SET_APPLIED to more appropriate
ENIC_PORT_REQUEST_APPLIED and reverts back the recent change so that the
flag is set both at associate and disassociate of a port profile.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/enic/enic.h
drivers/net/enic/enic_main.c

index a937f49d9db747c3979240ffc40fa0af961a970b..ca3be4f15556a5e5c2df8574e5a7ad65ba5180e1 100644 (file)
@@ -32,8 +32,8 @@
 
 #define DRV_NAME               "enic"
 #define DRV_DESCRIPTION                "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION            "1.4.1.10"
-#define DRV_COPYRIGHT          "Copyright 2008-2010 Cisco Systems, Inc"
+#define DRV_VERSION            "2.1.1.2"
+#define DRV_COPYRIGHT          "Copyright 2008-2011 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX          6
 
@@ -49,7 +49,7 @@ struct enic_msix_entry {
        void *devid;
 };
 
-#define ENIC_SET_APPLIED               (1 << 0)
+#define ENIC_PORT_REQUEST_APPLIED      (1 << 0)
 #define ENIC_SET_REQUEST               (1 << 1)
 #define ENIC_SET_NAME                  (1 << 2)
 #define ENIC_SET_INSTANCE              (1 << 3)
index a0af48c51fb37d1860061e6358ec4dfdc64005fc..89664c670972c95a00a8944ed5bb73bcb5930a62 100644 (file)
@@ -1318,18 +1318,20 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
                vic_provinfo_free(vp);
                if (err)
                        return err;
-
-               enic->pp.set |= ENIC_SET_APPLIED;
                break;
 
        case PORT_REQUEST_DISASSOCIATE:
-               enic->pp.set &= ~ENIC_SET_APPLIED;
                break;
 
        default:
                return -EINVAL;
        }
 
+       /* Set flag to indicate that the port assoc/disassoc
+        * request has been sent out to fw
+        */
+       enic->pp.set |= ENIC_PORT_REQUEST_APPLIED;
+
        return 0;
 }
 
@@ -1411,7 +1413,7 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
        int err, error, done;
        u16 response = PORT_PROFILE_RESPONSE_SUCCESS;
 
-       if (!(enic->pp.set & ENIC_SET_APPLIED))
+       if (!(enic->pp.set & ENIC_PORT_REQUEST_APPLIED))
                return -ENODATA;
 
        err = enic_dev_init_done(enic, &done, &error);