• Amit Cohen's avatar
    mlxsw: pci: Handle up to 64 Rx completions in tasklet · e28d8aba
    Amit Cohen authored
    We can get many completions in one interrupt. Currently, the CQ tasklet
    handles up to half queue size completions, and then arms the hardware to
    generate additional events, which means that in case that there were
    additional completions that we did not handle, we will get immediately an
    additional interrupt to handle the rest.
    
    The decision to handle up to half of the queue size is arbitrary and was
    determined in 2015, when mlxsw driver was added to the kernel. One
    additional fact that should be taken into account is that while WQEs
    from RDQ are handled, the CPU that handles the tasklet is dedicated for
    this task, which means that we might hold the CPU for a long time.
    
    Handle WQEs in smaller chucks, then arm CQ doorbell to notify the hardware
    to send additional notifications. Set the chunk size to 64 as this number
    is recommended using NAPI and the driver will use NAPI in a next patch.
    Note that for now we use ARM doorbell to retrigger CQ tasklet, but with
    NAPI it will be more efficient as software will reschedule the poll
    method and we will not involve hardware for that.
    Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e28d8aba
pci.c 59.3 KB