eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
eth_dev->intr_handle = &dev->intr_handle;
+ /* allow ethdev to remove on close */
+ eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
+
return eth_dev;
}
static int
hn_dev_mc_addr_list(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
+ struct rte_ether_addr *mc_addr_set,
uint32_t nb_mc_addr)
{
/* No filtering on the synthetic path, but can do it on VF */
return -EINVAL;
}
+ hv->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
+
err = hn_rndis_conf_offload(hv, txmode->offloads,
rxmode->offloads);
if (err) {
}
static void
-hn_dev_close(struct rte_eth_dev *dev __rte_unused)
+hn_dev_close(struct rte_eth_dev *dev)
{
- PMD_INIT_LOG(DEBUG, "close");
+ PMD_INIT_FUNC_TRACE();
hn_vf_close(dev);
+ hn_dev_free_queues(dev);
}
static const struct eth_dev_ops hn_eth_dev_ops = {
hv->port_id = eth_dev->data->port_id;
hv->latency = HN_CHAN_LATENCY_NS;
hv->max_queues = 1;
+ rte_spinlock_init(&hv->vf_lock);
+ hv->vf_port = HN_INVALID_PORT;
err = hn_parse_args(eth_dev);
if (err)
if (!hv->primary)
return -ENOMEM;
- err = hn_attach(hv, ETHER_MTU);
+ err = hn_attach(hv, RTE_ETHER_MTU);
if (err)
goto failed;
hv->max_queues = RTE_MIN(rxr_cnt, (unsigned int)max_chan);
/* If VF was reported but not added, do it now */
- if (hv->vf_present && !hv->vf_dev) {
+ if (hv->vf_present && !hn_vf_attached(hv)) {
PMD_INIT_LOG(DEBUG, "Adding VF device");
err = hn_vf_add(eth_dev, hv);
if (err)
- goto failed;
+ hv->vf_present = 0;
}
return 0;
failed:
PMD_INIT_LOG(NOTICE, "device init failed");
+ hn_tx_pool_uninit(eth_dev);
hn_detach(hv);
return err;
}
eth_dev->rx_pkt_burst = NULL;
hn_detach(hv);
+ hn_tx_pool_uninit(eth_dev);
rte_vmbus_chan_close(hv->primary->chan);
rte_free(hv->primary);
rte_eth_dev_owner_delete(hv->owner.id);