From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 33DC34242F; Fri, 20 Jan 2023 13:43:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17EA240150; Fri, 20 Jan 2023 13:43:32 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 42B3C400D5 for ; Fri, 20 Jan 2023 13:43:30 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30K7NkJX016365; Fri, 20 Jan 2023 04:43:29 -0800 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3n71ceye47-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 04:43:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aFSI1evYhhu56aLuzPMtu7drmfhRWrgdJVoQ9OVLJQZ9ISO+GvwufNoQV+HnqIHaNs/f+ITP+2Lh7jxfy6inFnbeWBuVc1aGNGkvwtnbC7MhG9j9NP2mUX0rmxG8oIG4+rn5HPOzJnUjEe+d1RQE4Hfc5W4M3D2m8RVbMrf81Lxqe+QVhh6iOayCKrC7ULeqnLTdQzXtqvuBYAi1dPtJC1qauTT/JqgJdzETJVudacS/j4N/8txdNRuJoO9sN2S/apEm7Rix4FeqRpM/SIUVC6k0JaRBvcZU888KjctXRlloDrII8b5B5MQwXcRji9VMf2X6FqzgNKekoB70+VH/LQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z7xCGypyVQp860KnR3+Akf33uD3bvRhi3WFSe6fydWs=; b=IbcYY386lmD0iifgK4xIq59J57a2LXHAUkyn/OvpKjK+BySU1//LMFFjvZSMMgnmGA2O8JPkkS4lvKdT8F2mRnPUJvbCZF1xZhfuUl/3WIKWQJdlsSj91DuFdKQ3REcdgPkxHBa2uIWWpBR1rlln9PviG4c577lTQGXKpSdozZ8tyU/SjQNrvwW/SLDgWoNor23j43h6n7ftIF0Th6UwprdreHFaFx2RdJv3P/PI9eYw5CKUcjKSdxHCsdWU4qjLqhu5JvoBdSH7CVQoFkaik6G87Kz8XpM4UlpuOGRojv+b/6GMakY+Vup4w3IRAhZFxW13XAX7VkmIOjXT1Px1Dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z7xCGypyVQp860KnR3+Akf33uD3bvRhi3WFSe6fydWs=; b=qU9pQFFH2GgK4Hxs1WJ4bmGN+nRcpSeyxsDC1OcdS8BANCCKndiCkjcWMAXUUshwSXpxYNr7T+d4WJFyxFwK32r6XVGVHLQC/FjRggwvk4kxz8EUDadTmkhapvsp4gJhlNW9M8QLwEVgiHyU/q8kXo/tZOn7DJTnYCAvUzPCAWI= Received: from MW2PR18MB2282.namprd18.prod.outlook.com (2603:10b6:907:f::19) by BN9PR18MB4250.namprd18.prod.outlook.com (2603:10b6:408:11b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.27; Fri, 20 Jan 2023 12:43:24 +0000 Received: from MW2PR18MB2282.namprd18.prod.outlook.com ([fe80::af10:c980:147a:3172]) by MW2PR18MB2282.namprd18.prod.outlook.com ([fe80::af10:c980:147a:3172%5]) with mapi id 15.20.6002.027; Fri, 20 Jan 2023 12:43:24 +0000 From: Volodymyr Fialko To: Volodymyr Fialko , "dev@dpdk.org" , Reshma Pattan CC: Jerin Jacob Kollanukkaran , Anoob Joseph Subject: RE: [PATCH 3/3] test/reorder: add cases to cover new API Thread-Topic: [PATCH 3/3] test/reorder: add cases to cover new API Thread-Index: AQHZLLkOjmgmxOq+JEang5d15vuabq6nPkXg Date: Fri, 20 Jan 2023 12:43:24 +0000 Message-ID: References: <20230120102146.4035460-1-vfialko@marvell.com> <20230120102146.4035460-4-vfialko@marvell.com> In-Reply-To: <20230120102146.4035460-4-vfialko@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW2PR18MB2282:EE_|BN9PR18MB4250:EE_ x-ms-office365-filtering-correlation-id: 327a6885-59d6-4221-b34e-08dafae3ebbb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fc1QGGHdrsPlQHfucI3lHuCULlz+StgLx/5nmHHRSi3Dq/6GiPDmcnO3eyFgtrw8a/eaS3Rv+6QHHEz3yZDFs0XJfQY7DJepIhP9x9DbT28sOwA4PaXbLfr8vGPv8/SDrnlC7APIWKx4EwYire6jKyosBvjFLtszqbZPN/N95k+pixpfXVETCCwBNX22VhPt/wpvG+DaCDvG/7Efd8m2ax1cwIjj7PaexDWH7vpSowG4y39QZtVc4PshacLcLoG5VZtg/bxrq+HHCQENpRQmt5VZ76AaWLJ0f8NwXcxSXcXZdaJUd+uQalfHbys5RHqeyCVIOajfrN828lNtinHs9pTIQFizQcIq/2ySS+IXAJm/cKbAxPvmtSBa+Ub5hgG5LkquMt/zMP/DN8Soj9nfXDOXcByQJ6Fhjbxm/jFkEgpOZ0X7OXkw6OjfKIj8LT4Krq5XpRdwswKv1gCZ8FhQ7BlKG1DGO2bQCiflEkCLt0VIyF3XfGDG82YSE11fkUqzneAtXBUBzqsnEQ9sSSqcHq6TNEirUXASRN/JLB/LJ16RY8pvZiyUshhNIrUQE939qhejwiHGMtwgcD70HfEaCuY2V8knbcOI03JSuANaPYlZmPAoX/ABFY5b0NYrMd9cAjrqKL3WTI9TB0WhX/azvSG+EgEodVUf3MxK2PAOgI8rqczP2GJr3mxVI4cJmWs7gw39H7pUTXJttZnJ+PGDHnmS8JF3bIaUDEA1LIN+QuQ= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR18MB2282.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(366004)(136003)(346002)(376002)(451199015)(83380400001)(33656002)(478600001)(966005)(110136005)(7696005)(71200400001)(55016003)(38070700005)(86362001)(38100700002)(122000001)(52536014)(2906002)(6506007)(41300700001)(9686003)(186003)(26005)(53546011)(107886003)(64756008)(66446008)(4326008)(316002)(76116006)(66946007)(66556008)(66476007)(8676002)(5660300002)(8936002)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?o3h5VscRYQKnJQD4h8cE7uAT4GpYWVTsxL0Fpm4yNltfkf6uTdEpj5i93F3R?= =?us-ascii?Q?bATXGirus9rIxikxpXhcT4ens0GadmokLis6nClWh6Kc76+vSs2psW5F0NAx?= =?us-ascii?Q?1OWc+/p0oF0ZRP4XcPLR4mzjP0hGEg1zEElzvP5BrLAx9oRni8f/xO3y7yvA?= =?us-ascii?Q?iLglxYgRFYduk/hAY5OKVM+l2T081835WKHBVB8jteWm0fu4fV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sdVvbkVkbTsJks3O8HOqtwR1DYqDeNG9nliZfk8WHzSKtpeLL?= =?us-ascii?Q?tIcmkLan82jGGr6YOw7Qeu764P1Af7FD9g2+jXU+P/fAvR1IR+3tSD6xOgcJ?= =?us-ascii?Q?M8vv1iKUylhyflZcPSDx3j5ifi17mO0hryuSAdvLiM/5fT4ltj0A/nP9jZS3?= =?us-ascii?Q?1Jk9dx+vOSNnEehdCbLIP/lGV5HPiBIDwZ9cGUeboL/ytBvbQUiFhgyWR3bs?= =?us-ascii?Q?UaOPGhgSRKlF7v7QzElEDtfw1pzrGyi/QqjzV+/qLxhdft5/cXuRxqLxrzdT?= =?us-ascii?Q?sfRMSbrR0AK2OztY5Q2rrQJKfFH3uIz7n0LFNuWA3ptBa0h916pqWHPx03W5?= =?us-ascii?Q?7LudeMXAxfRGAIAnuC8W1t3uF3xep606J+nyLSyBdKqaZSYNXxhYPw21vjdu?= =?us-ascii?Q?l+djxICd5QmVE9TGftnhpDRqYnFeT7anrNHAZEPQq77u7PZguhxl1j1B/VcH?= =?us-ascii?Q?Q+dfdTIygn9PwBB+GmxP/w3XCFo+UZpbE6d5rLDc?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR18MB2282.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 327a6885-59d6-4221-b34e-08dafae3ebbb X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2023 12:43:24.5501 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jGRnpie8dEOapOmHP4UK8nFTezsJ5F153EhEUlf5jZxFXqjlQz5J2tCRWCKWrpmgXdrfI+LTGSChLnHbd8zBtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR18MB4250 X-Proofpoint-GUID: fPLlYh5T1upOrDPGRd5o5vCNuoAfKUBh X-Proofpoint-ORIG-GUID: fPLlYh5T1upOrDPGRd5o5vCNuoAfKUBh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-20_08,2023-01-20_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Depends-on: series-26425 ("lib/reorder: fix drain/free issues") Test failure is caused by this bug in drain/api test - http://patches.dpdk.= org/project/dpdk/list/?series=3D26425 It wasn't seen before seen before because drain was the last test, but now = following test receive pointer to same packet twice due to double free. > -----Original Message----- > From: Volodymyr Fialko > Sent: Friday, January 20, 2023 11:22 AM > To: dev@dpdk.org; Reshma Pattan > Cc: Jerin Jacob Kollanukkaran ; Anoob Joseph ; > Volodymyr Fialko > Subject: [PATCH 3/3] test/reorder: add cases to cover new API >=20 > Add new test cases to cover `rte_reorder_drain_up_to_seqn` and `rte_reord= er_min_seqn_set`. >=20 > Signed-off-by: Volodymyr Fialko > --- > app/test/test_reorder.c | 160 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 160 insertions(+) >=20 > diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c index f071= 4a5c18..c345a72e0c 100644 > --- a/app/test/test_reorder.c > +++ b/app/test/test_reorder.c > @@ -335,6 +335,164 @@ test_reorder_drain(void) > return ret; > } >=20 > +static void > +buffer_to_reorder_move(struct rte_mbuf **mbuf, struct > +rte_reorder_buffer *b) { > + rte_reorder_insert(b, *mbuf); > + *mbuf =3D NULL; > +} > + > +static int > +test_reorder_drain_up_to_seqn(void) > +{ > + struct rte_mempool *p =3D test_params->p; > + struct rte_reorder_buffer *b =3D NULL; > + const unsigned int num_bufs =3D 10; > + const unsigned int size =3D 4; > + unsigned int i, cnt; > + int ret =3D 0; > + > + struct rte_mbuf *bufs[num_bufs]; > + struct rte_mbuf *robufs[num_bufs]; > + > + /* initialize all robufs to NULL */ > + memset(robufs, 0, sizeof(robufs)); > + > + /* This would create a reorder buffer instance consisting of: > + * reorder_seq =3D 0 > + * ready_buf: RB[size] =3D {NULL, NULL, NULL, NULL} > + * order_buf: OB[size] =3D {NULL, NULL, NULL, NULL} > + */ > + b =3D rte_reorder_create("test_drain_up_to_seqn", rte_socket_id(), size= ); > + TEST_ASSERT_NOT_NULL(b, "Failed to create reorder buffer"); > + > + for (i =3D 0; i < num_bufs; i++) { > + bufs[i] =3D rte_pktmbuf_alloc(p); > + TEST_ASSERT_NOT_NULL(bufs[i], "Packet allocation failed\n"); > + *rte_reorder_seqn(bufs[i]) =3D i; > + } > + > + /* Insert packet with seqn 1 and 3: > + * RB[] =3D {NULL, NULL, NULL, NULL} > + * OB[] =3D {1, 2, 3, NULL} > + */ > + buffer_to_reorder_move(&bufs[1], b); > + buffer_to_reorder_move(&bufs[2], b); > + buffer_to_reorder_move(&bufs[3], b); > + /* Draining 1, 2 */ > + cnt =3D rte_reorder_drain_up_to_seqn(b, robufs, num_bufs, 3); > + if (cnt !=3D 2) { > + printf("%s:%d:%d: number of expected packets not drained\n", > + __func__, __LINE__, cnt); > + ret =3D -1; > + goto exit; > + } > + for (i =3D 0; i < 2; i++) > + rte_pktmbuf_free(robufs[i]); > + memset(robufs, 0, sizeof(robufs)); > + > + /* Insert more packets > + * RB[] =3D {NULL, NULL, NULL, NULL} > + * OB[] =3D {3, 4, NULL, 6} > + */ > + buffer_to_reorder_move(&bufs[4], b); > + buffer_to_reorder_move(&bufs[6], b); > + /* Insert more packets to utilize Ready buffer > + * RB[] =3D {3, NULL, 5, 6} > + * OB[] =3D {NULL, NULL, 8, NULL} > + */ > + buffer_to_reorder_move(&bufs[8], b); > + > + /* Drain 3 and 5 */ > + cnt =3D rte_reorder_drain_up_to_seqn(b, robufs, num_bufs, 6); > + if (cnt !=3D 2) { > + printf("%s:%d:%d: number of expected packets not drained\n", > + __func__, __LINE__, cnt); > + ret =3D -1; > + goto exit; > + } > + for (i =3D 0; i < 2; i++) > + rte_pktmbuf_free(robufs[i]); > + memset(robufs, 0, sizeof(robufs)); > + > + ret =3D 0; > +exit: > + rte_reorder_free(b); > + for (i =3D 0; i < num_bufs; i++) { > + rte_pktmbuf_free(bufs[i]); > + rte_pktmbuf_free(robufs[i]); > + } > + return ret; > +} > + > +static int > +test_reorder_set_seqn(void) > +{ > + struct rte_mempool *p =3D test_params->p; > + struct rte_reorder_buffer *b =3D NULL; > + const unsigned int num_bufs =3D 7; > + const unsigned int size =3D 4; > + unsigned int i; > + int ret =3D 0; > + > + struct rte_mbuf *bufs[num_bufs]; > + > + /* This would create a reorder buffer instance consisting of: > + * reorder_seq =3D 0 > + * ready_buf: RB[size] =3D {NULL, NULL, NULL, NULL} > + * order_buf: OB[size] =3D {NULL, NULL, NULL, NULL} > + */ > + b =3D rte_reorder_create("test_min_seqn_set", rte_socket_id(), size); > + TEST_ASSERT_NOT_NULL(b, "Failed to create reorder buffer"); > + > + for (i =3D 0; i < num_bufs; i++) { > + bufs[i] =3D rte_pktmbuf_alloc(p); > + if (bufs[i] =3D=3D NULL) { > + printf("Packet allocation failed\n"); > + goto exit; > + } > + *rte_reorder_seqn(bufs[i]) =3D i; > + } > + > + ret =3D rte_reorder_min_seqn_set(b, 5); > + if (ret !=3D 0) { > + printf("%s:%d: Error in setting min sequence number\n", __func__, __LI= NE__); > + ret =3D -1; > + goto exit; > + } > + > + ret =3D rte_reorder_insert(b, bufs[0]); > + if (ret >=3D 0) { > + printf("%s:%d: Insertion with value less the min seq number\n", __func= __, __LINE__); > + ret =3D -1; > + goto exit; > + } > + > + ret =3D rte_reorder_insert(b, bufs[5]); > + if (ret !=3D 0) { > + printf("%s:%d: Error inserting packet with valid seqn\n", __func__, __= LINE__); > + ret =3D -1; > + goto exit; > + } > + bufs[5] =3D NULL; > + > + ret =3D rte_reorder_min_seqn_set(b, 0); > + if (ret >=3D 0) { > + printf("%s:%d: Error in setting min sequence number with non-empty buf= fer\n", > + __func__, __LINE__); > + ret =3D -1; > + goto exit; > + } > + > + ret =3D 0; > +exit: > + rte_reorder_free(b); > + for (i =3D 0; i < num_bufs; i++) > + rte_pktmbuf_free(bufs[i]); > + > + return ret; > +} > + > static int > test_setup(void) > { > @@ -385,6 +543,8 @@ static struct unit_test_suite reorder_test_suite =3D= { > TEST_CASE(test_reorder_free), > TEST_CASE(test_reorder_insert), > TEST_CASE(test_reorder_drain), > + TEST_CASE(test_reorder_drain_up_to_seqn), > + TEST_CASE(test_reorder_set_seqn), > TEST_CASES_END() > } > }; > -- > 2.34.1