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 21101A04B0; Sat, 24 Oct 2020 00:47:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A1405A4D; Sat, 24 Oct 2020 00:47:26 +0200 (CEST) Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90082.outbound.protection.outlook.com [40.107.9.82]) by dpdk.org (Postfix) with ESMTP id 59C711E2F for ; Sat, 24 Oct 2020 00:47:24 +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=PAV2LEs9rsVfFhyWLM4O8X/SqeXXJ8aIGopK19ZUix0=; b=+QdHnYaw8fIlrV3aaGg+MnJUPYnt6iKIzNy9jmbkC+4rG+Q4ddxfs2fDqpTw2+yAZZpNS3qVSJR7PCeRcCIMq5CPp4i++kLMrmuOrfLM4z3amZiLGbNzVe1085K+pTfXa1+rDMtDiU6uwoNAf5oE5wfeqHtyHbwBsEcVpRcIhBE= Received: from DB6PR0301CA0089.eurprd03.prod.outlook.com (2603:10a6:6:30::36) by PR2PR08MB4842.eurprd08.prod.outlook.com (2603:10a6:101:22::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.28; Fri, 23 Oct 2020 22:47:21 +0000 Received: from DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:30:cafe::e0) by DB6PR0301CA0089.outlook.office365.com (2603:10a6:6:30::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22 via Frontend Transport; Fri, 23 Oct 2020 22:47:20 +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 DB5EUR03FT030.mail.protection.outlook.com (10.152.20.144) 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 22:47:20 +0000 Received: ("Tessian outbound e6c55a0b9ba9:v64"); Fri, 23 Oct 2020 22:47:19 +0000 X-CR-MTA-TID: 64aa7808 Received: from e0d56ac7c673.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DB93FD12-CDAE-4630-B16F-007CE48F15A7.1; Fri, 23 Oct 2020 22:47:14 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e0d56ac7c673.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Oct 2020 22:47:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eDVrWYqJeLW9AGzRKFr6ul3nAaMeKBTiL+DKmVnEFtQRWJUSNPTWeSfmXGSzEnsz6tfOwQDuyhzjNczGpsePifkzJmg7IHmEdSKp27uVNJGtg0UHK3wSuvi9bLfqrcxJciX5ra9f2LJbCoMQHBEZbu4wKyQtP2EWrOpDiUgAN2qQmBrM/vOIY/jXubQmN3YNALpXcIi43Bbicc8Q4t9pPjNL2y46Xs0Z5Gw3Xr+90Y4bu/PvbupLkIFDnsdE2bfd2BGa7jqT1dBqb0eTVxrNVIO17VKQ+fZY8ht+6jHh2ck7DUxv95CiZPDiRoBAXCFQ8DtS6dpropInjS5ibzKfXw== 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=PAV2LEs9rsVfFhyWLM4O8X/SqeXXJ8aIGopK19ZUix0=; b=TjzR7YBBbu7jOB30kxkg/c72hCcEbkpkYqSgzHQZZ6yIlOGmYFnaw1uOlsO39P1Wn/FcmuXZY1YjOmXVEdl/rzr4nlVYMbOuZA8DteAUicIHDw476kZb34r63PwNCWJpKDMXNdRCw37XRDgYf4gJClh5WNGWC1S+qAo4Cjix4dF09ABW+wT3Y/LPaj3K1B/jwxMpsgdWD3kVe2DRIPX4I7og6jmSVoIOQMwbwf2Y2VHg1O4JoD+zPeY4FTmprGyEuWwu98X2YyONazLCE32ceww0prBPZ5+k53419yq6iFqyLDp9oMWOXHwWeCggsn8ODXtahp6VP7oITu8ZVbejZg== 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=PAV2LEs9rsVfFhyWLM4O8X/SqeXXJ8aIGopK19ZUix0=; b=+QdHnYaw8fIlrV3aaGg+MnJUPYnt6iKIzNy9jmbkC+4rG+Q4ddxfs2fDqpTw2+yAZZpNS3qVSJR7PCeRcCIMq5CPp4i++kLMrmuOrfLM4z3amZiLGbNzVe1085K+pTfXa1+rDMtDiU6uwoNAf5oE5wfeqHtyHbwBsEcVpRcIhBE= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB8PR08MB5481.eurprd08.prod.outlook.com (2603:10a6:10:114::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 23 Oct 2020 22:47:12 +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 22:47:12 +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 4/5] test/ring: add functional tests for zero copy APIs Thread-Index: AQHWqUe/UYVQ0Dcas0SvfMFW14vxmKmlw/xg Date: Fri, 23 Oct 2020 22:47:12 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: AA845C83B18A7B4891A02BBF5FA18CD2.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: 45d9c1db-91bd-414f-049a-08d877a599e3 x-ms-traffictypediagnostic: DB8PR08MB5481:|PR2PR08MB4842: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zEQDTcdaQV/038VMpZSvTTuLTdbtldWP3EyCfwIZHn3Ms6jcw+yHfuIU+yw/xPbFsTeHR4WKYzU/bGJO2dUlChqqTgamWdY3cd9S9GTw9FisqO4PkXqmIdD/B8HhRdmfBh3iieOy+Oy0XnX3Xauu7/cgCxt8drQGSntiIuOEM5xA9jTjHI47aLPodtBRHm74q0hRoekJkKB5VV4xjNWbiLIlO8NeMGC3Fha5ciYLyabrTmZb9xtfabyhThjt/TSMO2dQqHof57gc1xgpctIPJg3GVuqz0W0VJuozyHooA6IIBh+smDeonWUhT1QH7Sps 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)(39860400002)(396003)(366004)(376002)(136003)(346002)(4326008)(8676002)(8936002)(52536014)(478600001)(86362001)(186003)(26005)(55016002)(33656002)(2906002)(66556008)(110136005)(5660300002)(6506007)(76116006)(7696005)(66446008)(54906003)(66946007)(71200400001)(316002)(66476007)(9686003)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: sQzNbYD9eGB9hhn8AcNsKzIXhgK5iMrO0WJ/UjP2b9sOhLMbxMe4Z7v0R1yG4Ids/T0nf4TqBjbnJoKOeSys76PZDafftOhuoj9aHjuLShv+BbMlDgwILvffgeYZlF9bML5Dem+IzFlbtnYaBXmzhHRaUKd3XYYj155ZlaxPZ4rt/v6MGhJt7zfAFc/6MzlqFMzQpyaGJrNCyXKuZ+eBwg57mMpVLh1UD3AKvLDJpE3kSi2LgwYw/mywTHpotj9ExE4Whg0VlOH7BxCtIrN2KC15CZj7xIXexfPlKvE+91gIEKRY0BIN86SUFPNWn+3B0mhvve78yySYaAkq7/BFILk3QzehxV89eMZFfpfrdQTssKmAomaj7pK+goigXuO3EbJs5a/t60inflRWZ1Mtf4IdjLhOgVo+pK0gsR5bZ1Amh2jemLw1c8QOSMN55+hkogf2jFAQEqqIyxrtGv0yh/bweK+rL+JbxXVPz0zpM6eabBAJriOd94WyqRask/EIwr/RNhzZh43bL9xdbTEmGqaB+QMRJGzaD3eFXD4z+/NUuenUn0xKAlYNP59V0MBKoSRGbQ7qR1zaveye0xCPKwir4fnnzsU+g+Lo0+gA+/Yr21Y7OEbnTsDbvNrKnq7q6hYcA9u9YkYtuwD2fgSHWQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5481 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: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b3fa6d45-75ce-4aae-8e4a-08d877a594ca X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aRpXuXGVDBc4FOOGU16vxOvwnHwbPaakoV/v5A8/6EyxHBZGXikC5wOKlSqw0OrEpJl9OzKP+UQ0CDu0h1IZKSfVfv7bvIPvSfS62J2nvyzlavleRQHrLR6TwMNvxu390xYRVq8DVlFCkmCyexC88sWxxoUYklzgx2pPKF0BqPNrYe3anXIYIA4zD09aW84Ldxmos4TQLfcKVc1FimeYwbsJOrUyW6jpcsXlB8zsf8tVFr83BOuZRAF269y6dfRuY4VQa0PNbhUIbF5XtSw+9jGA55kOqTBbCjuOSy6ISfcGuPMgXhKyxlRorzIIA3mdxtm4+cpZJySpugtZC8c4q6dCYbMcdQL5kpkZalXDZqgiqX9d2p1SX8YQfbSQRoc9gtt3Vg1cMbBK7yfqg0fG3g== 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)(376002)(39860400002)(346002)(136003)(396003)(46966005)(70206006)(70586007)(110136005)(55016002)(54906003)(82740400003)(2906002)(86362001)(356005)(52536014)(6506007)(316002)(9686003)(4326008)(8936002)(186003)(33656002)(478600001)(336012)(47076004)(5660300002)(82310400003)(81166007)(7696005)(8676002)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2020 22:47:20.7966 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45d9c1db-91bd-414f-049a-08d877a599e3 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: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4842 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" > > > > 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. > > > > 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(+) >=20 > .... >=20 > > 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 in= t > n) > > (n * esize / sizeof(uint32_t))); } > > > > +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 > esize, > > + 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))); >=20 > Why just not: > src =3D test_ring_inc_ptr(src, esize, zcd->n1); ? test_enqdeq_impl requires the enqueue APIs to have 'const' pointer for data= to be copied to the ring. Because of this, the 'src' parameter needs to be= a 'const'. If I change test_ring_inc_ptr to take const parameter, a lot of things in t= est_ring.c break as test_ring_inc_ptr is called with lot of non-const point= ers. >=20 > Acked-by: Konstantin Ananyev >=20 > > + 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 int n, > > unsigned int api_type) > > -- > > 2.17.1