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 711ACA04B1 for ; Wed, 26 Aug 2020 22:52:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4EED71BE3D; Wed, 26 Aug 2020 22:52:15 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20057.outbound.protection.outlook.com [40.107.2.57]) by dpdk.org (Postfix) with ESMTP id D43E91F1C; Wed, 26 Aug 2020 22:52:11 +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=lGb8eR6/VasaqNICCpk/J5Dbt77wTWgksMVDNLz+64o=; b=S1Nl9VMwTNTwGwG4e39hHdtFDzwv8jWp49UWXP7EXcbH4BwqHO1C+jNuBlg3W61gNuygfUkFonRynn0cEebtkQ8meFUQpDFvpa7GW5lT40fsLBAqjsCuQHEdzaA72DcaPpcEBHq1opty+15lKtFzHLrZvLcZJ8FdE/yNFihFhME= Received: from AM6P194CA0062.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::39) by VI1PR08MB4541.eurprd08.prod.outlook.com (2603:10a6:803:f9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Wed, 26 Aug 2020 20:51:50 +0000 Received: from AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::f9) by AM6P194CA0062.outlook.office365.com (2603:10a6:209:84::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Wed, 26 Aug 2020 20:51:50 +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=bestguesspass 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 AM5EUR03FT019.mail.protection.outlook.com (10.152.16.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Wed, 26 Aug 2020 20:51:50 +0000 Received: ("Tessian outbound 34b830c8a0ef:v64"); Wed, 26 Aug 2020 20:51:49 +0000 X-CR-MTA-TID: 64aa7808 Received: from c1beb22c5ff0.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AFF96C0B-41F5-4206-BAAC-35E4393B8B86.1; Wed, 26 Aug 2020 20:51:44 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c1beb22c5ff0.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 26 Aug 2020 20:51:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBFt7DgzxzMajo1ih344dTbt4M3AY7aEnnXvMEbKOhZpl/XSimDea3h8F8PHRRplvkGjlK1eCjNJCqNSVYE1YyjzYFaOlmiGd7MM4Cf+XVsQSn4hWo2Dk3gq9o2/mUKd04gTx/v5s/jq4NZpoLY8itoCA/Ve0jh2gj5HSqnkmVaCTtalv1Py4uPywA45Im15mhozj9aTuDeeVm6oZnFHdna+3Uq7+FGwiVH72Vt1kg+Nh4Y8bnSZZsIa1wKRirQSoV3AGLTVWH2Eg+ZghPlnVakocOCFaJjB3mRAJe4+NdLhr7GnKO8oYjylUUSt6j25t21YVPgKkj7oVXo2pa0toA== 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=lGb8eR6/VasaqNICCpk/J5Dbt77wTWgksMVDNLz+64o=; b=TOVMobykkis8WLZBcFhG7V9FrMhRtctjovFddXkMSbqkH3Pcnbs8gZwSHAbomEUbvQS3CVUwJkxbgNMOITSTro0AzwD2j76pyIbcjVzfrq1IBuMbPTIOVKOI0W5/Z78g4JAhi65aTG0RC/W+l2jqX+PobeU0NNZc0MudVg0RDaNXsOPhSgyQp8SDifxVp2kusZnQvT92mhzXyfjBMX9EMUq4G81sa7W7m+bqVcC5vQuEWOXA0HlOxXyYZx4RSTDIPJ7dWsbNBRWs86E+zxIKOY71kLOabPVpG6WYBExf8IwlLXxHuZvvmtVajLy24ZEkzZiu1HrCZ79tI8Y4n1CPSQ== 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=lGb8eR6/VasaqNICCpk/J5Dbt77wTWgksMVDNLz+64o=; b=S1Nl9VMwTNTwGwG4e39hHdtFDzwv8jWp49UWXP7EXcbH4BwqHO1C+jNuBlg3W61gNuygfUkFonRynn0cEebtkQ8meFUQpDFvpa7GW5lT40fsLBAqjsCuQHEdzaA72DcaPpcEBHq1opty+15lKtFzHLrZvLcZJ8FdE/yNFihFhME= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB7PR08MB3084.eurprd08.prod.outlook.com (2603:10a6:5:22::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.26; Wed, 26 Aug 2020 20:51:42 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::408a:40fb:7402:c805]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::408a:40fb:7402:c805%6]) with mapi id 15.20.3305.026; Wed, 26 Aug 2020 20:51:42 +0000 From: Honnappa Nagarahalli To: Feifei Wang , Konstantin Ananyev , Gavin Hu , Olivier Matz CC: "dev@dpdk.org" , nd , Feifei Wang , "stable@dpdk.org" , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v2 2/4] test/ring: fix wrong size used in memcmp Thread-Index: AQHWau/Nxllq9YMY+0m0BQqOzhUFmqlKq/eg Date: Wed, 26 Aug 2020 20:51:41 +0000 Message-ID: References: <20200729063105.11299-1-feifei.wang2@arm.com> <20200805061421.13037-1-feifei.wang2@arm.com> <20200805061421.13037-3-feifei.wang2@arm.com> In-Reply-To: <20200805061421.13037-3-feifei.wang2@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: AFB02C774F56774092DDB535A000844C.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.112.90.121] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2c978545-a5f7-4e3d-f974-08d84a01daf1 x-ms-traffictypediagnostic: DB7PR08MB3084:|VI1PR08MB4541: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:3383;OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: z03uSo3u0T3aY/L37NjJJweePpuASwLXQ2s5wFzTqSfHgTWFOcmrnrKvh78gBKEevx8o/vYUoV1rzx4TCGlWtFAck//cTVRNIo8/vnIFP5l7TVRa2yZc2BnGaC71yayWgkO+TzT243sruXYs5b0ntkneqzuV+U4V67tk04+OKCv8fsEAKjsrS5/om/PoVpIaTt5ss0DQPXcXEA4fygmyAz3CBNA90kv7I4M69hIRtG4YzMLLJq8vqJyWU5fazYViNCkZoMMErUizP+2wFA3HZSgHJ3578DM5d1lcU+qP6E/GBVFlm4RlVAoXshuauIZsquHerXV/WIf2hmgjZfUCPQ== 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)(376002)(346002)(366004)(396003)(136003)(9686003)(6506007)(4326008)(186003)(83380400001)(2906002)(7696005)(55016002)(86362001)(71200400001)(26005)(66476007)(66946007)(5660300002)(76116006)(33656002)(8676002)(8936002)(66446008)(64756008)(66556008)(478600001)(54906003)(52536014)(316002)(110136005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: Tpbwg/wG8yHAQ+vEtYbYMtZKEVYalRTofWAuIh9PIUZ5/p9CM2a3RGXSv0RMm4eh1G9GIWYG7Fx81l9HvdRQZ7n4l/TXNxPgE/1mVxE/EDS/ANeBvKF0Dbj5mB3ZbTuYU9BxpGqBFmOPSElSGuKp38BDCfrmU1MH+AoVi6y0Je9/6fBL00ykIhnlbF7HhJyTzyqT8APgYspUR4tbBPbn7PJVSJsihoS673NAJXC0vKWUVOAjl6pHcgw8EbCcZPpXn8uFMXSiVpxlFjUzyMoU1+pu+/vDD+FFHNphFT/PWHYlRykqJw+nbsy/0FnDhoKWtiO8iTrQz5SYH42teASUy0qYoXV8VTwU57Q/q1nFhPYSK9HKhTLuMb3ScniqE6zIwIfA+y6RItTUfhUKe6ktwgtshXh903Vts3BeIrXdm4XAbIO3G9wzdB/7bL9Kv+KF/NUAX1HAjdPyfMH40RsXQAKQ/oSFfu+GVFbWBgUMIJk5wtU9dMpoZxsCki1I0ABLYonzPWZ1dIUJ2ioRN81Yhh8cJi1TyMktexGDPL7txDrk/y132DQVF/JboIKISayCggotIWuFrdCXp6tTJSkAIrqNkY3ZEjnUKCTvk9nXUTPRo7UZDXCJ0bjsALgSffHFhD68IOsiZTQJIO30y7dbzw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3084 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f81663a1-a6ea-46c0-0cb6-08d84a01d639 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TvRTqvcWaOWGTFwA/nTdnItVaxsk+5VDc7xGsFZ4OSavMcE0YzJpQ8Vwp1so7aAHc1Llthym9icmodfxDzzId3+s+v/h1bC0ml0CX+Ebe3+ujCdrkHcWRtT23+D3yjCQ8g1VcK0E3GzxbevDJh0hzTlxVahVCTvU0FQVesfB4/jJIi5qRDeafNQxOpbf0BZB9hGygU/OzGNh1qOrtIHVmBbVYSl4g8l7DIfCl9E+/fwJeG0soYCIDxwxN5hbZWUsfxOStMbB6FIQzrjUh0MM549DpmR/6WfNP/aO33fzl+GjEBoT/tcDQO5TdltwoJdwoZOuQQ3drIJAev7GisDcAxN/9GFSEsdalM104FFM7A5lJFGJnGEpR43/8nyB66kPHC4mgmz3bn9nlL+TZlT/Jw== 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)(396003)(136003)(346002)(376002)(39860400002)(46966005)(83380400001)(4326008)(356005)(82740400003)(70206006)(81166007)(70586007)(7696005)(47076004)(36906005)(186003)(336012)(316002)(86362001)(6506007)(110136005)(82310400002)(26005)(54906003)(2906002)(450100002)(8936002)(8676002)(52536014)(33656002)(478600001)(55016002)(9686003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2020 20:51:50.0779 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c978545-a5f7-4e3d-f974-08d84a01daf1 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: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4541 Subject: Re: [dpdk-stable] [PATCH v2 2/4] test/ring: fix wrong size used in memcmp X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" >=20 > When using memcmp function to check data, the third param should be the > size of all elements, rather than the number of the elements. >=20 > Fixes: a9fe152363e2 ("test/ring: add custom element size functional tests= ") > Cc: honnappa.nagarahalli@arm.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Feifei Wang > Reviewed-by: Ruifeng Wang > --- > app/test/test_ring.c | 31 +++++++++++++++++++++---------- > 1 file changed, 21 insertions(+), 10 deletions(-) >=20 > diff --git a/app/test/test_ring.c b/app/test/test_ring.c index > 0ae97d341..c508a13a9 100644 > --- a/app/test/test_ring.c > +++ b/app/test/test_ring.c > @@ -444,7 +444,12 @@ test_ring_burst_bulk_tests1(unsigned int test_idx) > TEST_RING_VERIFY(rte_ring_empty(r)); >=20 > /* check data */ > - TEST_RING_VERIFY(memcmp(src, dst, rsz) =3D=3D 0); > + if (esize[i] =3D=3D -1) { > + TEST_RING_VERIFY(memcmp(src, dst, > + rsz * sizeof(void *)) =3D=3D 0); > + } else > + TEST_RING_VERIFY(memcmp(src, dst, > + rsz * esize[i]) =3D=3D 0); Can you implement a function similar to 'test_ring_mem_init' to do this com= parison? > } >=20 > /* Free memory before test completed */ @@ -538,9 +543,11 > @@ test_ring_burst_bulk_tests2(unsigned int test_idx) > cur_dst =3D test_ring_inc_ptr(cur_dst, esize[i], MAX_BULK); >=20 > /* check data */ > - if (memcmp(src, dst, cur_dst - dst)) { > - rte_hexdump(stdout, "src", src, cur_src - src); > - rte_hexdump(stdout, "dst", dst, cur_dst - dst); > + if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) { > + rte_hexdump(stdout, "src", src, > + RTE_PTR_DIFF(cur_src, src)); > + rte_hexdump(stdout, "dst", dst, > + RTE_PTR_DIFF(cur_dst, dst)); I do not think, this change and the rest below are bug fixes. Can you pleas= e separate them into another commit? > printf("data after dequeue is not the same\n"); > goto fail; > } > @@ -614,9 +621,11 @@ test_ring_burst_bulk_tests3(unsigned int test_idx) > } >=20 > /* check data */ > - if (memcmp(src, dst, cur_dst - dst)) { > - rte_hexdump(stdout, "src", src, cur_src - src); > - rte_hexdump(stdout, "dst", dst, cur_dst - dst); > + if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) { > + rte_hexdump(stdout, "src", src, > + RTE_PTR_DIFF(cur_src, src)); > + rte_hexdump(stdout, "dst", dst, > + RTE_PTR_DIFF(cur_dst, dst)); > printf("data after dequeue is not the same\n"); > goto fail; > } > @@ -747,9 +756,11 @@ test_ring_burst_bulk_tests4(unsigned int test_idx) > goto fail; >=20 > /* check data */ > - if (memcmp(src, dst, cur_dst - dst)) { > - rte_hexdump(stdout, "src", src, cur_src - src); > - rte_hexdump(stdout, "dst", dst, cur_dst - dst); > + if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) { > + rte_hexdump(stdout, "src", src, > + RTE_PTR_DIFF(cur_src, src)); > + rte_hexdump(stdout, "dst", dst, > + RTE_PTR_DIFF(cur_dst, dst)); > printf("data after dequeue is not the same\n"); > goto fail; > } > -- > 2.17.1