From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 56FD9374F for ; Wed, 21 Sep 2016 03:32:17 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP; 20 Sep 2016 18:32:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,371,1470726000"; d="scan'208";a="11522452" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 20 Sep 2016 18:32:16 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Sep 2016 18:32:16 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.12]) by fmsmsx158.amr.corp.intel.com ([169.254.15.158]) with mapi id 14.03.0248.002; Tue, 20 Sep 2016 18:32:16 -0700 From: "Wiles, Keith" To: Yuanhan Liu CC: "dev@dpdk.org" , "pmatilai@redhat.com" Thread-Topic: [dpdk-dev] [PATCH v2] drivers/net:new PMD using tun/tap host interface Thread-Index: AQHSEvQv7kxpKvAVnE+1FsoxYSMpO6CDn2WA Date: Wed, 21 Sep 2016 01:32:15 +0000 Message-ID: <17C91FD1-D21A-49E3-B093-71AA5C1D79C6@intel.com> References: <1473948649-14169-1-git-send-email-keith.wiles@intel.com> <1474042933-33625-1-git-send-email-keith.wiles@intel.com> <20160920040528.GO23158@yliu-dev.sh.intel.com> In-Reply-To: <20160920040528.GO23158@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.252.141.77] Content-Type: text/plain; charset="us-ascii" Content-ID: <07332F18DD1ED94AB75A5D4327DCC68A@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Wed, 21 Sep 2016 01:32:17 -0000 Regards, Keith > On Sep 20, 2016, at 12:05 AM, Yuanhan Liu w= rote: >=20 > [ just got few more comments after some fiddling with the build issue ] >=20 > 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. >=20 > Just wondering, is it on purpose, or just yet another copy-paste error? Yes, I will send another patch to fix this one. >=20 >> +#include >> +#include >> +#ifdef __linux__ >=20 > So, you meant to add other OS support, say BSD? I did not mean to support BSD, just Linux and I will remove the ifdef to re= flect it. If you look at the configuration file I only added it to the comm= on_linux file and not BSD. The concern I am having is on my standard Ubuntu 16.04 system these errors = do not appear. I would like to understand why they appeared on your system.= The ifdef __linux__ must be enabled as the defines in the linux/if_tun.h f= ile do not give an error. I did play with the headers already and removed t= he ifdef, but as I could not reproduce your build failure it did not trigge= r anything new. I will look at it some more, but it does not make sense and I do want to ma= ke sure it works. >=20 >> +#include >> +#include >> +#include >> +#else >> +#include >> +#endif >> +#include >> + >> +#include >> + >> +/* Linux based path to the TUN device */ >> +#define TUN_TAP_DEV_PATH "/dev/net/tun" >=20 > 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. I only assumed this to work for Linux and not FreeBSD/NetBSD as the handlin= g of the opens on the tun device are different then linux. I also only adde= d it to the common_linux configuration file. >=20 > [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 =3D open("/dev/tap", O_RDWR, 0)); > ... >=20 > --yliu