From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id DAC83235 for ; Thu, 29 Jun 2017 13:14:37 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2017 04:14:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,280,1496127600"; d="scan'208";a="986637064" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga003.jf.intel.com with ESMTP; 29 Jun 2017 04:14:28 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 29 Jun 2017 12:14:27 +0100 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.211]) by irsmsx155.ger.corp.intel.com ([169.254.14.182]) with mapi id 14.03.0319.002; Thu, 29 Jun 2017 12:14:27 +0100 From: "Van Haaren, Harry" To: 'Jerin Jacob' CC: "dev@dpdk.org" , "thomas@monjalon.net" , "Wiles, Keith" , "Richardson, Bruce" Thread-Topic: [PATCH 5/6] service core: add unit tests Thread-Index: AQHS7AAETOWi1b9TB0md+eLOb0ZsBaI3ETIAgALv38A= Date: Thu, 29 Jun 2017 11:14:26 +0000 Message-ID: References: <1498208779-166205-1-git-send-email-harry.van.haaren@intel.com> <1498208779-166205-5-git-send-email-harry.van.haaren@intel.com> <20170626130609.GD5612@jerin> In-Reply-To: <20170626130609.GD5612@jerin> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTM0YzE1NWMtYWU3Yi00MTgzLWI5NDUtZWY3ZTAxMDhmZGU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjRiUE1mR2FmaDFCUU1hVU5yUFkzdXl0YzlmOXNVUEhaRXVzMWxmaWRmSlk9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 5/6] service core: add unit tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 11:14:38 -0000 > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Monday, June 26, 2017 2:06 PM > To: Van Haaren, Harry > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith ; Richardson, > Bruce > Subject: Re: [PATCH 5/6] service core: add unit tests >=20 > -----Original Message----- > > Date: Fri, 23 Jun 2017 10:06:18 +0100 > > From: Harry van Haaren > > Signed-off-by: Harry van Haaren > > --- > > +#define SERVICE_DELAY 1 > > + > > +static int > > +testsuite_setup(void) > > +{ > > + /* assuming lcore 1 is available for service-core testing */ >=20 > We can check the number of available lcores is >=3D 2. The service cores are now added at runtime (to allow checking if add/remove= works as expected), so this is obsolete. > > + score_id =3D 1; >=20 > How about slcore_id? Done. > > +/* unregister all services */ > > +static int > > +dummy_unregister(void) >=20 > How about unregister_all(void) as it is un registering all services. Done. > > + /* expected failure cases */ > > + TEST_ASSERT_EQUAL(-EINVAL, rte_service_enable_on_core(s, 100000), > > + "Enable on invalid core did not fail"); > > + TEST_ASSERT_EQUAL(-EINVAL, rte_service_disable_on_core(s, 100000), > > + "Dispable on invalid core did not fail"); >=20 > s/Dispable/Disable Fixed > IMO, Following functions/functionality coverage is missing. How about add= that > in unit test case. > 1) rte_service_get_name() Done > 2) Verify RTE_SERVICE_CAP_MT_SAFE with available lcores Done, using an atomic in a dummy multi-thread safe service callback to dete= ct that two threads are allowed into the service callback concurrently. > 3) rte_service_probe_capability() Done > 4) rte_service_dump() Done > 5) Moving service lcore to/from rte lcore back and forth. Already covered in service_lcore_add_del(). The rte_service_lcore_add() ass= igns ROLE_SERVICE to the lcore in lcore_config, so EAL will be aware of it = now being a service core. Similarly, _del() will return the lcore to ROLE_R= TE.