[dpdk-dev] net/tap: fix IFF_MULTI_QUEUE in older kernels not found

Message ID 20170120143025.23710-1-keith.wiles@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Wiles, Keith Jan. 20, 2017, 2:30 p.m. UTC
  Signed-off-by: Keith Wiles <keith.wiles@intel.com>
---
 drivers/net/tap/rte_eth_tap.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Ferruh Yigit Jan. 20, 2017, 4:11 p.m. UTC | #1
On 1/20/2017 2:30 PM, Keith Wiles wrote:
> Signed-off-by: Keith Wiles <keith.wiles@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Hi Thomas,

Although this is a driver patch, would you mind getting it to the main
tree to fix build error asap (instead of waiting next integration)?

Thanks,
ferruh
  
Thomas Monjalon Jan. 20, 2017, 5:37 p.m. UTC | #2
2017-01-20 16:11, Ferruh Yigit:
> On 1/20/2017 2:30 PM, Keith Wiles wrote:
> > Signed-off-by: Keith Wiles <keith.wiles@intel.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Hi Thomas,
> 
> Although this is a driver patch, would you mind getting it to the main
> tree to fix build error asap (instead of waiting next integration)?

Applied, thanks
  

Patch

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index d5e2fc3..cb96e99 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -139,6 +139,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;
@@ -151,6 +152,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) {