ixgbe: align flow control DV macros with datasheet
authorJohn Fastabend <john.r.fastabend@intel.com>
Wed, 28 Mar 2012 11:42:45 +0000 (11:42 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 14 Jun 2012 10:12:17 +0000 (03:12 -0700)
commit4f8a91ad9aafbc7c70097a16404fa89aa41c8deb
tree485ba2b85b38a3a213940d0d7fbac45bf7ba7f83
parent185095fb80ce57c0f3db8738e36ad7c02dc34d33
ixgbe: align flow control DV macros with datasheet

The flow control DV macros are used to calculate the flow control
high and low thresholds. This patch annotates these macros slightly
better and fixes the issues below.

The macro variables are renamed LINK to _max_frame_link and TC to
_max_frame_tc. This was to avoid confusion and make them more
readable. It was found that people auditing the code read TC to be
'traffic class' in the 802.1Q definition instead of the max frame
size of the tc. Hopefully it is clear now.

This audit also found the following real deviations from the
theoretical values. Fixed in this patch.

  * I multiplied the DV calculations by (36/25) which always
    evaluates to 1. This does not match the intended theoretical
    value of 1.44.

  * IXGBE_BT2KB added 1023 to account for rounding however this
    really should be 8 * 1023 - 1 to account for division by 8k.

  * x2 multiplication of max frame in DV calculations to account
    for updated hardware recommendations.

With this patch the DV values are inline with the recommendations
in the 82599 and 82598 data sheets. Its worth noting I did not
see any dropped frames with flow control on in my experiments without
this patch. However aligning with the hardware specs and
recommendations seems like a good idea here to account for worst
case scenarios.

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/ethernet/intel/ixgbe/ixgbe_type.h