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 7314CE6D for ; Tue, 11 Oct 2016 22:57:29 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 11 Oct 2016 13:57:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,330,1473145200"; d="scan'208";a="1052499964" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 11 Oct 2016 13:57:28 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 11 Oct 2016 13:57:28 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.160]) by FMSMSX155.amr.corp.intel.com ([169.254.5.8]) with mapi id 14.03.0248.002; Tue, 11 Oct 2016 13:57:28 -0700 From: "Wiles, Keith" To: "Yigit, Ferruh" CC: "dev@dpdk.org" , "pmatilai@redhat.com" , "yuanhan.liu@linux.intel.com" Thread-Topic: [dpdk-dev] [PATCH v4] drivers/net:new PMD using tun/tap host interface Thread-Index: AQHSI7sEa9dudpE36k+VLED0Xx318qCkMgiA Date: Tue, 11 Oct 2016 20:57:27 +0000 Message-ID: References: <1474423220-10207-1-git-send-email-keith.wiles@intel.com> <1475592311-25749-1-git-send-email-keith.wiles@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.12.209] Content-Type: text/plain; charset="us-ascii" Content-ID: <74D35158BA7FB44B8F31F918DB76558B@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] 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, 11 Oct 2016 20:57:29 -0000 Regards, Keith > On Oct 11, 2016, at 7:28 AM, Yigit, Ferruh wrote= : >=20 > On 10/4/2016 3:45 PM, Keith Wiles wrote: >> +/* >> + * Open a TAP interface device. >> + */ >> +static int >> +rte_pmd_tap_devinit(const char *name, const char *params) >> +{ >> + int ret =3D 0; >> + struct rte_kvargs *kvlist; >> + struct tap_info tap_info; >> + >> + /* Setup default values */ >> + memset(&tap_info, 0, sizeof(tap_info)); >> + >> + tap_info.speed =3D ETH_SPEED_NUM_10G; >> + snprintf(tap_info.name, sizeof(tap_info.name), "dtap%d", tap_unit++); >> + >> + if ((params =3D=3D NULL) || (params[0] =3D=3D '\0')) { >> + RTE_LOG(INFO, PMD, "Initializing pmd_tap for %s\n", name); >> + >> + ret =3D eth_dev_tap_create(name, &tap_info); >> + goto leave; >> + } >> + >> + RTE_LOG(INFO, PMD, "Initialize %s with params (%s)\n", name, params); >> + >> + kvlist =3D rte_kvargs_parse(params, valid_arguments); >> + if (!kvlist) { >> + ret =3D eth_dev_tap_create(name, &tap_info); >> + goto leave; >> + } >> + >> + if (rte_kvargs_count(kvlist, ETH_TAP_SPEED_ARG) =3D=3D 1) { >> + ret =3D rte_kvargs_process(kvlist, ETH_TAP_SPEED_ARG, >> + &set_interface_speed, &tap_info); >> + if (ret < 0) >> + goto leave; >> + } else >> + set_interface_speed(NULL, NULL, &tap_info); >> + >> + if (rte_kvargs_count(kvlist, ETH_TAP_IFACE_ARG) =3D=3D 1) { >> + ret =3D rte_kvargs_process(kvlist, ETH_TAP_IFACE_ARG, >> + &set_interface_name, &tap_info); >> + if (ret < 0) >> + goto leave; >> + } else >> + set_interface_name(NULL, NULL, (void *)&tap_info); >=20 > Also there must be a eth_dev_tap_create() call after this point to use > tap_info struct with custom values, right? > "--vdev eth_tap0,iface=3Dfoo0" parameter shouldn't be working with this > code, right? Removed the extra code. >=20 >> + >> + rte_kvargs_free(kvlist); >> + >> +leave: >> + if (ret =3D=3D -1) >> + RTE_LOG(INFO, PMD, "Failed to create pmd_tap for %s\n", name); >> + >> + return ret; >> +} >=20