Skip to content

Commit

Permalink
net/bnxt: fix link state operations
Browse files Browse the repository at this point in the history
[ upstream commit 586d9da ]

VFs does not have the privilege to change link configuration.
But the driver silently returns success to these ethdev callbacks
without actually issuing the HWRM command to bring the link up/down.

Fixes: 5c20608 ("net/bnxt: add link state operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Kalesh AP authored and cpaelzer committed May 11, 2021
1 parent a9a6ca9 commit 85592e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/bnxt/bnxt_ethdev.c
Expand Up @@ -919,6 +919,9 @@ static int bnxt_dev_set_link_up_op(struct rte_eth_dev *eth_dev)
struct bnxt *bp = eth_dev->data->dev_private;
int rc = 0;

if (!BNXT_SINGLE_PF(bp))
return -ENOTSUP;

if (!bp->link_info.link_up)
rc = bnxt_set_hwrm_link_config(bp, true);
if (!rc)
Expand All @@ -932,6 +935,9 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = eth_dev->data->dev_private;

if (!BNXT_SINGLE_PF(bp))
return -ENOTSUP;

eth_dev->data->dev_link.link_status = 0;
bnxt_set_hwrm_link_config(bp, false);
bp->link_info.link_up = 0;
Expand Down

0 comments on commit 85592e8

Please sign in to comment.