From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id 1408DAE9A for ; Thu, 1 May 2014 13:07:08 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 01 May 2014 04:07:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,964,1389772800"; d="scan'208";a="426314891" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by azsmga001.ch.intel.com with ESMTP; 01 May 2014 04:07:08 -0700 Received: from irsmsx154.ger.corp.intel.com (163.33.192.96) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 1 May 2014 12:06:10 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.249]) by IRSMSX154.ger.corp.intel.com ([169.254.12.210]) with mapi id 14.03.0123.003; Thu, 1 May 2014 12:06:09 +0100 From: "Burakov, Anatoly" To: "dev@dpdk.org" Thread-Topic: [PATCH 12/16] [RFC] [VFIO] Adding unit tests for VFIO EAL command-line parameter Thread-Index: Ac9lLNIkpx4gSnk/R1KLikMXo5epIg== Date: Thu, 1 May 2014 11:06:09 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 12/16] [RFC] [VFIO] Adding unit tests for VFIO EAL command-line parameter 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: Thu, 01 May 2014 11:07:09 -0000 Adding unit tests for VFIO interrupt type command-line parameter. We don't know if VFIO is compiled (eal_vfio.h header is internal to Linuxapp EAL), we check this flag regardless. Also, quick-fixed a bug in base_virtaddr parsing that prevented it from working (making unit test fail), will later investigate and submit a separate patch with proper fix. Signed-off-by: Anatoly Burakov diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 195a1f5..081b47f 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -768,6 +768,18 @@ test_misc_flags(void) const char *argv11[] =3D {prgname, "--file-prefix=3Dvirtaddr", "-c", "1", "-n", "2", "--base-virtaddr=3D0x12345678"}; =20 + /* try running with --vfio-intr INTx flag */ + const char *argv12[] =3D {prgname, "--file-prefix=3Dintr", + "-c", "1", "-n", "2", "--vfio-intr=3Dlegacy"}; + + /* try running with --vfio-intr MSI-X flag */ + const char *argv13[] =3D {prgname, "--file-prefix=3Dintr", + "-c", "1", "-n", "2", "--vfio-intr=3Dmsix"}; + + /* try running with --vfio-intr invalid flag */ + const char *argv14[] =3D {prgname, "--file-prefix=3Dintr", + "-c", "1", "-n", "2", "--vfio-intr=3Dinvalid"}; + =20 if (launch_proc(argv0) =3D=3D 0) { printf("Error - process ran ok with invalid flag\n"); @@ -820,6 +832,18 @@ test_misc_flags(void) printf("Error - process did not run ok with --base-virtaddr parameter\n"= ); return -1; } + if (launch_proc(argv12) !=3D 0) { + printf("Error - process did not run ok with --vfio-intr INTx parameter\n= "); + return -1; + } + if (launch_proc(argv13) !=3D 0) { + printf("Error - process did not run ok with --vfio-intr MSI-X parameter\= n"); + return -1; + } + if (launch_proc(argv14) =3D=3D 0) { + printf("Error - process run ok with --vfio-intr invalid parameter\n"); + return -1; + } return 0; } #endif diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/ea= l/eal.c index aed37bb..d0c9dfd 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -564,6 +564,8 @@ eal_parse_base_virtaddr(const char *arg) char *end; uint64_t addr; =20 + errno =3D 0; + addr =3D strtoull(arg, &end, 16); =20 /* check for errors */ --=20 1.8.1.4