[dpdk-dev] examples/ip_pipeline: fix freeBSD build error

Message ID 1476719337-97327-1-git-send-email-jasvinder.singh@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Jasvinder Singh Oct. 17, 2016, 3:48 p.m. UTC
  Error log:
 CC init.o
 examples/ip_pipeline/init.c:38:22: fatal error: linux/if.h: No such file or directory
 #include <linux/if.h>
                      ^
Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 examples/ip_pipeline/init.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
  

Comments

Cristian Dumitrescu Oct. 18, 2016, 1:28 p.m. UTC | #1
> -----Original Message-----
> From: Singh, Jasvinder
> Sent: Monday, October 17, 2016 4:49 PM
> To: dev@dpdk.org
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Subject: [PATCH] examples/ip_pipeline: fix freeBSD build error
> 
> Error log:
>  CC init.o
>  examples/ip_pipeline/init.c:38:22: fatal error: linux/if.h: No such file or
> directory
>  #include <linux/if.h>
>                       ^
> Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
  
Thomas Monjalon Oct. 25, 2016, 2:32 p.m. UTC | #2
> > Error log:
> >  CC init.o
> >  examples/ip_pipeline/init.c:38:22: fatal error: linux/if.h: No such file or
> > directory
> >  #include <linux/if.h>
> >                       ^
> > Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")
> > 
> > Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 4fed474..3b36b53 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -35,8 +35,10 @@ 
 #include <stdio.h>
 #include <string.h>
 #include <netinet/in.h>
+#ifdef RTE_EXEC_ENV_LINUXAPP
 #include <linux/if.h>
 #include <linux/if_tun.h>
+#endif
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
@@ -1160,6 +1162,15 @@  app_init_tm(struct app_params *app)
 	}
 }
 
+#ifndef RTE_EXEC_ENV_LINUXAPP
+static void
+app_init_tap(struct app_params *app) {
+	if (app->n_pktq_tap == 0)
+		return;
+
+	rte_panic("TAP device not supported.\n");
+}
+#else
 static void
 app_init_tap(struct app_params *app)
 {
@@ -1187,6 +1198,7 @@  app_init_tap(struct app_params *app)
 		app->tap[i] = fd;
 	}
 }
+#endif
 
 #ifdef RTE_LIBRTE_KNI
 static int
@@ -1404,6 +1416,7 @@  void app_pipeline_params_get(struct app_params *app,
 			out->burst_size = app->tm_params[in->id].burst_read;
 			break;
 		}
+#ifdef RTE_EXEC_ENV_LINUXAPP
 		case APP_PKTQ_IN_TAP:
 		{
 			struct app_pktq_tap_params *tap_params =
@@ -1420,6 +1433,7 @@  void app_pipeline_params_get(struct app_params *app,
 			out->burst_size = app->tap_params[in->id].burst_read;
 			break;
 		}
+#endif
 #ifdef RTE_LIBRTE_KNI
 		case APP_PKTQ_IN_KNI:
 		{
@@ -1564,6 +1578,7 @@  void app_pipeline_params_get(struct app_params *app,
 				app->tm_params[in->id].burst_write;
 			break;
 		}
+#ifdef RTE_EXEC_ENV_LINUXAPP
 		case APP_PKTQ_OUT_TAP:
 		{
 			struct rte_port_fd_writer_params *params =
@@ -1575,6 +1590,7 @@  void app_pipeline_params_get(struct app_params *app,
 				app->tap_params[in->id].burst_write;
 			break;
 		}
+#endif
 #ifdef RTE_LIBRTE_KNI
 		case APP_PKTQ_OUT_KNI:
 		{