• Jesse Brandeburg's avatar
    ice: fix receive buffer size miscalculation · 10083aef
    Jesse Brandeburg authored
    The driver is misconfiguring the hardware for some values of MTU such that
    it could use multiple descriptors to receive a packet when it could have
    simply used one.
    
    Change the driver to use a round-up instead of the result of a shift, as
    the shift can truncate the lower bits of the size, and result in the
    problem noted above. It also aligns this driver with similar code in i40e.
    
    The insidiousness of this problem is that everything works with the wrong
    size, it's just not working as well as it could, as some MTU sizes end up
    using two or more descriptors, and there is no way to tell that is
    happening without looking at ice_trace or a bus analyzer.
    
    Fixes: efc2214b ("ice: Add support for XDP")
    Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
    Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
    Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
    Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    10083aef
ice_base.c 28.9 KB