net/bnxt: fix VF resource allocation
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 22 May 2018 18:13:45 +0000 (11:13 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 22 May 2018 22:35:01 +0000 (00:35 +0200)
commitedafb57ba4a16a58de7d33cbdce14ecf8a6cfd00
tree5940d2a0ecef3edf9e2637c879121c865b53af0a
parent2b947bd294ffce2d980d092683de82269abe3676
net/bnxt: fix VF resource allocation

If the resource requirement of a VF is more than what is allotted
to it by the FW, a VF can request to reallocate some of the resources.

This is possible only when the NIC is running the Resource Manager aware
CHiMP FW.

If necessary, calculate Tx and Rx ring count using the new RM API.
Otherwise use the Tx and Rx ring count as-is. Update the cp ring count
based on the Tx and Rx ring count.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h
drivers/net/bnxt/bnxt_ring.h