• Shay Agroskin's avatar
    net/mlx5e: Replace reciprocal_scale in TX select queue function · 57c70d87
    Shay Agroskin authored
    The TX queue index returned by the fallback function ranges
    between [0,NUM CHANNELS - 1] if QoS isn't set and
    [0, (NUM CHANNELS)*(NUM TCs) -1] otherwise.
    
    Our HW uses different TC mapping than the fallback function
    (which is denoted as 'up', user priority) so we only need to extract
    a channel number out of the returned value.
    
    Since (NUM CHANNELS)*(NUM TCs) is a relatively small number, using
    reciprocal scale almost always returns zero.
    We instead access the 'txq2sq' table to extract the sq (and with it the
    channel number) associated with the tx queue, thus getting
    a more evenly distributed channel number.
    
    Perf:
    
    Rx/Tx side with Intel(R) Xeon(R) Silver 4108 CPU @ 1.80GHz and ConnectX-5.
    Used 'iperf' UDP traffic, 10 threads, and priority 5.
    
    Before:	0.566Mpps
    After:	 2.37Mpps
    
    As expected, releasing the existing bottleneck of steering all traffic
    to TX queue zero significantly improves transmission rates.
    
    Fixes: 7ccdd084 ("net/mlx5e: Fix select queue callback")
    Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
    Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    57c70d87
en_tx.c 18.5 KB