Skip to content
  • John Fastabend's avatar
    ixgbe: align flow control DV macros with datasheet · 4f8a91ad
    John Fastabend authored
    
    
    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: default avatarJohn Fastabend <john.r.fastabend@intel.com>
    Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    4f8a91ad