How To Enable Large Receive Offload (LRO)

Version 5

    This is a guide explaining how to enable LRO.
    LRO (Large Receive Offload) is supported by Mellanox hardware and drivers, and can be controlled using Ethtool.

     


    References

     

    Configuration

     

    LRO on Old Kernels

     

    Older Kernels require ethtool private flag "hw_lro" to be enabled to run LRO on either hardware or software (packets aggregation).

    To enable hw_lro, run:

    # ethtool --show-priv-flags eth1

    hw_lro

    ...

     

    Now it is possible to configure LRO type (hardware or software),

    To enable hardware LRO, run:

    # ethtool -K eth1 lro on

    # ethtool --set-priv-flags eth1 hw_lro on

     

    To Enable Software LRO, run:

    # ethtool -K eth1 lro on

     

    To Disable LRO (hardware or software), run:

    # ethtool -K eth1 lro off

     

    LRO on New Kernels

    LRO on a new kernel can be configured using ethtool commands:

     

    1. To configure LRO, run:

    # ethtool -k ens801f1 | grep large-receive-offload

    large-receive-offload: off

     

    2. To enable LRO, run:

    # ethtool -K eth1 lro on

     

    3. To disable LRO, run:

    # ethtool -K eth1 lro off

     

    4.To verify LRO configuration, run:

    # ethtool -k ens801f1 | grep large-receive-offload

    large-receive-offload: on

    Generic Receive Offload (GRO)

     

    When "hw_lro" flag cannot be found on a new kernel (LRO type is hardware), packets aggregation can be done using the GRO feature via ethtool.

     

    To configure GRO via ethtool, run:

    # ethtool -k eth1| grep generic-receive-offload

    generic-receive-offload: on

     

    To enable GRO, run:

    # ethtool -K eth1 gro on

    Monitoring

    1. To monitor LRO packet counters on LRO enabled hardware, run the following via ethtool -S :

     

    # ethtool -S eth1 | grep lro

     

         rx_lro_packets: 0

         rx_lro_bytes: 0

         rx0_lro_packets: 0

         rx0_lro_bytes: 0

         rx1_lro_packets: 0

         rx1_lro_bytes: 0

         rx2_lro_packets: 0

         rx2_lro_bytes: 0

     

         ...

     

    2. To monitor LRO packet counters on LRO enabled software (in older kernels), run the following via ethtool -S :

    # ethtool -S eth1 | grep lro

    rx_sw_lro_aggregated

    rx_sw_lro_flushed

    rx_sw_lro_no_desc

    ...

     

    Refer to Understanding mlx5 ethtool Counters for more details.