From b0120a300b10e0f5ee84c304337c7cf82359b8ec Mon Sep 17 00:00:00 2001 From: Keith Wiles Date: Fri, 20 Jan 2017 08:30:25 -0600 Subject: [PATCH] net/tap: fix build with old kernels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IFF_MULTI_QUEUE does not exist in older kernels: drivers/net/tap/rte_eth_tap.c:143:19: error: ‘IFF_MULTI_QUEUE’ undeclared Signed-off-by: Keith Wiles Reviewed-by: Ferruh Yigit --- drivers/net/tap/rte_eth_tap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 976f2d9d65..c0afc2d55b 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -140,6 +140,7 @@ tun_alloc(char *name) } RTE_LOG(DEBUG, PMD, "TUN/TAP Features %08x\n", features); +#ifdef IFF_MULTI_QUEUE if (!(features & IFF_MULTI_QUEUE) && (RTE_PMD_TAP_MAX_QUEUES > 1)) { RTE_LOG(DEBUG, PMD, "TUN/TAP device only one queue\n"); goto error; @@ -152,6 +153,15 @@ tun_alloc(char *name) RTE_LOG(DEBUG, PMD, "Multi-queue support for %d queues\n", RTE_PMD_TAP_MAX_QUEUES); } +#else + if (RTE_PMD_TAP_MAX_QUEUES > 1) { + RTE_LOG(DEBUG, PMD, "TUN/TAP device only one queue\n"); + goto error; + } else { + ifr.ifr_flags |= IFF_ONE_QUEUE; + RTE_LOG(DEBUG, PMD, "Single queue only support\n"); + } +#endif /* Set the TUN/TAP configuration and get the name if needed */ if (ioctl(fd, TUNSETIFF, (void *)&ifr) < 0) {