/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
}
static void
+bond_ethdev_free_queues(struct rte_eth_dev *dev)
+{
+ uint8_t i;
+
+ for (i = 0; i < dev->data->nb_rx_queues; i++) {
+ rte_free(dev->data->rx_queues[i]);
+ dev->data->rx_queues[i] = NULL;
+ }
+ dev->data->nb_rx_queues = 0;
+
+ for (i = 0; i < dev->data->nb_tx_queues; i++) {
+ rte_free(dev->data->tx_queues[i]);
+ dev->data->tx_queues[i] = NULL;
+ }
+ dev->data->nb_tx_queues = 0;
+}
+
+void
bond_ethdev_stop(struct rte_eth_dev *eth_dev)
{
struct bond_dev_private *internals = eth_dev->data->dev_private;
eth_dev->data->dev_started = 0;
}
-static void
-bond_ethdev_close(struct rte_eth_dev *dev __rte_unused)
+void
+bond_ethdev_close(struct rte_eth_dev *dev)
{
+ bond_ethdev_free_queues(dev);
}
/* forward declaration */
return -1;
}
+static int
+bond_uninit(const char *name)
+{
+ int ret;
+
+ if (name == NULL)
+ return -EINVAL;
+
+ RTE_LOG(INFO, EAL, "Uninitializing pmd_bond for %s\n", name);
+
+ /* free link bonding eth device */
+ ret = rte_eth_bond_free(name);
+ if (ret < 0)
+ RTE_LOG(ERR, EAL, "Failed to free %s\n", name);
+
+ return ret;
+}
+
/* this part will resolve the slave portids after all the other pdev and vdev
* have been allocated */
static int
.name = "eth_bond",
.type = PMD_VDEV,
.init = bond_init,
+ .uninit = bond_uninit,
};
PMD_REGISTER_DRIVER(bond_drv);