net/bnxt: support VF
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Mon, 26 Sep 2016 16:18:46 +0000 (11:18 -0500)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 30 Sep 2016 10:27:18 +0000 (12:27 +0200)
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 <ajit.khaparde@broadcom.com>
Reviewed-by: David Christensen <david.christensen@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c

index 6c4a2ae..ae0e683 100644 (file)
@@ -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;
 }
index 3a6ff5c..1846955 100644 (file)
@@ -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,