[dpdk-dev,RFC,2/6] librte_ether: handle RTE_ETH_DEV_INTR_LSC for vdevs
diff mbox

Message ID 1440690041-32391-3-git-send-email-bernard.iremonger@intel.com
State Rejected, archived
Headers show

Commit Message

Bernard Iremonger Aug. 27, 2015, 3:40 p.m. UTC
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ether/rte_ethdev.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Patch
diff mbox

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 64e5a20..65d552a 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1153,12 +1153,18 @@  rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	 * device supports it.
 	 */
 	if (dev_conf->intr_conf.lsc == 1) {
-		const struct rte_pci_driver *pci_drv = &dev->driver->pci_drv;
+		if (dev->dev_type == RTE_ETH_DEV_PCI) {
+			const struct rte_pci_driver *pci_drv = &dev->driver->pci_drv;
 
-		if (!(pci_drv->drv_flags & RTE_PCI_DRV_INTR_LSC)) {
-			PMD_DEBUG_TRACE("driver %s does not support lsc\n",
-					pci_drv->name);
-			return -EINVAL;
+			if (!(pci_drv->drv_flags & RTE_PCI_DRV_INTR_LSC)) {
+				PMD_DEBUG_TRACE("driver %s does not support lsc\n",
+						pci_drv->name);
+				return -EINVAL;
+			}
+		} else if (!(dev->dev_flags & RTE_ETH_DEV_INTR_LSC)) {
+				PMD_DEBUG_TRACE("driver %s does not support lsc\n",
+						dev->data->name);
+				return -EINVAL;
 		}
 	}