• Íñigo Huguet's avatar
    sfc: ensure correct number of XDP queues · 788bc000
    Íñigo Huguet authored
    Commit 99ba0ea6 ("sfc: adjust efx->xdp_tx_queue_count with the real
    number of initialized queues") intended to fix a problem caused by a
    round up when calculating the number of XDP channels and queues.
    However, this was not the real problem. The real problem was that the
    number of XDP TX queues had been reduced to half in
    commit e26ca4b5 ("sfc: reduce the number of requested xdp ev queues"),
    but the variable xdp_tx_queue_count had remained the same.
    
    Once the correct number of XDP TX queues is created again in the
    previous patch of this series, this also can be reverted since the error
    doesn't actually exist.
    
    Only in the case that there is a bug in the code we can have different
    values in xdp_queue_number and efx->xdp_tx_queue_count. Because of this,
    and per Edward Cree's suggestion, I add instead a WARN_ON to catch if it
    happens again in the future.
    
    Note that the number of allocated queues can be higher than the number
    of used ones due to the round up, as explained in the existing comment
    in the code. That's why we also have to stop increasing xdp_queue_number
    beyond efx->xdp_tx_queue_count.
    Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    788bc000
efx_channels.c 31.9 KB