}
}
- /* default vnic 0 */
- rc = bnxt_setup_one_vnic(bp, 0);
- if (rc)
- goto err_out;
/* VNIC configuration */
- if (BNXT_RFS_NEEDS_VNIC(bp)) {
- for (i = 1; i < bp->nr_vnics; i++) {
- rc = bnxt_setup_one_vnic(bp, i);
- if (rc)
- goto err_out;
- }
+ for (i = 0; i < bp->nr_vnics; i++) {
+ rc = bnxt_setup_one_vnic(bp, i);
+ if (rc)
+ goto err_out;
}
for (j = 0; j < bp->tx_nr_rings; j++) {
return rc;
/* MAC Specifics */
- dev_info->max_mac_addrs = bp->max_l2_ctx;
+ dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
dev_info->max_hash_mac_addrs = 0;
/* PF/VF specifics */
dev_info->min_rx_bufsize = 1;
dev_info->max_rx_pktlen = BNXT_MAX_PKT_LEN;
- dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT;
- if (bp->flags & BNXT_FLAG_PTP_SUPPORTED)
- dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
- if (bp->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP)
- dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_VLAN_STRIP;
+ dev_info->rx_offload_capa = bnxt_get_rx_port_offloads(bp);
dev_info->tx_queue_offload_capa = RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
- dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT |
+ dev_info->tx_offload_capa = bnxt_get_tx_port_offloads(bp) |
dev_info->tx_queue_offload_capa;
- if (bp->fw_cap & BNXT_FW_CAP_VLAN_TX_INSERT)
- dev_info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
dev_info->speed_capa = bnxt_get_speed_capabilities(bp);
eth_dev->data->dev_started = 0;
/* Prevent crashes when queues are still in use */
- eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
- eth_dev->tx_pkt_burst = &bnxt_dummy_xmit_pkts;
+ bnxt_stop_rxtx(eth_dev);
bnxt_disable_int(bp);
}
/* Unload the driver, release resources */
-static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = eth_dev->data->dev_private;
return bnxt_dev_stop(eth_dev);
}
-static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = eth_dev->data->dev_private;
uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
bnxt_cancel_fc_thread(bp);
+ rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp);
if (eth_dev->data->dev_started)
ret = bnxt_dev_stop(eth_dev);
return -EINVAL;
}
- bp->flags |= BNXT_FLAG_UPDATE_HASH;
-
/* Update the default RSS VNIC(s) */
vnic = BNXT_GET_DEFAULT_VNIC(bp);
vnic->hash_type = bnxt_rte_to_hwrm_hash_types(rss_conf->rss_hf);
goto err_start;
}
+ rc = bnxt_restore_filters(bp);
+ if (rc)
+ goto err_start;
+
rte_eth_fp_ops[bp->eth_dev->data->port_id].rx_pkt_burst =
bp->eth_dev->rx_pkt_burst;
rte_eth_fp_ops[bp->eth_dev->data->port_id].tx_pkt_burst =
bp->eth_dev->tx_pkt_burst;
rte_mb();
- rc = bnxt_restore_filters(bp);
- if (rc)
- goto err_start;
-
PMD_DRV_LOG(INFO, "Port: %u Recovered from FW reset\n",
bp->eth_dev->data->port_id);
pthread_mutex_unlock(&bp->err_recovery_lock);
RTE_ETH_EVENT_INTR_RMV,
NULL);
pthread_mutex_unlock(&bp->err_recovery_lock);
- PMD_DRV_LOG(ERR, "Failed to recover from FW reset\n");
+ PMD_DRV_LOG(ERR, "Port %u: Failed to recover from FW reset\n",
+ bp->eth_dev->data->port_id);
}
void bnxt_dev_reset_and_resume(void *arg)
rc = rte_eal_alarm_set(us, bnxt_dev_recover, (void *)bp);
if (rc)
- PMD_DRV_LOG(ERR, "Error setting recovery alarm");
+ PMD_DRV_LOG(ERR, "Port %u: Error setting recovery alarm",
+ bp->eth_dev->data->port_id);
}
uint32_t bnxt_read_fw_status_reg(struct bnxt *bp, uint32_t index)
bp->flags |= BNXT_FLAG_FATAL_ERROR;
bp->flags |= BNXT_FLAG_FW_RESET;
- bnxt_stop_rxtx(bp);
+ bnxt_stop_rxtx(bp->eth_dev);
PMD_DRV_LOG(ERR, "Detected FW dead condition\n");
static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = eth_dev->data->dev_private;
+ size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
int rc = 0;
+ if (bp->max_l2_ctx > RTE_ETH_NUM_RECEIVE_MAC_ADDR)
+ PMD_DRV_LOG(INFO, "Max number of MAC addrs supported is %d, but will be limited to %d\n",
+ bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
+
eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
- RTE_ETHER_ADDR_LEN *
- bp->max_l2_ctx,
+ RTE_ETHER_ADDR_LEN * max_mac_addr,
0);
if (eth_dev->data->mac_addrs == NULL) {
PMD_DRV_LOG(ERR, "Failed to alloc MAC addr tbl\n");
if (rc)
return rc;
- rc = bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(bp);
- if (rc)
- return rc;
-
bnxt_hwrm_port_mac_qcfg(bp);
bnxt_hwrm_parent_pf_qcfg(bp);
if (!ctx)
return;
- if (ctx->va)
- rte_free(ctx->va);
+ rte_free(ctx->va);
ctx->va = NULL;
ctx->dma = RTE_BAD_IOVA;
RTE_LOG_REGISTER_SUFFIX(bnxt_logtype_driver, driver, NOTICE);
RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
-
+RTE_PMD_REGISTER_KMOD_DEP(net_bnxt, "* igb_uio | uio_pci_generic | vfio-pci");