From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 19 Sep 2016 21:05:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,365,1470726000"; d="scan'208";a="11085219" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 19 Sep 2016 21:05:00 -0700 Date: Tue, 20 Sep 2016 12:05:28 +0800 From: Yuanhan Liu To: Keith Wiles Cc: dev@dpdk.org, pmatilai@redhat.com 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 Content-Disposition: inline In-Reply-To: <1474042933-33625-1-git-send-email-keith.wiles@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v2] drivers/net:new PMD using tun/tap host interface X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 04:05:02 -0000 [ 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