net/bnxt: fix switch domain allocation
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Wed, 15 Jun 2022 14:56:57 +0000 (20:26 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 24 Jun 2022 21:23:52 +0000 (23:23 +0200)
commitaef3baca157d8202c26c5e034a9ab920da60d414
tree922e69fa9f5353615db371d9a19782c050dda1ca
parentd3fdd5b880a9f056c1f50ca7a38b5aa986d9331f
net/bnxt: fix switch domain allocation

Allocate switch domain after the trusted VF capability is queried
from the FW. Currently we are calling the function earlier.
Since the switch domain is allocated only for PFs or trusted VF,
the current location of code fails to allocate the domain during init.
But during cleanup we try to free the domain incorrectly.
Fix the behavior by changing the sequence of function calls.

Fixes: 3127f99274b67 ("net/bnxt: refactor init/uninit")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c