+static int
+eth_dev_close(struct rte_eth_dev *dev)
+{
+ struct pmd_internals *internals = NULL;
+ struct ring_queue *r = NULL;
+ uint16_t i;
+ int ret;
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
+ ret = eth_dev_stop(dev);
+
+ internals = dev->data->dev_private;
+ if (internals->action == DEV_CREATE) {
+ /*
+ * it is only necessary to delete the rings in rx_queues because
+ * they are the same used in tx_queues
+ */
+ for (i = 0; i < dev->data->nb_rx_queues; i++) {
+ r = dev->data->rx_queues[i];
+ rte_ring_free(r->rng);
+ }
+ }
+
+ /* mac_addrs must not be freed alone because part of dev_private */
+ dev->data->mac_addrs = NULL;
+
+ return ret;
+}
+