• S
    net/mlx5e: Add port FEC get/set functions · 2095b264
    Shay Agroskin 提交于
    Added functions to query and set link FEC policy.
    To get/set FEC capabilities in PPLM reg we need to query
    current link speed.
    'mlx5_get_fec_speed_field' queries current link speed and returns
    correct field offset.
    
    FEC Query's return value is divided into 'active FEC policy', which is
    the FEC policy used by the link, and 'configured FEC policy', which
    is the FEC policy requested by the user.
    The two values may differ if:
    1) FEC policy was configured to 'auto',
       in which case the active FEC policy would be the default FEC policy
       for current link speed.
    
    2) FEC policy was changed, but no link reset is performed. In which case,
       the active FEC policy would become the configured one after a link
       reset.
    
    FEC set function sets FEC policy for all link speeds and perform link
    reset.
    1) If current link speed doesn't support requested FEC policy,
       the function fails.
    2) If a different link speed doesn't support requested FEC policy,
       FEC capbilities for this speed are turned off and a warning message
       is printed.
    Signed-off-by: NShay Agroskin <shayag@mellanox.com>
    Reviewed-by: NEran Ben Elisha <eranbe@mellanox.com>
    Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
    2095b264
port.c 10.7 KB