Skip to content

Commit

Permalink
net/bnxt: fix VLAN add when port is stopped
Browse files Browse the repository at this point in the history
[ upstream commit 8b60154 ]

Driver destroys the vnic when the port is brought down.
When user tries to add a vlan when port is stopped, driver
issues HWRM command to FW with invalid vnic_id and it fails.

Fixed to return an error while setting vlan when port is
not started.

Fixes: b4e190d ("net/bnxt: fix MAC/VLAN filter allocation")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Kalesh AP authored and kevintraynor committed May 27, 2020
1 parent 7f774a6 commit 56090ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/bnxt/bnxt_ethdev.c
Expand Up @@ -1418,6 +1418,11 @@ static int bnxt_vlan_filter_set_op(struct rte_eth_dev *eth_dev,
{
struct bnxt *bp = eth_dev->data->dev_private;

if (!eth_dev->data->dev_started) {
PMD_DRV_LOG(ERR, "port must be started before setting vlan\n");
return -EINVAL;
}

/* These operations apply to ALL existing MAC/VLAN filters */
if (on)
return bnxt_add_vlan_filter(bp, vlan_id);
Expand Down

0 comments on commit 56090ed

Please sign in to comment.