net/bnxt: avoid invalid vnic id in set L2 Rx mask
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 20 Apr 2018 14:22:01 +0000 (07:22 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 14:54:56 +0000 (15:54 +0100)
commit1b533790f44ee160bae86bdcc5307d7b52225726
treeaaed7405d8bdd2bef06d63426d72bb3092fe5bb7
parente3d8f1e6a665f9f06bf4df01131f738395c9b97d
net/bnxt: avoid invalid vnic id in set L2 Rx mask

In some cases bnxt_hwrm_cfa_l2_set_rx_mask is being called before
VNICs are allocated. The FW returns an error in such cases.
Move bnxt_init_nic to bnxt_dev_init such that the ids are initialized
to an invalid id.
Prevent sending the command to the FW only with a valid vnic id.

Fixes: 244bc98b0da7 ("net/bnxt: set L2 Rx mask")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c