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 3757BA0562; Mon, 3 May 2021 19:37:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22407407FF; Mon, 3 May 2021 19:37:54 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2082.outbound.protection.outlook.com [40.107.237.82]) by mails.dpdk.org (Postfix) with ESMTP id 3528840691 for ; Mon, 3 May 2021 19:37:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XTd4Tox4m7UuYOiRaeNzYGfK7N/SMOFUC9/R2pZVS2rSu4U81oY+74dVvZOZb1HwtMCENJl8XE+En6roUc5D03RJ/ng5SNZrRm4ULlv4tNRSvBR8m4iIjGGa7JB//cJual69w4RhEBfpXY3EmCesYf6h0ASQS2ncbvdyqupvKYevE9LYzN27NBCQ4dh0f1iv6+gMJ4MyllJC/qf7pW+fHmL0EG5HE/1Mo0Y539qFFX6G9XvnFH3L2wXQluv7/x7hgqhmgAS2DyxS0GwIM64zhBPYgCxqzqHP3rbyw2GPqHwUcNhlfhOeATzkcEgYQf9uE7TBc/ylCI5QrsX2VTde+Q== 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=43tlkXhqEq8Sxt61j0bp7wThjmaOOqUmPHdkIJyQUYc=; b=NvbP5m14bVsYVQHR1QIiylrmK0wX8EGofEPsf8R0eZy0vxuLgxgg7LBcjqeBKLEuliJy00SiV05iUx9OflrQjEcw+hJdoK7ti9NzVgFB/bOTIMmxGEHs4QqAED4VztYJd7GqJGep3Qu2dlI0qwR/Olf88c2DncvOwMUil7Ero0VicdFJnCi+Uoo5cXcdmsDXCt9z8UDtssg/Yk/H98kaMVDVEv4QQOEOBKeVxrsVKxZsnGDFZ9ZxVIE5L5UhCBAMhWYuXVTaQoW4OvSm1PpGu9vF92ygdW4ZDRP9J9tuQDkNIR8anMtoFBr9zCELxmp1kemBsMM8BTucq247+DPGmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=43tlkXhqEq8Sxt61j0bp7wThjmaOOqUmPHdkIJyQUYc=; b=OZrUqKDZn0S+IvZsyAD/f2kdmkjOJIhcfrqk45lv2jxo1Eihxr49vDSZsutgPCDb7gdBa049mJtFrDNPDt7+oWVGd2c9vsdmrg1DtC86om6KXVf3NQRk7d7rHXMMQ7EUwvgP9cIjeik6YW28/ERkxvGugsoL2cXjEr5DilFz/47Q8OwUfTDRpV4SFwfYZolF6E7Bv9fqqiBPZR8CED0Kgez53mNNHKEvN85yKa+WNHxUJL+6jCcbvpoVHrV5b358ZoUFKJPBGV1gx55cluHXg2eO4Tz9HJCrSnWJO/HXE9Rnx+NxoDizJpGIJ7wPlwAtY8Ln1qnQpjHSIwyiwm8Vtg== Received: from DM4PR12MB5389.namprd12.prod.outlook.com (2603:10b6:5:39a::7) by DM4PR12MB5375.namprd12.prod.outlook.com (2603:10b6:5:39a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.39; Mon, 3 May 2021 17:37:52 +0000 Received: from DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::70df:ef1e:d98c:ce4]) by DM4PR12MB5389.namprd12.prod.outlook.com ([fe80::70df:ef1e:d98c:ce4%6]) with mapi id 15.20.4087.044; Mon, 3 May 2021 17:37:52 +0000 From: Tal Shnaiderman To: Jie Zhou , "dev@dpdk.org" CC: "dmitry.kozliuk@gmail.com" , "xiaoyun.li@intel.com" , "roretzla@microsoft.com" , "pallavi.kadam@intel.com" , NBU-Contact-Thomas Monjalon , "bruce.richardson@intel.com" , "ferruh.yigit@intel.com" , "konstantin.ananyev@intel.com" Thread-Topic: [PATCH v9 07/10] app/testpmd: replace POSIX specific code Thread-Index: AQHXPemirRAgdybgCEWVz8ckrAzQA6rSBwNA Date: Mon, 3 May 2021 17:37:52 +0000 Message-ID: References: <1619553721-5220-1-git-send-email-jizh@linux.microsoft.com> <1619805162-10684-1-git-send-email-jizh@linux.microsoft.com> <1619805162-10684-8-git-send-email-jizh@linux.microsoft.com> In-Reply-To: <1619805162-10684-8-git-send-email-jizh@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [5.29.16.219] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f153535a-52fe-44bf-190f-08d90e5a2d76 x-ms-traffictypediagnostic: DM4PR12MB5375: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:923; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9ZU000TK0kwCB1Ry8kdzVsRDSPvYbGZdIBvr8QSUmYQLsLP70uWIOU7t7/lBFyvPXMRHoVVWcDt4w6beI8XN9vwMivlZMLTZg/bAzLIC7LT7p2jR4NbIn0/z6iwaHtWYrOeGG4wGxWFSHtRiz5Qz/ABk/Yt7SCgCRUyxNpYqd3qQSYGOpVOcHiHphheNIkeZkBC4emfzfuDKJBgeftYFZVPkZlmT5wH4UpPthdt9pzi8CrvQGzOE3bFla+q/8QRFfh9Ku04WXRlba5CYR8YYQyYbeaxf9+yVzuXPgn8reJTpabpCYl5o+pkfslOt+wBi4VOGybOJr2crrYoEUfYjBLvOALvcfLpUNhjlY6hI1W/q/Pnsf93TNhT/07T7tkIB6vkYUARZ622zKZ1YZ/v17Y1uyPDytj3v0Xdd/SfGgSMTwBZoVRfnUAf504duWjlEkIjozuHElvd30f255X9wANNEHtdaEQUYqixjbF+YBJSPHdnVPSI6FeNk9LeDHrNbZkGMl4Z70+YLxinLMeAAYqGLWkd5u4/OHlcfL9b2WXkDwLwucGAOYUyLIKNKxTViSk2Wj8dtmN9ZH3DUPgrAbo2IStwHIMBEQ+uUWHzhtrU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5389.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(136003)(396003)(366004)(66946007)(26005)(76116006)(38100700002)(33656002)(64756008)(6506007)(122000001)(66446008)(66556008)(66476007)(52536014)(71200400001)(83380400001)(4326008)(7416002)(5660300002)(316002)(478600001)(7696005)(8936002)(8676002)(54906003)(2906002)(186003)(86362001)(110136005)(9686003)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?I2Ln6Ke3wtTygUZucT+9N6scpJsZPC6YuhNy2ibe5yX1D1rm5owWOhQ1ap9y?= =?us-ascii?Q?CJwuvEo0NPg7f182bWEPgOGtuxSYEDfOhJcOYWLLN2RiXVOnmb2AiYBSwjpR?= =?us-ascii?Q?zCxypAsFVLLtpuqXNnD8NF5QI286JZaQqaXhevDGQbq/wCcyRGo+ntPeBcKY?= =?us-ascii?Q?VsyKUuJS0llXtWpFjJWojoot0gLKcHPUVmKnWXK3ffOfljV/7BfQYyf/GJkF?= =?us-ascii?Q?Ts/G3IED+gORnwYzHkKsSf2du7jBqTxfsiJ7ohjbKRW9OoIAgO9KT4JuINnq?= =?us-ascii?Q?G3uEZ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= =?us-ascii?Q?Ow5J1d8oQkJoKJwrOx6mmJbBMkgwhgwB2Twv8HDA5zPbqajuABdj83N3EpFr?= =?us-ascii?Q?yMCBkGsFNRvgLBgvwVR1hIgyCWn/UEXgrrrkXRfQjeRTDSU5Yx6KRjBMT3aQ?= =?us-ascii?Q?EkY=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5389.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f153535a-52fe-44bf-190f-08d90e5a2d76 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2021 17:37:52.1429 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZpXdMCsh2nwtQ6FZVKnoNrrTMyhcIzcbc9l7o60UPlxczVZhGHoLVA3IB1AmCCzoySO6bhkUp8GLee7s2lsYUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5375 Subject: Re: [dpdk-dev] [PATCH v9 07/10] app/testpmd: replace POSIX specific code 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 Sender: "dev" > Subject: [PATCH v9 07/10] app/testpmd: replace POSIX specific code >=20 > External email: Use caution opening links or attachments >=20 >=20 > - Make printf format OS independent > - Replace htons with RTE_BE16 > - Replace POSIX specific inet_aton with OS independent inet_pton > - Replace sleep with rte_delay_us_sleep > - Repalce random with rte_rand > - #ifndef mman related code for now >=20 > Signed-off-by: Jie Zhou > Signed-off-by: Jie Zhou > --- > app/test-pmd/cmdline.c | 3 +-- > app/test-pmd/csumonly.c | 2 +- > app/test-pmd/icmpecho.c | 4 ++-- > app/test-pmd/ieee1588fwd.c | 8 ++++---- app/test-pmd/parameters.c | > 10 +++++++--- > app/test-pmd/testpmd.c | 21 ++++++++++++++++++++- > app/test-pmd/testpmd.h | 2 +- > 7 files changed, 36 insertions(+), 14 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > d804ee233..f0636ca9b 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -8,7 +8,6 @@ > @@ pmd_test_exit(void) > NULL); > } > } > +#endif > if (ports !=3D NULL) { > no_link_check =3D 1; > RTE_ETH_FOREACH_DEV(pt_id) { @@ -3762,7 +3777,9 @@ > signal_handler(int signum) > f_quit =3D 1; > /* exit with the expected status */ > signal(signum, SIG_DFL); > +#ifndef RTE_EXEC_ENV_WINDOWS > kill(getpid(), signum); > +#endif signal() doesn't need to be inside the ifndef? > } > } >=20 > @@ -3837,10 +3854,12 @@ main(int argc, char** argv) > if (argc > 1) > launch_args_parse(argc, argv); >=20 > +#ifndef RTE_EXEC_ENV_WINDOWS > if (do_mlockall && mlockall(MCL_CURRENT | MCL_FUTURE)) { > TESTPMD_LOG(NOTICE, "mlockall() failed with error \"%s\"\= n", > strerror(errno)); > } > +#endif >=20 > if (tx_first && interactive) > rte_exit(EXIT_FAILURE, "--tx-first cannot be used on " > @@ -3961,7 +3980,7 @@ main(int argc, char** argv) > } > /* Sleep to avoid unnecessary checks */ > prev_time =3D cur_time; > - sleep(1); > + rte_delay_us_sleep(1000000); Please use US_PER_S > } > } >=20 > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > 1d104213b..a4115861b 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -763,7 +763,7 @@ inc_tx_burst_stats(struct fwd_stream *fs, uint16_t > nb_tx) } >=20 > /* Prototypes */ > -unsigned int parse_item_list(char* str, const char* item_name, > +unsigned int parse_item_list(const char *str, const char *item_name, > unsigned int max_items, > unsigned int *parsed_items, int check_unique_valu= es); void > launch_args_parse(int argc, char** argv); > -- > 2.30.0.vfs.0.2