{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57502) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57500_VF1) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57500_VF2) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57508_MF1) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57504_MF1) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57502_MF1) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57508_MF2) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57504_MF2) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57502_MF2) },
{ .vendor_id = 0, /* sentinel */ },
};
static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask);
static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
-static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu);
static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev);
static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev);
static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev);
}
bnxt_free_async_cp_ring(bp);
bnxt_free_rxtx_nq_ring(bp);
+
+ rte_free(bp->grp_info);
+ bp->grp_info = NULL;
}
static int bnxt_alloc_mem(struct bnxt *bp, bool reconfig)
int vlan_mask = 0;
int rc;
+ if (!eth_dev->data->nb_tx_queues || !eth_dev->data->nb_rx_queues) {
+ PMD_DRV_LOG(ERR, "Queues are not configured yet!\n");
+ return -EINVAL;
+ }
+
if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) {
PMD_DRV_LOG(ERR,
"RxQ cnt %d > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n",
bp->flags |= BNXT_FLAG_INIT_DONE;
eth_dev->data->dev_started = 1;
bp->dev_stopped = 0;
+ pthread_mutex_lock(&bp->def_cp_lock);
bnxt_schedule_fw_health_check(bp);
+ pthread_mutex_unlock(&bp->def_cp_lock);
return 0;
error:
* hw-vlan-filter is turned OFF from ON, default
* MAC filter should be restored
*/
- if (filter->dflt)
+ if (index == 0 && filter->dflt)
return 0;
filter = bnxt_alloc_filter(bp);
vnic->rss_table[i] =
vnic->fw_grp_ids[reta_conf[idx].reta[sft]];
}
-
- vnic->rss_table[i] =
- vnic->fw_grp_ids[reta_conf[idx].reta[sft]];
}
bnxt_hwrm_vnic_rss_cfg(bp, vnic);
qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
}
-static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
+int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
{
struct bnxt *bp = eth_dev->data->dev_private;
uint32_t new_pkt_size;
if (rc)
return rc;
+ /* Exit if receive queues are not configured yet */
+ if (!eth_dev->data->nb_rx_queues)
+ return rc;
+
new_pkt_size = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN +
VLAN_TAG_SIZE * BNXT_NUM_VLANS;
bp->flags &= ~BNXT_FLAG_JUMBO;
}
- eth_dev->data->dev_conf.rxmode.max_rx_pkt_len = new_pkt_size;
+ /* Is there a change in mtu setting? */
+ if (eth_dev->data->dev_conf.rxmode.max_rx_pkt_len == new_pkt_size)
+ return rc;
for (i = 0; i < bp->nr_vnics; i++) {
struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
}
}
+ if (!rc)
+ eth_dev->data->dev_conf.rxmode.max_rx_pkt_len = new_pkt_size;
+
PMD_DRV_LOG(INFO, "New MTU is %d\n", new_mtu);
return rc;
return false;
}
+static bool bnxt_thor_device(uint16_t id)
+{
+ if (id == BROADCOM_DEV_ID_57508 ||
+ id == BROADCOM_DEV_ID_57504 ||
+ id == BROADCOM_DEV_ID_57502 ||
+ id == BROADCOM_DEV_ID_57508_MF1 ||
+ id == BROADCOM_DEV_ID_57504_MF1 ||
+ id == BROADCOM_DEV_ID_57502_MF1 ||
+ id == BROADCOM_DEV_ID_57508_MF2 ||
+ id == BROADCOM_DEV_ID_57504_MF2 ||
+ id == BROADCOM_DEV_ID_57502_MF2 ||
+ id == BROADCOM_DEV_ID_57500_VF1 ||
+ id == BROADCOM_DEV_ID_57500_VF2)
+ return true;
+
+ return false;
+}
+
bool bnxt_stratus_device(struct bnxt *bp)
{
uint16_t id = bp->pdev->id.device_id;
if (bnxt_vf_pciid(pci_dev->id.device_id))
bp->flags |= BNXT_FLAG_VF;
- if (pci_dev->id.device_id == BROADCOM_DEV_ID_57508 ||
- pci_dev->id.device_id == BROADCOM_DEV_ID_57504 ||
- pci_dev->id.device_id == BROADCOM_DEV_ID_57502 ||
- pci_dev->id.device_id == BROADCOM_DEV_ID_57500_VF1 ||
- pci_dev->id.device_id == BROADCOM_DEV_ID_57500_VF2)
+ if (bnxt_thor_device(pci_dev->id.device_id))
bp->flags |= BNXT_FLAG_THOR_CHIP;
if (pci_dev->id.device_id == BROADCOM_DEV_ID_58802 ||
}
}
+ bnxt_uninit_locks(bp);
rte_free(bp->ptp_cfg);
bp->ptp_cfg = NULL;
return rc;
rc = bnxt_uninit_resources(bp, false);
- if (bp->grp_info != NULL) {
- rte_free(bp->grp_info);
- bp->grp_info = NULL;
- }
-
if (bp->tx_mem_zone) {
rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone);
bp->tx_mem_zone = NULL;
eth_dev->rx_pkt_burst = NULL;
eth_dev->tx_pkt_burst = NULL;
- bnxt_uninit_locks(bp);
-
return rc;
}