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 72B11A04B0; Sat, 24 Oct 2020 01:54:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A89006A72; Sat, 24 Oct 2020 01:54:43 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80059.outbound.protection.outlook.com [40.107.8.59]) by dpdk.org (Postfix) with ESMTP id 15D0268F0 for ; Sat, 24 Oct 2020 01:54:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pHoXA8V5LakoxvXRHKq8KrTc68hhWmbylUXl/PaGmi8=; b=AjyuD1/h+G7H43GvMV8VWr9p0S4QdzPcCz2ZgeNOlLHi+xXYvVpARHVEQ1sECZSmtYX8U8pb5eg4fy2aCw7MSsEZ6AQoVlkk26eoFsUVE3tmaUmmHA6cKlcFUabYL0zaKM67kUBVRds4nB5n3JMUZa+vV8b9I0kJlazU3OuEY1I= Received: from AM6PR05CA0024.eurprd05.prod.outlook.com (2603:10a6:20b:2e::37) by VI1PR0802MB2301.eurprd08.prod.outlook.com (2603:10a6:800:a0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.25; Fri, 23 Oct 2020 23:54:39 +0000 Received: from AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::97) by AM6PR05CA0024.outlook.office365.com (2603:10a6:20b:2e::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Fri, 23 Oct 2020 23:54:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT006.mail.protection.outlook.com (10.152.16.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Fri, 23 Oct 2020 23:54:39 +0000 Received: ("Tessian outbound a64c3afb6fc9:v64"); Fri, 23 Oct 2020 23:54:37 +0000 X-CR-MTA-TID: 64aa7808 Received: from 8af651a16176.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 437594B9-FA50-47C5-9236-C8C14DF447C4.1; Fri, 23 Oct 2020 23:54:32 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8af651a16176.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Oct 2020 23:54:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ivSubxPh1PpBCeUJx42pHotTYR5togVKPZ4fk1hUtI4o1YjfTIn9ZqSwZEEN338RRE8wQvd9gcDEW7HGaCUbznAWfHVOShwkQcGls4SXBKnsjHbhrU1FRsNivQeM2GLYzsW3jwpXD1+ZOgqch0eYiEntdptcyYQDSK2Y2Nmli4a6Q6fycKmhsfESbw37KQnE5gvrFXz1deCUEGOCC3fqz/4+3Yg+NiwJ0p6cZWIWRfDSODY/WmY3T5B9uSoT1Gb+mBxySL2/tn5UvVVoLkfeb0wpMPrxWgbNPSCWd44VR1TC1Hj4XlsN8h9+fsVbq7p+ZQOKM27zmV1DTmoQTWHAvg== 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=pHoXA8V5LakoxvXRHKq8KrTc68hhWmbylUXl/PaGmi8=; b=i06ORc0fPFSEqn/BhVvAsIJ3OI7Dv0+EwfXF6stYNbSjAcErvwusB2BD3WNWAih0lCxlZ6LGZDjra5IRo04HJma2GLZsZTLPOH6bakvZxKtaTydgmwIeqtPn+OlFm3b1aaAUKHut4NmjaVcRx2IX1i8GOnoGdcwb9ikCztBk4ec9/TgH+cYFHyzSRqAAEz5le/LsLSrCMdRC6+By8d3n6ud9z3hAvFOWjGRf+8qWORnPIZz4bXWT3yTGICCiVMDpVDAg1uIX13iGoFgaqwZy74iStlJLXs9XuFJ5TjyquTXZm8RNgvE5MyDEx4fZnu/wIPt0586LmL7Urbq5cxiK2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pHoXA8V5LakoxvXRHKq8KrTc68hhWmbylUXl/PaGmi8=; b=AjyuD1/h+G7H43GvMV8VWr9p0S4QdzPcCz2ZgeNOlLHi+xXYvVpARHVEQ1sECZSmtYX8U8pb5eg4fy2aCw7MSsEZ6AQoVlkk26eoFsUVE3tmaUmmHA6cKlcFUabYL0zaKM67kUBVRds4nB5n3JMUZa+vV8b9I0kJlazU3OuEY1I= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DBBPR08MB4283.eurprd08.prod.outlook.com (2603:10a6:10:c3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Fri, 23 Oct 2020 23:54:29 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d%4]) with mapi id 15.20.3499.018; Fri, 23 Oct 2020 23:54:22 +0000 From: Honnappa Nagarahalli To: "Ananyev, Konstantin" , "dev@dpdk.org" CC: "olivier.matz@6wind.com" , "david.marchand@redhat.com" , Dharmik Thakkar , Ruifeng Wang , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v3 3/5] test/ring: move common function to header file Thread-Index: AQHWqUfxvfoMUsTy8UiHxGyvyyDqYKml3FYQ Date: Fri, 23 Oct 2020 23:54:22 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 48AA0E32B37028489ACBCB054D4048DD.0 x-checkrecipientchecked: true Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.113.13.105] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 74a5c394-c638-4c2b-47c1-08d877af0126 x-ms-traffictypediagnostic: DBBPR08MB4283:|VI1PR0802MB2301: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:4125;OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: EbPDg9MZbwpCUIoRYxZZNU6es1DS2wYU0e1PREVKuDE8qsUqaknDaOqpueq4T4dvXHiN0O/AaNJLhAzRI8dk1B4g07/7MIVCIsyJMr/1ZyqsKmgs1+6dOvdYDh+TJYrtdSvN7a4InnXK4VHWujFkl5hoYf+6+rTsiVfLPoJyh0Csu2aR3BQQiQE/pl5EeQbYJmC+MUaINZJnr3q3R7as6fAHW1AKUKLRDomaljnu5u5RIcLZ3tNUoho6xxU7PrY0uEpBG7mFHGy/AE206PsgF9ZxHfLsn8DIOEVPFt7gskJ8b0FM8gkzjmDrMl/76qYR2EBNWnUYfr1UaRP/L2GGTg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(136003)(346002)(39860400002)(396003)(71200400001)(316002)(54906003)(9686003)(26005)(4326008)(66446008)(83380400001)(110136005)(66476007)(76116006)(66556008)(66946007)(64756008)(6506007)(8936002)(186003)(33656002)(2906002)(8676002)(478600001)(52536014)(7696005)(55016002)(86362001)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: w1H6KBA8b6aMlOLiwbu00owHtpHDw7D1J8P5vIBl+m8lxLQVNmFDqckT/8gTDNUNQl+KX7ZbiGerhmhlId/m5UTasq2oZk+7vnAxfhLKueVJvitLQgGHWvPE3+Vs4IBECzRIb6F6N6UUjl1wcUYhe87MBIEDo2dNGyYIVbAoAyiSQMh8hJbKJyMP2txNZSf4rcNiEP7elUj+1kGkql7I1u7kYHRaDmxeV3dhrjtj7jj7yR8CdypqP6hj5u7/qmZrpjr0+Zg5zNjTR1796uUo2+BXGneEW21d9pxE9SI4/h9vNQASBeEb9AlDfX24RZARJ73h6zeg7PjfFzn+P/dHw07ufSVYTfWAe2V9gDKBpWu+x/V/eIVhj8cQaTi39+zrDSkY8z3U8hq4hTa5em8Ac1L6/MjMIC3uahLMMWkdpNzqyZAjsEX9/tV0kN8ijSrRG7ObKl/wltM0JstrM5O1dYIgEOIG0dhOXONDv8Hnh/+EIHLhr9v5K7/aoo1cOcZmgDN2hOPhslzf3TYMs3RYKZZnK7APMUykUQvpdZ6pOYcEUCbrCQtIjIP/cIMeq2ZgbaxGHX2CogfN6civn8QIzN6/5pe3lBSR0adhSB6ezUuOnvseXX5MKPweC0vtKrHfscQno7ZY1ggnVrYafzow3w== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4283 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: fa62a6af-623e-4b63-5910-08d877aef732 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KyN38fGwtB+F2egNFzDriH8Q7X7xgCMX0wLYfhuWzSCEKZennLfwt+LOr/728DNZQhsWNM6ePqnFhLBaxzP6JHRdtDaBp73BfMYi6laQmC3ANPkx2vYpKBPDgpPzMNT43bnyvGzlwJ2IwDkQpehP0WnGC9GESbSPZOazpqtyDuO+wZaBXR5GkLT5In+Qhw5IZrYKVMFqXOkhODbkvh1UD7wp3SCAxfNC3TBt9mfakMOpHSsQABDDPesEZg0PUioxoEers3idLpQvq8GQaPVjr52aS+ePQ6tEn6gQdu1uFUobZKhY9GuJkAo85xZ8D2b7yX8iP49TGdXLV1cGQ7IptfCP/9KMEcEDSGg/tIjQEaUOtQ16azxxswCpo8Z0+eRnAkIqdSI2NM7g04fit9jVrA== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39860400002)(396003)(346002)(376002)(136003)(46966005)(33656002)(82740400003)(186003)(356005)(36906005)(5660300002)(26005)(6506007)(81166007)(54906003)(47076004)(2906002)(110136005)(9686003)(83380400001)(7696005)(52536014)(316002)(336012)(8936002)(82310400003)(86362001)(8676002)(70206006)(478600001)(55016002)(70586007)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2020 23:54:39.4593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74a5c394-c638-4c2b-47c1-08d877af0126 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2301 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" >=20 > > Move test_ring_inc_ptr to header file so that it can be used by > > functions in other files. > > > > 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(-) > > > > 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, > int esize, unsigned int n, > > NULL); > > } > > > > -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)); > > } > > > > +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))); } >=20 > In all these pointer arithemetics, why do you need 'void **'? > Why just not 'void*', or even uintptr_t? I will change it as follows: static inline void* test_ring_inc_ptr(void *obj, int esize, unsigned int n) { int sz; sz =3D esize; /* Legacy queue APIs? */ if ((esize) =3D=3D -1) sz =3D sizeof(void *); return (void *)((uint32_t *)obj + (n * sz / sizeof(uint32_t))); } >=20 >=20 > > + > > static __rte_always_inline unsigned int test_ring_enqueue(struct > > rte_ring *r, void **obj, int esize, unsigned int n, > > unsigned int api_type) > > -- > > 2.17.1