• Ido Shamay's avatar
    net/mlx4_en: Add mlx4_en_get_cqe helper · b1b6b4da
    Ido Shamay authored
    This function derives the base address of the CQE from the CQE size,
    and calculates the real CQE context segment in it from the factor
    (this is like before). Before this change the code used the factor to
    calculate the base address of the CQE as well.
    
    The factor indicates in which segment of the cqe stride the cqe information
    is located. For 32-byte strides, the segment is 0, and for 64 byte strides,
    the segment is 1 (bytes 32..63). Using the factor was ok as long as we had
    only 32 and 64 byte strides. However, with larger strides, the factor is zero,
    and so cannot be used to calculate the base of the CQE.
    
    The helper uses the same method of CQE buffer pulling made by all other
    components that reads the CQE buffer (mlx4_ib driver and libmlx4).
    Signed-off-by: default avatarIdo Shamay <idos@mellanox.com>
    Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
    Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b1b6b4da
en_rx.c 31.4 KB