• Michael Chan's avatar
    bnxt_en: Add helper to get the number of CP rings required for TX rings · f5b29c6a
    Michael Chan authored
    Up until now, each TX ring always requires a completion ring/NQ/MSIX.
    bnxt_trim_rings() and the assignment of bp->cp_nr_rings always make
    this assumption.  This will no longer be true in the next patches, so
    we refactor and add helper functions to determine the proper relationship
    between TX rings and the required completion ring/NQ/MSIX.  This patch
    does not change the 1:1 relationship yet.
    
    Note that on P5 chips, each RX and TX ring still requires a completion
    ring.  Only the number of NQs has been reduced.  We should no longer call
    bnxt_trim_rings() to adjust the RX and TX rings on P5 chips.  Replace with
    simple logic to check that RX + TX < CP and adjust accordingly.
    
    bnxt_check_rings() should call _bnxt_get_max_rings() to get the raw
    number of rings instead of bnxt_get_max_rings().  If we are about to
    create TCs, bnxt_get_max_rings() would not be able to calculate the max
    rings correctly.
    Reviewed-by: default avatarAndy Gospodarek <andrew.gospodarek@broadcom.com>
    Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f5b29c6a
bnxt_xdp.c 12.5 KB