Thread (61 messages) 61 messages, 5 authors, 2017-06-26

Re: [PATCH v4 9/9] ethdev: use embedded rte_device to detach driver

From: Thomas Monjalon <hidden>
Date: 2017-06-21 14:33:17

21/06/2017 01:29, Gaetan Rivet:
quoted hunk ↗ jump to hunk
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -354,26 +354,14 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id)
 static int
 rte_eth_dev_is_detachable(uint8_t port_id)
 {
-	uint32_t dev_flags;
+	struct rte_eth_dev *dev;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
-	switch (rte_eth_devices[port_id].data->kdrv) {
-	case RTE_KDRV_IGB_UIO:
-	case RTE_KDRV_UIO_GENERIC:
-	case RTE_KDRV_NIC_UIO:
-	case RTE_KDRV_NONE:
-	case RTE_KDRV_VFIO:
-		break;
-	default:
-		return -ENOTSUP;
-	}
-	dev_flags = rte_eth_devices[port_id].data->dev_flags;
-	if ((dev_flags & RTE_ETH_DEV_DETACHABLE) &&
-		(!(dev_flags & RTE_ETH_DEV_BONDED_SLAVE)))
+	dev = &rte_eth_devices[port_id];
+	if (dev->data->dev_flags & RTE_ETH_DEV_BONDED_SLAVE)
 		return 0;
-	else
-		return 1;
+	return !!dev->device->devargs->bus->unplug;
 }
The changes in rte_eth_dev_is_detachable() deserves a separate commit.

Are you removing RTE_ETH_DEV_DETACHABLE flag?

I think this change cannot be done before implementing unplug in PCI.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help