From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150041.outbound.protection.outlook.com [40.107.15.41]) by dpdk.org (Postfix) with ESMTP id D8DC85B26; Wed, 27 Mar 2019 12:22:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=neE8JyYj55LIl5L7f+mEEd9f+RHEQv2DcZ8jRO0dKXU=; b=cC6hmysbvVUxdJ5U40R6jI+ggbajV/Od3GSwn98khjXKRJYwIdE6ziEl77/GfAjYDLLlRFawduWFETfvJBmupma4P6DN1Y8yJ92OT2FmHB95E9A7vTtcIzaMQ8nkSaqhCw8bya1+JPA0Wts9cuBXxAey5JXCBdYE2MdGa2VknNU= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB1055.eurprd04.prod.outlook.com (10.161.109.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Wed, 27 Mar 2019 11:22:40 +0000 Received: from VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb]) by VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb%4]) with mapi id 15.20.1750.014; Wed, 27 Mar 2019 11:22:40 +0000 From: Akhil Goyal To: "dev@dpdk.org" CC: "anatoly.burakov@intel.com" , "thomas@monjalon.net" , Akhil Goyal , "stable@dpdk.org" Thread-Topic: [PATCH] examples/multi_process/symmetric_mp: fix link check Thread-Index: AQHU5I9j24BRBcW4vkmumD1SWB4UPA== Date: Wed, 27 Mar 2019 11:22:40 +0000 Message-ID: <20190327111318.12347-1-akhil.goyal@nxp.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::27) To VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) x-mailer: git-send-email 2.17.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.68] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4fa90d19-a663-421c-9a8d-08d6b2a68612 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB1055; x-ms-traffictypediagnostic: VI1PR04MB1055: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(346002)(396003)(376002)(39860400002)(199004)(189003)(52116002)(486006)(478600001)(256004)(476003)(25786009)(14444005)(66066001)(44832011)(26005)(102836004)(71190400001)(6506007)(386003)(2616005)(186003)(71200400001)(97736004)(14454004)(6916009)(99286004)(2501003)(1730700003)(1076003)(81156014)(81166006)(86362001)(5640700003)(53936002)(54906003)(6436002)(6512007)(6486002)(8676002)(316002)(4326008)(106356001)(7736002)(8936002)(5660300002)(3846002)(6116002)(2351001)(50226002)(36756003)(68736007)(305945005)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1055; H:VI1PR04MB4893.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: xxThV2d31dV7te0Vdiui7wVX2iQnk+Rwmf9Nms9KVFSmcyL++RC6QqbJPK4LC0tuOTyHMUdDsMM7uPcR4/hM//vqIfXUeEwjh357Nd0MAj1UJEdkg489s3tJ6n+weNKf6lmIUvLPxAy4oEoUhwttjyBjJkNdAEc08dYArVncjJpcEVMx7g57Pcfxsh9Dr+AOsnAiMzs6L5tR9n9vfd6lMPvU/NUtrQiEWSXUCeltWT6dZ8YjDRNoEGc7lt/NDYECKLKB4DZkrNoosDBiJs+7kouRrcCDb0LenuIT2rDKXmZllgbBPhiOzH/LigjyyTcSICnihy6SGApx/9khjX51dcmaiiuqoTA4r7K6FFB0j+TVbn50YIwISkUhEBTIIk6y7E2v4dxQuQicyO1/1gOqwzU4ZVX97Av05d+nB9nva8s= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fa90d19-a663-421c-9a8d-08d6b2a68612 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 11:22:40.7988 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1055 Subject: [dpdk-dev] [PATCH] examples/multi_process/symmetric_mp: fix link check 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: , X-List-Received-Date: Wed, 27 Mar 2019 11:22:43 -0000 link check is done for primary process for the ports which are given in the port mask and not the complete set of ports. Fixes: d3641ae86313 ("examples: update link status checks") Cc: stable@dpdk.org Signed-off-by: Akhil Goyal --- examples/multi_process/symmetric_mp/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_pr= ocess/symmetric_mp/main.c index c310e942b..ed407ab2c 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -73,6 +73,7 @@ static unsigned num_procs =3D 0; =20 static uint16_t ports[RTE_MAX_ETHPORTS]; static unsigned num_ports =3D 0; +static unsigned port_mask =3D 0; =20 static struct lcore_ports lcore_ports[RTE_MAX_LCORE]; static struct port_stats pstats[RTE_MAX_ETHPORTS]; @@ -115,7 +116,7 @@ smp_parse_args(int argc, char **argv) int opt, ret; char **argvopt; int option_index; - uint16_t i, port_mask =3D 0; + uint16_t i; char *prgname =3D argv[0]; static struct option lgopts[] =3D { {PARAM_NUM_PROCS, 1, 0, 0}, @@ -349,7 +350,7 @@ lcore_main(void *arg __rte_unused) =20 /* Check the link status of all ports in up to 9s, and print them finally = */ static void -check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) +check_all_ports_link_status(uint16_t port_num, uint32_t mask) { #define CHECK_INTERVAL 100 /* 100ms */ #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */ @@ -362,7 +363,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t= port_mask) for (count =3D 0; count <=3D MAX_CHECK_TIME; count++) { all_ports_up =3D 1; for (portid =3D 0; portid < port_num; portid++) { - if ((port_mask & (1 << portid)) =3D=3D 0) + if ((mask & (1 << portid)) =3D=3D 0) continue; memset(&link, 0, sizeof(link)); rte_eth_link_get_nowait(portid, &link); @@ -451,7 +452,7 @@ main(int argc, char **argv) } =20 if (proc_type =3D=3D RTE_PROC_PRIMARY) - check_all_ports_link_status((uint8_t)num_ports, (~0x0)); + check_all_ports_link_status(rte_eth_dev_count(), port_mask); =20 assign_ports_to_cores(); =20 --=20 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3C26CA05D3 for ; Wed, 27 Mar 2019 12:22:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F1A11B116; Wed, 27 Mar 2019 12:22:44 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150041.outbound.protection.outlook.com [40.107.15.41]) by dpdk.org (Postfix) with ESMTP id D8DC85B26; Wed, 27 Mar 2019 12:22:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=neE8JyYj55LIl5L7f+mEEd9f+RHEQv2DcZ8jRO0dKXU=; b=cC6hmysbvVUxdJ5U40R6jI+ggbajV/Od3GSwn98khjXKRJYwIdE6ziEl77/GfAjYDLLlRFawduWFETfvJBmupma4P6DN1Y8yJ92OT2FmHB95E9A7vTtcIzaMQ8nkSaqhCw8bya1+JPA0Wts9cuBXxAey5JXCBdYE2MdGa2VknNU= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB1055.eurprd04.prod.outlook.com (10.161.109.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Wed, 27 Mar 2019 11:22:40 +0000 Received: from VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb]) by VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb%4]) with mapi id 15.20.1750.014; Wed, 27 Mar 2019 11:22:40 +0000 From: Akhil Goyal To: "dev@dpdk.org" CC: "anatoly.burakov@intel.com" , "thomas@monjalon.net" , Akhil Goyal , "stable@dpdk.org" Thread-Topic: [PATCH] examples/multi_process/symmetric_mp: fix link check Thread-Index: AQHU5I9j24BRBcW4vkmumD1SWB4UPA== Date: Wed, 27 Mar 2019 11:22:40 +0000 Message-ID: <20190327111318.12347-1-akhil.goyal@nxp.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::27) To VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) x-mailer: git-send-email 2.17.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.68] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4fa90d19-a663-421c-9a8d-08d6b2a68612 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB1055; x-ms-traffictypediagnostic: VI1PR04MB1055: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(346002)(396003)(376002)(39860400002)(199004)(189003)(52116002)(486006)(478600001)(256004)(476003)(25786009)(14444005)(66066001)(44832011)(26005)(102836004)(71190400001)(6506007)(386003)(2616005)(186003)(71200400001)(97736004)(14454004)(6916009)(99286004)(2501003)(1730700003)(1076003)(81156014)(81166006)(86362001)(5640700003)(53936002)(54906003)(6436002)(6512007)(6486002)(8676002)(316002)(4326008)(106356001)(7736002)(8936002)(5660300002)(3846002)(6116002)(2351001)(50226002)(36756003)(68736007)(305945005)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1055; H:VI1PR04MB4893.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: xxThV2d31dV7te0Vdiui7wVX2iQnk+Rwmf9Nms9KVFSmcyL++RC6QqbJPK4LC0tuOTyHMUdDsMM7uPcR4/hM//vqIfXUeEwjh357Nd0MAj1UJEdkg489s3tJ6n+weNKf6lmIUvLPxAy4oEoUhwttjyBjJkNdAEc08dYArVncjJpcEVMx7g57Pcfxsh9Dr+AOsnAiMzs6L5tR9n9vfd6lMPvU/NUtrQiEWSXUCeltWT6dZ8YjDRNoEGc7lt/NDYECKLKB4DZkrNoosDBiJs+7kouRrcCDb0LenuIT2rDKXmZllgbBPhiOzH/LigjyyTcSICnihy6SGApx/9khjX51dcmaiiuqoTA4r7K6FFB0j+TVbn50YIwISkUhEBTIIk6y7E2v4dxQuQicyO1/1gOqwzU4ZVX97Av05d+nB9nva8s= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fa90d19-a663-421c-9a8d-08d6b2a68612 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 11:22:40.7988 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1055 Subject: [dpdk-dev] [PATCH] examples/multi_process/symmetric_mp: fix link check 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" Message-ID: <20190327112240.At0hpMLwW63YD99ULtItfvJXU3f0ScUFIwaLhI32mzA@z> link check is done for primary process for the ports which are given in the port mask and not the complete set of ports. Fixes: d3641ae86313 ("examples: update link status checks") Cc: stable@dpdk.org Signed-off-by: Akhil Goyal --- examples/multi_process/symmetric_mp/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_pr= ocess/symmetric_mp/main.c index c310e942b..ed407ab2c 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -73,6 +73,7 @@ static unsigned num_procs =3D 0; =20 static uint16_t ports[RTE_MAX_ETHPORTS]; static unsigned num_ports =3D 0; +static unsigned port_mask =3D 0; =20 static struct lcore_ports lcore_ports[RTE_MAX_LCORE]; static struct port_stats pstats[RTE_MAX_ETHPORTS]; @@ -115,7 +116,7 @@ smp_parse_args(int argc, char **argv) int opt, ret; char **argvopt; int option_index; - uint16_t i, port_mask =3D 0; + uint16_t i; char *prgname =3D argv[0]; static struct option lgopts[] =3D { {PARAM_NUM_PROCS, 1, 0, 0}, @@ -349,7 +350,7 @@ lcore_main(void *arg __rte_unused) =20 /* Check the link status of all ports in up to 9s, and print them finally = */ static void -check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) +check_all_ports_link_status(uint16_t port_num, uint32_t mask) { #define CHECK_INTERVAL 100 /* 100ms */ #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */ @@ -362,7 +363,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t= port_mask) for (count =3D 0; count <=3D MAX_CHECK_TIME; count++) { all_ports_up =3D 1; for (portid =3D 0; portid < port_num; portid++) { - if ((port_mask & (1 << portid)) =3D=3D 0) + if ((mask & (1 << portid)) =3D=3D 0) continue; memset(&link, 0, sizeof(link)); rte_eth_link_get_nowait(portid, &link); @@ -451,7 +452,7 @@ main(int argc, char **argv) } =20 if (proc_type =3D=3D RTE_PROC_PRIMARY) - check_all_ports_link_status((uint8_t)num_ports, (~0x0)); + check_all_ports_link_status(rte_eth_dev_count(), port_mask); =20 assign_ports_to_cores(); =20 --=20 2.17.1