From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DD46CA0487
	for <public@inbox.dpdk.org>; Fri,  5 Jul 2019 12:05:13 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 503E81BE23;
	Fri,  5 Jul 2019 12:05:12 +0200 (CEST)
Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com
 [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 113751BE19;
 Fri,  5 Jul 2019 12:05:09 +0200 (CEST)
Received: from pps.filterd (m0045849.ppops.net [127.0.0.1])
 by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id
 x65A37RI002754; Fri, 5 Jul 2019 03:05:09 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;
 h=from : to : cc :
 subject : date : message-id : references : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=pfpt0818;
 bh=ZwVkuBQh8uLsgTNdPweRdDO4e9G1rzqp7sqs9EX/dCo=;
 b=Xez7x7d1/xKUAVzEVKT+n4qCzAfv8ttP1HAh4cXWUe6Ni4DThHlA0HCoZw3HHMKmB22q
 pwz0E0WdTzasg0EGVLYg3MLVCe1G3NKl8bO3I4sgk3OArKCoxE3RJXTqzpeq2tj1Z/KY
 xF7VmMtGc4hZL/d3UKuu8rKpBCV7UFPsvQi8nWnphqMdH1mPYmGWS4mW9QXe4/IpUgCC
 dE9S3EVzjAcDbWHmLrMaZS9GK+DZKlfO3aggq4B7+xRe7LknLB4WGGi1y5uQxXRLu94c
 2kFJif7SdHO8wnvsPDU/acQJNe+9t2n70aidwdlunokZjjLNKIllfXEw+htBGGZQG5GG MA== 
Received: from sc-exch02.marvell.com ([199.233.58.182])
 by mx0a-0016f401.pphosted.com with ESMTP id 2thv9p1ntw-2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);
 Fri, 05 Jul 2019 03:05:08 -0700
Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH02.marvell.com
 (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 5 Jul
 2019 03:05:07 -0700
Received: from NAM05-DM3-obe.outbound.protection.outlook.com (104.47.49.59) by
 SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server
 (TLS) id
 15.0.1367.3 via Frontend Transport; Fri, 5 Jul 2019 03:05:07 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZwVkuBQh8uLsgTNdPweRdDO4e9G1rzqp7sqs9EX/dCo=;
 b=g2vvisnCbtOKuCOYBOUYsx82UzCCRmSBuTuirt6bGVHz3PieLWz5NKmIEBkPrKI751DlXDfivW/NAtWSk3zjLGtXJON05Jza9KXLgbElLSXjACNOjqYDQ/EWtoNR2N7walRpTGO7Mdjo1pZC6ukwdFPP6INfVCwGpC9LAUHimZY=
Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by
 MN2PR18MB2382.namprd18.prod.outlook.com (20.179.81.145) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2052.18; Fri, 5 Jul 2019 10:05:04 +0000
Received: from MN2PR18MB2848.namprd18.prod.outlook.com
 ([fe80::4447:9459:5386:2e18]) by MN2PR18MB2848.namprd18.prod.outlook.com
 ([fe80::4447:9459:5386:2e18%7]) with mapi id 15.20.2052.019; Fri, 5 Jul 2019
 10:05:04 +0000
From: Harman Kalra <hkalra@marvell.com>
To: "thomas@monjalon.net" <thomas@monjalon.net>, "david.hunt@intel.com"
 <david.hunt@intel.com>, "ferruh.yigit@linux.intel.com"
 <ferruh.yigit@linux.intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, Jerin Jacob Kollanukkaran
 <jerinj@marvell.com>, Harman Kalra <hkalra@marvell.com>, "stable@dpdk.org"
 <stable@dpdk.org>
Thread-Topic: [PATCH v3 1/2] test/distributor: fix flush with worker shutdown
 test
Thread-Index: AQHVMxkdj9C+/l+pm0u5d3KcDB2kjQ==
Date: Fri, 5 Jul 2019 10:05:04 +0000
Message-ID: <1562321046-25195-1-git-send-email-hkalra@marvell.com>
References: <223181000.veHZD1QNU4@xps>
In-Reply-To: <223181000.veHZD1QNU4@xps>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-clientproxiedby: BMXPR01CA0070.INDPRD01.PROD.OUTLOOK.COM
 (2603:1096:b00:2c::34) To MN2PR18MB2848.namprd18.prod.outlook.com
 (2603:10b6:208:3e::21)
x-ms-exchange-messagesentrepresentingtype: 1
x-mailer: git-send-email 2.7.4
x-originating-ip: [115.113.156.2]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 44c311ea-57e7-4d63-5d9e-08d701303ff9
x-microsoft-antispam: BCL:0; PCL:0;
 RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);
 SRVR:MN2PR18MB2382; 
