ixgbe: DCB, set minimum bandwidth per traffic class
authorJohn Fastabend <john.r.fastabend@intel.com>
Wed, 9 Mar 2011 04:46:16 +0000 (04:46 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 12 Mar 2011 12:14:48 +0000 (04:14 -0800)
DCB provides a guaranteed bandwidth in the case with 0%
bandwidth then no bandwidth is guaranteed. However the
traffic class should still be able to transmit traffic.
For this to work the traffic class must be given the
minimum credits required to send a frame.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ixgbe/ixgbe_dcb.c

index e7b551af573ddd486e66f17a1814fc4081558c66..41c529fac0abeaf647eebb734b6ab05e8182d392 100644 (file)
@@ -64,7 +64,7 @@ s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill, __u16 *max, int max_frame)
                        val = min_credit;
                refill[i] = val;
 
-               max[i] = (bw[i] * MAX_CREDIT)/100;
+               max[i] = bw[i] ? (bw[i] * MAX_CREDIT)/100 : min_credit;
        }
        return 0;
 }