From: Ajit Khaparde Date: Mon, 26 Sep 2016 16:18:46 +0000 (-0500) Subject: net/bnxt: support VF X-Git-Tag: spdx-start~5762 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f86febfb46da;p=dpdk.git 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 --- 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,