x-ms-traffictypediagnostic: MN2PR18MB2382:
x-microsoft-antispam-prvs: <MN2PR18MB23824FE5BCAE13F20DE51E9DC5F50@MN2PR18MB2382.namprd18.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:935;
x-forefront-prvs: 008960E8EC
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(4636009)(39850400004)(346002)(136003)(376002)(366004)(396003)(189003)(199004)(54906003)(14444005)(110136005)(478600001)(6512007)(52116002)(5660300002)(50226002)(2501003)(316002)(71190400001)(71200400001)(66066001)(76176011)(6116002)(3846002)(256004)(68736007)(86362001)(6506007)(446003)(26005)(186003)(386003)(2201001)(102836004)(55236004)(25786009)(4744005)(486006)(6436002)(2616005)(476003)(11346002)(4326008)(6486002)(14454004)(36756003)(66946007)(8936002)(66446008)(2906002)(81156014)(53936002)(81166006)(8676002)(64756008)(66556008)(7736002)(99286004)(66476007)(305945005)(73956011);
 DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2382;
 H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; MX:1; A:1; 
received-spf: None (protection.outlook.com: marvell.com does not designate
 permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: 7C9FBrPyvJFmHgpR+xmlzNG97aqPRZngZtU3+rD41Y9EI5j6VjqXiQewBk5ENA9Gj5bS/qyjZBCQTqQTjrauVzVzjVZH4yJDGbbwCWNSLjcpaQG1x7dI8NaumW7jcWz6flf5iIptnjGlA0v+6LFGTPFs0FW1jcibnwk/u75/2QIq8JUjJbB8CoLOdsVe5pHFAWzvIav4Dy4PJRQTc8Nco2YwHBlEFR7/ctkfleKI6esivTQPRNotYNVZ0VK1vCHPCh/9QZpBuVWWHVC/YhMCqHA6asJTOTPCmfmJKh24E6qvyvuQqk9JUCWAdPGRs/APWDgy6nxo0OEIDu0XfTz+F5znnPIYTgAgHpsNZ1K4VLac5o2BjZGb/MwzklHSUV7abiDFePglvj2YdwKVQMsYUWPXPnmeCRr4punYHIrgi+I=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 44c311ea-57e7-4d63-5d9e-08d701303ff9
X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2019 10:05:04.4056 (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: hkalra@marvell.com
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2382
X-OriginatorOrg: marvell.com
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, ,
 definitions=2019-07-05_04:, , signatures=0
Subject: [dpdk-dev] [PATCH v3 1/2] test/distributor: fix flush with worker
	shutdown test
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On restarting worker 0 after shutdown, packets handled by
worker 0 must be incremented only when a packet is received by
it.

Fixes: c3eabff124e6 ("distributor: add unit tests")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 app/test/test_distributor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 8084c0794..5d71bf87c 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -374,7 +374,8 @@ handle_work_for_shutdown_test(void *arg)
 				id, buf, buf, num);
=20
 		while (!quit) {
-			worker_stats[id].handled_packets++, count++;
+			worker_stats[id].handled_packets +=3D num;
+			count +=3D num;
 			rte_pktmbuf_free(pkt);
 			num =3D rte_distributor_get_pkt(d, id, buf, buf, num);
 		}
--=20
2.18.0