From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v2] drivers/net:new PMD using tun/tap host interface Date: Tue, 20 Sep 2016 12:05:28 +0800 Message-ID: <20160920040528.GO23158@yliu-dev.sh.intel.com> References: <1473948649-14169-1-git-send-email-keith.wiles@intel.com> <1474042933-33625-1-git-send-email-keith.wiles@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, pmatilai@redhat.com To: Keith Wiles Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 68F965398 for ; Tue, 20 Sep 2016 06:05:02 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1474042933-33625-1-git-send-email-keith.wiles@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" [ just got few more comments after some fiddling with the build issue ] On Fri, Sep 16, 2016 at 11:22:13AM -0500, Keith Wiles wrote: > diff --git a/drivers/net/tap/Makefile b/drivers/net/tap/Makefile > new file mode 100644 > index 0000000..442a2fe > --- /dev/null > +++ b/drivers/net/tap/Makefile > @@ -0,0 +1,60 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2014 John W. Linville > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. > +# Copyright(c) 2014 6WIND S.A. Just wondering, is it on purpose, or just yet another copy-paste error? > +#include > +#include > +#ifdef __linux__ So, you meant to add other OS support, say BSD? > +#include > +#include > +#include > +#else > +#include > +#endif > +#include > + > +#include > + > +/* Linux based path to the TUN device */ > +#define TUN_TAP_DEV_PATH "/dev/net/tun" However, you hardcoded a linux only path here. While checking the code from qemu, I saw that the path is actually different from different UNIX variants, even for FreeBSD and NetBSD. [yliu@yliu-dev ~/qemu]$ grep -E "/dev/.*(tap|tun)" net/tap*.c net/tap-bsd.c: snprintf(dname, sizeof dname, "/dev/tun%d", i); net/tap-bsd.c: snprintf(dname, sizeof dname, "/dev/tap%d", i); net/tap-bsd.c:#define PATH_NET_TAP "/dev/tap" net/tap-linux.c:#define PATH_NET_TUN "/dev/net/tun" net/tap-solaris.c: TFR(tap_fd = open("/dev/tap", O_RDWR, 0)); ... --yliu