bnx2x: Correct PFC disablement
authorBarak Witkowski <barak@broadcom.com>
Sun, 2 Dec 2012 04:05:57 +0000 (04:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Dec 2012 01:23:01 +0000 (20:23 -0500)
bnx2x driver could only have enabled pfc via usage of dcbnl; now, it can
also correctly disable it.

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c

index c8c0340..10bc093 100644 (file)
@@ -2052,10 +2052,13 @@ static void bnx2x_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio,
        if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES)
                return;
 
-       bp->dcbx_config_params.admin_pfc_bitmap |= ((setting ? 1 : 0) << prio);
 
-       if (setting)
+       if (setting) {
+               bp->dcbx_config_params.admin_pfc_bitmap |= (1 << prio);
                bp->dcbx_config_params.admin_pfc_tx_enable = 1;
+       } else {
+               bp->dcbx_config_params.admin_pfc_bitmap &= ~(1 << prio);
+       }
 }
 
 static void bnx2x_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio,