/* disable uio/vfio intr/eventfd mapping */
rte_intr_disable(intr_handle);
+ /* Stop the child representors for this device */
+ bnxt_vf_rep_stop_all(bp);
+
/* delete the bnxt ULP port details */
bnxt_ulp_port_deinit(bp);
struct bnxt_vf_representor *vfr = dev->data->dev_private;
bp = vfr->parent_dev->data->dev_private;
/* parent is deleted while children are still valid */
- if (!bp)
+ if (!bp) {
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR Error %d:%d\n",
+ dev->data->port_id,
+ filter_type,
+ filter_op);
return -EIO;
+ }
}
ret = is_bnxt_in_error(bp);
vf_rep_eth_dev = bp->rep_info[i].vfr_eth_dev;
if (!vf_rep_eth_dev)
continue;
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR pci remove\n",
+ vf_rep_eth_dev->data->port_id);
rte_eth_dev_destroy(vf_rep_eth_dev, bnxt_vf_representor_uninit);
}
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d pci remove\n",
+ eth_dev->data->port_id);
ret = rte_eth_dev_destroy(eth_dev, bnxt_dev_uninit);
return ret;
ret = -ENODEV;
return ret;
}
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR pci probe\n",
+ backing_eth_dev->data->port_id);
backing_bp->rep_info[representor.vf_id].vfr_eth_dev =
vf_rep_eth_dev;
backing_bp->num_reps++;
backing_eth_dev = rte_eth_dev_allocated(pci_dev->device.name);
}
-
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d pci probe\n",
+ backing_eth_dev->data->port_id);
/* probe representor ports now */
ret = bnxt_rep_port_probe(pci_dev, eth_da, backing_eth_dev);
* +ve value will at least help in proper cleanup
*/
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d pci remove\n", eth_dev->data->port_id);
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
if (eth_dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
return rte_eth_dev_destroy(eth_dev,
struct rte_eth_link *link;
struct bnxt *parent_bp;
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR init\n", eth_dev->data->port_id);
vf_rep_bp->vf_id = rep_params->vf_id;
vf_rep_bp->switch_domain_id = rep_params->switch_domain_id;
vf_rep_bp->parent_dev = rep_params->parent_dev;
struct bnxt *parent_bp;
struct bnxt_vf_representor *rep =
(struct bnxt_vf_representor *)eth_dev->data->dev_private;
-
uint16_t vf_id;
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id);
eth_dev->data->mac_addrs = NULL;
eth_dev->dev_ops = NULL;
parent_bp = rep->parent_dev->data->dev_private;
- if (!parent_bp)
+ if (!parent_bp) {
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d already freed\n",
+ eth_dev->data->port_id);
return 0;
+ }
parent_bp->num_reps--;
vf_id = rep->vf_id;
vfr->vf_id, rc);
(void)bnxt_ulp_delete_vfr_default_rules(vfr);
}
-
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR created and initialized\n",
+ vfr->dpdk_port_id);
return rc;
}
parent_bp = rep_bp->parent_dev->data->dev_private;
rep_info = &parent_bp->rep_info[rep_bp->vf_id];
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR start\n", eth_dev->data->port_id);
pthread_mutex_lock(&rep_info->vfr_start_lock);
if (!rep_info->conduit_valid) {
rc = bnxt_get_dflt_vnic_svif(parent_bp, rep_bp);
static int bnxt_tf_vfr_free(struct bnxt_vf_representor *vfr)
{
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR ulp free\n", vfr->dpdk_port_id);
return bnxt_ulp_delete_vfr_default_rules(vfr);
}
}
parent_bp = vfr->parent_dev->data->dev_private;
- if (!parent_bp)
+ if (!parent_bp) {
+ PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR already freed\n",
+ vfr->dpdk_port_id);
return 0;
+ }
/* Check if representor has been already freed in FW */
if (!vfr->vfr_tx_cfa_action)
eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
eth_dev->tx_pkt_burst = &bnxt_dummy_xmit_pkts;
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR stop\n", eth_dev->data->port_id);
+
bnxt_vfr_free(vfr_bp);
if (eth_dev->data->dev_started)
void bnxt_vf_rep_dev_close_op(struct rte_eth_dev *eth_dev)
{
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d VFR close\n", eth_dev->data->port_id);
bnxt_vf_representor_uninit(eth_dev);
}
}
return 0;
}
+
+void bnxt_vf_rep_stop_all(struct bnxt *bp)
+{
+ uint16_t vf_id;
+ struct rte_eth_dev *rep_eth_dev;
+
+ /* No vfrep ports just exit */
+ if (!bp->rep_info)
+ return;
+
+ for (vf_id = 0; vf_id < BNXT_MAX_VF_REPS; vf_id++) {
+ rep_eth_dev = bp->rep_info[vf_id].vfr_eth_dev;
+ if (!rep_eth_dev)
+ continue;
+ bnxt_vf_rep_dev_stop_op(rep_eth_dev);
+ }
+}
int bnxt_vf_rep_stats_get_op(struct rte_eth_dev *eth_dev,
struct rte_eth_stats *stats);
int bnxt_vf_rep_stats_reset_op(struct rte_eth_dev *eth_dev);
+void bnxt_vf_rep_stop_all(struct bnxt *bp);
#endif /* _BNXT_REPS_H_ */
}
/* create the default rules */
bnxt_ulp_create_df_rules(bp);
- BNXT_TF_DBG(DEBUG, "ULP Port:%d created and initialized\n",
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d ULP port init\n",
bp->eth_dev->data->port_id);
return rc;
return;
}
- BNXT_TF_DBG(DEBUG, "ULP Port:%d destroyed\n",
+ BNXT_TF_DBG(DEBUG, "BNXT Port:%d ULP port deinit\n",
bp->eth_dev->data->port_id);
/* Get the session details */