From f86febfb46dadd2aea8cd38b58d88b4f8002564c Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Mon, 26 Sep 2016 11:18:46 -0500 Subject: [PATCH] net/bnxt: support VF Add support to the bnxt PMD to load on a PCI VF. 1) VF cannot change parameters like - speed, autoneg and pause 2) If the VF MAC address shows up as all 0's it has to be provisioned by the PF in the hypervisor. Signed-off-by: Ajit Khaparde Reviewed-by: David Christensen --- drivers/net/bnxt/bnxt_ethdev.c | 15 ++++++++++++--- drivers/net/bnxt/bnxt_hwrm.c | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6c4a2ae859..ae0e6835bc 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -539,6 +539,11 @@ static void bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev, struct bnxt_vnic_info *vnic = STAILQ_FIRST(&bp->ff_pool[pool]); struct bnxt_filter_info *filter; + if (BNXT_VF(bp)) { + RTE_LOG(ERR, PMD, "Cannot add MAC address to a VF interface\n"); + return; + } + if (!vnic) { RTE_LOG(ERR, PMD, "VNIC not found for pool %d!\n", pool); return; @@ -857,8 +862,10 @@ static int bnxt_flow_ctrl_set_op(struct rte_eth_dev *dev, { struct bnxt *bp = (struct bnxt *)dev->data->dev_private; - if (BNXT_NPAR_PF(bp)) - return 0; + if (BNXT_NPAR_PF(bp) || BNXT_VF(bp)) { + RTE_LOG(ERR, PMD, "Flow Control Settings cannot be modified\n"); + return -ENOTSUP; + } switch (fc_conf->mode) { case RTE_FC_NONE: @@ -940,7 +947,9 @@ static struct eth_dev_ops bnxt_dev_ops = { static bool bnxt_vf_pciid(uint16_t id) { if (id == BROADCOM_DEV_ID_57304_VF || - id == BROADCOM_DEV_ID_57406_VF) + id == BROADCOM_DEV_ID_57406_VF || + id == BROADCOM_DEV_ID_5731X_VF || + id == BROADCOM_DEV_ID_5741X_VF) return true; return false; } diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 3a6ff5c7e3..1846955368 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1452,7 +1452,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up) struct bnxt_link_info link_req; uint16_t speed; - if (BNXT_NPAR_PF(bp)) + if (BNXT_NPAR_PF(bp) || BNXT_VF(bp)) return 0; rc = bnxt_valid_link_speed(dev_conf->link_speeds, -- 2.20.1