bnx2x: disable fairness if ETS is enabled
authorDmitry Kravkov <dmitry@broadcom.com>
Tue, 14 Jun 2011 01:33:13 +0000 (01:33 +0000)
committerDavid S. Miller <davem@conan.davemloft.net>
Wed, 15 Jun 2011 14:56:14 +0000 (10:56 -0400)
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
drivers/net/bnx2x/bnx2x_dcb.h
drivers/net/bnx2x/bnx2x_main.c

index bed369d67e02b010afe43363f373aa1543408bad..5bedd85e94dfa772ef7307c6979449afc0b8bec5 100644 (file)
@@ -60,6 +60,8 @@ struct bnx2x_dcbx_port_params {
 #define BNX2X_DCBX_OVERWRITE_SETTINGS_DISABLE          0
 #define BNX2X_DCBX_OVERWRITE_SETTINGS_ENABLE           1
 #define BNX2X_DCBX_OVERWRITE_SETTINGS_INVALID  (BNX2X_DCBX_CONFIG_INV_VALUE)
+#define BNX2X_IS_ETS_ENABLED(bp) ((bp)->dcb_state == BNX2X_DCB_STATE_ON &&\
+                                 (bp)->dcbx_port_params.ets.enabled)
 
 struct bnx2x_config_lldp_params {
        u32 overwrite_settings;
index 637ff5ac2445d1da8fee242e3a1686b527c4eacc..bc516bbcd9fd985a413cc6756dab6c02e4a264ec 100644 (file)
@@ -1892,8 +1892,12 @@ static void bnx2x_calc_vn_weight_sum(struct bnx2x *bp)
                bp->vn_weight_sum += vn_min_rate;
        }
 
-       /* ... only if all min rates are zeros - disable fairness */
-       if (all_zero) {
+       /* if ETS or all min rates are zeros - disable fairness */
+       if (BNX2X_IS_ETS_ENABLED(bp)) {
+               bp->cmng.flags.cmng_enables &=
+                                       ~CMNG_FLAGS_PER_PORT_FAIRNESS_VN;
+               DP(NETIF_MSG_IFUP, "Fairness will be disabled due to ETS\n");
+       } else if (all_zero) {
                bp->cmng.flags.cmng_enables &=
                                        ~CMNG_FLAGS_PER_PORT_FAIRNESS_VN;
                DP(NETIF_MSG_IFUP, "All MIN values are zeroes"