From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4EDACA04DD; Fri, 23 Oct 2020 16:20:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E2F3CA979; Fri, 23 Oct 2020 16:20:35 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id BA8475A13 for ; Fri, 23 Oct 2020 16:20:33 +0200 (CEST) IronPort-SDR: D+kXUMi0IqQ0cge6gmnr3SVG2FnGn1ZSz7JUTVdlTFfsRB68XS6aC5ZVhMDeOi090aLigbU0De rQJjsSd1VNnA== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="147539125" X-IronPort-AV: E=Sophos;i="5.77,408,1596524400"; d="scan'208";a="147539125" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 07:20:29 -0700 IronPort-SDR: 6TCaXf5q1JIPMkLsoF+illPwq3Qww4fea2VxOa6GnkEfjBDw/17dshmeGQ01FWFhMTj0fVJmsd UjyIknIiKiAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,408,1596524400"; d="scan'208";a="321753875" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 23 Oct 2020 07:20:28 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 23 Oct 2020 07:20:28 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 23 Oct 2020 07:20:28 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 23 Oct 2020 07:20:28 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 23 Oct 2020 07:20:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i+qreafsVKEJ2Wa8XQb/GREcHx6tNEPHxCcj0ZaRMgwjEKpfRTwl5djaaWVPEcy+vpUdPsG6CeTMp4Kyu82hssPUfNM+7hnQ1eolMRI+TvnMiZSgbv2r616honjSJOEjxMFQUs3OvJBhc5ouGeRgr9WebhTBLKwUwVtjsS0Sx1eG0iDWwI94hIq+s5gtYb7NFQ6vFV8Rpm7F+RcCNP5EGQp+CbWjGq0JNe7w5bBcm7Tr3ydeg8r/iP/YbHiP/g7OBGdyQVnprMDnH4OhECq7irjJiut9zGToCpPRLCA9tEgb9BHKt6PJEkVYGouoFtiPj4/JR+TTGQKj/4+BULut6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xt9MhOQw7btbLiRoyG7NJsvG2FV/TKly/L+eSaVLl90=; b=Ald4GVocQGA2OUHT9g+/WFf7mVCy9UJyPMc3GO5A50xpPDpfPX4MxqolwpWXdkJEaM0+E4b6Mo2Bh+AILCz/dsmSoIwxIpQUaacpeW5RlmP7S9hiOlZidJ948V2ePCH1LXAV8X1mNmwg+4AmUuHd/IWIpp/trE/tVJp8DNkWuUlWPvxmv4dm64Gr4xZrk+9o3FpH/ycgy23Kh+kIvhEtcZbtPlcBUiGIIB7vOYR3Gmx9/Tv8EPpYaFPpmUb5m0FemlmUy7+QaublOgjEsyWIJgJu4CWgKzBMoRNBnROb7tNNJp9n04mDRFEG00MaHplYrS8Hz0phdabWp9bW6slC5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xt9MhOQw7btbLiRoyG7NJsvG2FV/TKly/L+eSaVLl90=; b=Nc04eG6xDaC1wZW2TGN9scP/TBOe0k+0czLgiiOKOOo7lFaRNLtKXUX5IsA10kd1eBgu9TmjzCypRGQmV/NMmhH09tNvism7Y5sIeAJ+N4NhIfey+s9IfDM7utOnXN2wnKz9Mr1cY1+xSrJkRbXreSTFtWf9hdwi/UMrXW9hsIA= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3190.namprd11.prod.outlook.com (2603:10b6:a03:7b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Fri, 23 Oct 2020 14:20:25 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f5a4:3f6b:ade3:296b%3]) with mapi id 15.20.3499.018; Fri, 23 Oct 2020 14:20:25 +0000 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "olivier.matz@6wind.com" , "david.marchand@redhat.com" , "dharmik.thakkar@arm.com" , "ruifeng.wang@arm.com" , "nd@arm.com" Thread-Topic: [PATCH v3 4/5] test/ring: add functional tests for zero copy APIs Thread-Index: AQHWqPc06Z2RCG5iDUmbA0S7v1BUuqmlPExA Date: Fri, 23 Oct 2020 14:20:25 +0000 Message-ID: References: <20200224203931.21256-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-5-honnappa.nagarahalli@arm.com> In-Reply-To: <20201023044343.13462-5-honnappa.nagarahalli@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f1f2d2ac-ba64-47cf-5d34-08d8775ec8ff x-ms-traffictypediagnostic: BYAPR11MB3190: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TMQRZh70M8y30SJFITqbkdZLbJ98JREF3u+esbfoyCC0bPXUR5LxQX38oSMQPzU7a0reqmYjj2L6VZZLRpR/YEFYe3nGs+LOZ1zt4Qr6RwZPhCY8veOPc0wGitQiELB7jXjyp9WVhrmzeAlRMyf+TNw/CLA6qZr7GPAFQMYfGt1RDL7hnj4IeoJMd2lMRjyB8iwvlKiHskkbDuyuX1UhOfFbf6knifV9VPT8hlDlW1SNrEQNfvWj8OzCB7oB5l5roGtNzlQfds3rSTJCW0Gqe/P6F3vGH5SWQZ88g+OpYD6CMpy9Ltw+kxhzej72dPNx x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(376002)(346002)(396003)(366004)(110136005)(8936002)(2906002)(7696005)(86362001)(52536014)(55016002)(4326008)(5660300002)(8676002)(66946007)(478600001)(66446008)(64756008)(186003)(33656002)(66556008)(26005)(6506007)(54906003)(71200400001)(76116006)(316002)(9686003)(66476007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: di9Iez2rSWzrTVdded7rUTYDIO8GqnqGHPp3mClaKnekFMFr/WmVHIk4rrVTJ59qmK1bBe/I6Ic5skCHz4iJTENrhBEGxopPSVK6ar41thVVDw0cUUcGMSGYdsxpTO6P4H2byCl6Q+o+4dq0jwu4XRmF2mHQC8gb9ih+NCFMM09DCaVeg1XsytJh7K6ddIKiC7bcy8uudq0eGjOI1cwtqhYk8/Wzx9dypUou33ej0/i8O0MHQnbYTlR77zPfldA7FRtGyuKilHvMQ2XzrK2lRyPXvIs9DsV/DvimuIVfG+TE77+Dq78npfUR/Jet+VgqD3i7gEXrkYDI8Yyujfwb137mKTv3ctZc/aPXvdm81xa8W1FYzDzxyBNQvAkQkcjiUfixlOt1I2XZLfb84ZJ8VEhhrv84yja0QsiHi1c1+9/cNqZm7yqn0jEKu2f3yE6uCGDz9GB5IGoL+NqzqqWevg91UqYFCmAS7nxOBPTOUuprGn/BplGRGasNjUrg4KllFtQ311JEpZKLkoSFB4BCuUHl5aWQQl1H81EuMOAvWkRtGiHJf2PYNTojgJhPC9EEoxxi7SgKNJiJ5UTrMZGLe/KrizqclGznPq7VVS8ZtT1LgJbfRikQyFEIawjAdmWW1ekNa1rs2bc21Bryc6x5oA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1f2d2ac-ba64-47cf-5d34-08d8775ec8ff X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2020 14:20:25.4645 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FP9ySKwEuzO/uWl31tFbUfm0FS7gNcLOQsOqlRi/kvIxI2bsP8LgG++8lgjumlvmcXnDvFlAgpBdXf6ujy6xOxaZj/5JJmDyqFjQxfauIxU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3190 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 4/5] test/ring: add functional tests for zero copy APIs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >=20 > Add functional tests for zero copy APIs. Test enqueue/dequeue > functions are created using the zero copy APIs to fit into > the existing testing method. >=20 > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Dharmik Thakkar > --- > app/test/test_ring.c | 196 +++++++++++++++++++++++++++++++++++++++++++ > app/test/test_ring.h | 42 ++++++++++ > 2 files changed, 238 insertions(+) .... > diff --git a/app/test/test_ring.h b/app/test/test_ring.h > index 16697ee02..33c8a31fe 100644 > --- a/app/test/test_ring.h > +++ b/app/test/test_ring.h > @@ -53,6 +53,48 @@ test_ring_inc_ptr(void **obj, int esize, unsigned int = n) > (n * esize / sizeof(uint32_t))); > } >=20 > +static inline void > +test_ring_mem_copy(void *dst, void * const *src, int esize, unsigned int= num) > +{ > + size_t temp_sz; > + > + temp_sz =3D num * sizeof(void *); > + if (esize !=3D -1) > + temp_sz =3D esize * num; > + > + memcpy(dst, src, temp_sz); > +} > + > +/* Copy to the ring memory */ > +static inline void > +test_ring_copy_to(struct rte_ring_zc_data *zcd, void * const *src, int e= size, > + unsigned int num) > +{ > + test_ring_mem_copy(zcd->ptr1, src, esize, zcd->n1); > + if (zcd->n1 !=3D num) { > + if (esize =3D=3D -1) > + src =3D src + zcd->n1; > + else > + src =3D (void * const *)(((const uint32_t *)src) + > + (zcd->n1 * esize / sizeof(uint32_t))); Why just not: src =3D test_ring_inc_ptr(src, esize, zcd->n1); ? Acked-by: Konstantin Ananyev > + test_ring_mem_copy(zcd->ptr2, src, > + esize, num - zcd->n1); > + } > +} > + > +/* Copy from the ring memory */ > +static inline void > +test_ring_copy_from(struct rte_ring_zc_data *zcd, void *dst, int esize, > + unsigned int num) > +{ > + test_ring_mem_copy(dst, zcd->ptr1, esize, zcd->n1); > + > + if (zcd->n1 !=3D num) { > + dst =3D test_ring_inc_ptr(dst, esize, zcd->n1); > + test_ring_mem_copy(dst, zcd->ptr2, esize, num - zcd->n1); > + } > +} > + > static __rte_always_inline unsigned int > test_ring_enqueue(struct rte_ring *r, void **obj, int esize, unsigned in= t n, > unsigned int api_type) > -- > 2.17.1