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 0868BA04DD; Fri, 23 Oct 2020 16:22:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D50135AAA; Fri, 23 Oct 2020 16:22:10 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D9FB15AA2 for ; Fri, 23 Oct 2020 16:22:07 +0200 (CEST) IronPort-SDR: 8Gof70PdCtYE8Q045vUTa5WHFK340iS2URn/tr1LacMOcyovtuDtBqylgMmXd2G1P/P84aa4Ye 8zL51TRYfRPw== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="154639036" X-IronPort-AV: E=Sophos;i="5.77,408,1596524400"; d="scan'208";a="154639036" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 07:22:07 -0700 IronPort-SDR: TPqZOazN7/cw0SDnby90SogfP9tFm4irDlLGpP5dD7w86iKXX/JXtIdZuzNPsIVU1uf1fjaCaA cZKhxGMlfSLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,408,1596524400"; d="scan'208";a="321754339" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 23 Oct 2020 07:22:06 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) 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:22:06 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) 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:22:06 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.108) 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:22:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izx/W/1/uyMAL/VBRmVCWm7yKB8Eg7uyTU3trQRMi7q3Vn245qEqpikyb5JrL87ADz8iM493R+DuQPabLpNnpIQ1vveXiZo8XYbe2pbFNtjR8oBj9cq+ly1JyLklyIHdS/5KGFE79AuZ5bH77s+mvL8eB5LydGFExKTC8hdsctMkVSOQJKpzfnEptQIoym3GgBZV07qKx4QnxVnpFUW1gBRzA4AOdF+ll1QO5aQH+d9BUX2RzFphFaGeMnfEFCzKVC4MWvCtK3eFqhkvEfJmWp2b3N84kBW9eWn5YzOkkezz+DG6WD0twKYLHDO557g7Bq4fEpMI1SeKBOb+EBwtjg== 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=7EUpeUN3bfBOgdELlJKBzPMM8sKM9/FKv1I/FkJWx34=; b=gJiBpe5uDQ72E4NT7and5hCj5TRjBI7lCxZYB/y+nvHlPib+eznsPoXVx0j1dy65BA/8zD2qG3wT3XZRuoMeTV16u07EPZy1dM+rYsSWfuyNJtlFjHO4Vf3DdKjEreaR5FS5eaTtQBa6Uedy22JgZm4wcvJwYsOesb+WVb9FrUUINUxTsaGrDu4P1ktykSj5fx//+0gD8R5mYG9s/YcIKsXEdPBOR6xI1iUW9H3/BfwXG10uhYzQKa5W7cOe3lqPV2bDTfKSVzuer2ooOhLhNpUdt9ZJky6Cq6vgmry4N9cbqdxzWmmmf/ZggvvAqUOYoxFy+rNodjeY8jKbIoiWlQ== 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=7EUpeUN3bfBOgdELlJKBzPMM8sKM9/FKv1I/FkJWx34=; b=IjqT9U7BpQ4uSrYibKFcMfP1GGamXpvTsdxDTl3wWh0JUrXVX619uFvRydDa8Yu9xwLjzvtHDRVtleCloeJqCtRCvKz14CTG1qjUXwa3OJ+NE/olFSaJF/uNtJVczrudhAOqwhEF+NhxhTmF539oDb4AhK9HfKd2pLt098eyvHA= 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:22:04 +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:22:04 +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 3/5] test/ring: move common function to header file Thread-Index: AQHWqPcw4vz+mCtXHU63oRDNRygidamlPX+w Date: Fri, 23 Oct 2020 14:22:04 +0000 Message-ID: References: <20200224203931.21256-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-1-honnappa.nagarahalli@arm.com> <20201023044343.13462-4-honnappa.nagarahalli@arm.com> In-Reply-To: <20201023044343.13462-4-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: ee19329a-5dfe-475d-4acf-08d8775f0432 x-ms-traffictypediagnostic: BYAPR11MB3190: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Q8ySJC5NChYAgG8OO5TFwaNboJVJ9KTuU1IwRkoAVuNuUPc9juB//X3XtG5dt4kjBAgxjBn9JVMPAutGtWeDHP1Vnt2uhPBqN3LYjlozrVLIr65f4yTIXmby8L0YMrD+KK/nxcAxsbQR78NYWD76AOCKSpeCfB4aT1J2JivodQbysLarTNQRGa4BUjNKp0orCO1hw6t/mQXvf/PgKZh5RakpRFsDbxdEtcHT/sNKm+fiKoLwmlxxEppRUYK1YoeL+7Wv7Ju35usi0qBjMf7YOWK4bJHMST/VaV3WMeiTOl63+ElaLyxNXWtC7alxQ9o/rVXqehHSVGxXEod1CkKPtg== 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)(83380400001)(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: GXnqiXtWFcXawu9D8KCf57fXL3q+D26beTMbW/PHqlW3+a0h8G7YhfHocwo9DoQ9a3JGr/7+O7A9JE/5trAryXBwa73iaecjLY5D82LBucpz9AhqrHFZ0+1CU+sspQOtulB84I4jF0NyNM/2kEq23nQwUd/kIeQ7blRF0TtypsHS61J0+XtB1EFAwXjFlIT+4S3BlOFnDRNkfKZZGHOgw80QvCMxkwrQG3AoLT6r8h+U+NwvAlRxu1L2t2xn6iQYUwcyb0VG4XvQUsY7ABK/Zpf1HiFAq6QPQPtUfrwhb5kIAai2iXy2/g2NhmQ78+1QaRwdL/I0A46fzfZX7S4+SanP+Kxu48GyzCSs1cJS7E8h994BW7Y9O/MXksrBRAybuaITD7GJMKuCoU2u5HRtI2TqAllWvU7yPwF2knVPIlx44a79HhY9wX+87eQPYHfXyMwxIT49OBb8q9oAwGSb/h+e1kQsGc0/s5nSUogdkmpCn0zvjmBW0+pfmHxPOQQQjBuijirriftYSqHYBV/WqF31xhsPWeLeRopJzcAexPQcINkeF3ZeJwqgzK+OKS0A2ylJb8GUvCHSceWeYbVAyuIrpx2lDxBNt72w2xE32o7uUxpJSQRIK733DrZA7PDdZ9uQ7U/gks7r1fAvXjmjOA== 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: ee19329a-5dfe-475d-4acf-08d8775f0432 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2020 14:22:04.7839 (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: IBqbbwDBbQwr29Ti+nslyUEO/7USf5maGQtqtKIQC1ooy2bHLF2XZ6ygYdBr+6jEakM4TkkQ9qjNv+uhTeytZnIdNb+G+Exu/8ZlT9e+o9w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3190 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 3/5] test/ring: move common function to header file 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" > Move test_ring_inc_ptr to header file so that it can be used by > functions in other files. >=20 > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Dharmik Thakkar > --- > app/test/test_ring.c | 11 ----------- > app/test/test_ring.h | 11 +++++++++++ > 2 files changed, 11 insertions(+), 11 deletions(-) >=20 > diff --git a/app/test/test_ring.c b/app/test/test_ring.c > index a62cb263b..329d538a9 100644 > --- a/app/test/test_ring.c > +++ b/app/test/test_ring.c > @@ -243,17 +243,6 @@ test_ring_deq_impl(struct rte_ring *r, void **obj, i= nt esize, unsigned int n, > NULL); > } >=20 > -static void** > -test_ring_inc_ptr(void **obj, int esize, unsigned int n) > -{ > - /* Legacy queue APIs? */ > - if ((esize) =3D=3D -1) > - return ((void **)obj) + n; > - else > - return (void **)(((uint32_t *)obj) + > - (n * esize / sizeof(uint32_t))); > -} > - > static void > test_ring_mem_init(void *obj, unsigned int count, int esize) > { > diff --git a/app/test/test_ring.h b/app/test/test_ring.h > index d4b15af7c..16697ee02 100644 > --- a/app/test/test_ring.h > +++ b/app/test/test_ring.h > @@ -42,6 +42,17 @@ test_ring_create(const char *name, int esize, unsigned= int count, > (socket_id), (flags)); > } >=20 > +static inline void** > +test_ring_inc_ptr(void **obj, int esize, unsigned int n) > +{ > + /* Legacy queue APIs? */ > + if ((esize) =3D=3D -1) > + return ((void **)obj) + n; > + else > + return (void **)(((uint32_t *)obj) + > + (n * esize / sizeof(uint32_t))); > +} In all these pointer arithemetics, why do you need 'void **'? Why just not 'void*', or even uintptr_t? > + > 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