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 B9E86A05D3 for ; Wed, 27 Mar 2019 12:33:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2318F1B0FC; Wed, 27 Mar 2019 12:33:12 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20052.outbound.protection.outlook.com [40.107.2.52]) by dpdk.org (Postfix) with ESMTP id 5FC751B0FB; Wed, 27 Mar 2019 12:33:10 +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=+a492lX0zP3qcFKWidsOUtijfXidLNt5rIoFJguclMY=; b=SQ29Dv04jkFHxWU/ijw31869as+eFW3X06r2n9A3pWqIk4w3UNj3pXSvX0nwXn7LCwjiBRVtWTDNkU/Xl6QlOw+opSOAc0C5EpYghiTkge3wsuo0rGRtQaMrZPYIDJsSmUFreOzj8Ujg6TwZbd+FHeWACOq0h++/sPfIrNnTZqo= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB5391.eurprd04.prod.outlook.com (20.178.120.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.17; Wed, 27 Mar 2019 11:33:08 +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:33:08 +0000 From: Akhil Goyal To: "dev@dpdk.org" CC: "anatoly.burakov@intel.com" , "thomas@monjalon.net" , Akhil Goyal , "stable@dpdk.org" Thread-Topic: [PATCH v2] examples/multi_process/symmetric_mp: fix link check Thread-Index: AQHU5JDanOr0oSUfaEGO6t9a0U7RnA== Date: Wed, 27 Mar 2019 11:33:08 +0000 Message-ID: <20190327112348.12785-1-akhil.goyal@nxp.com> References: <20190327111318.12347-1-akhil.goyal@nxp.com> In-Reply-To: <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: BMXPR01CA0091.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::31) 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: b12e35b3-ce19-4ee0-aad4-08d6b2a7fc83 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:VI1PR04MB5391; x-ms-traffictypediagnostic: VI1PR04MB5391: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(376002)(346002)(136003)(199004)(189003)(446003)(11346002)(8676002)(68736007)(476003)(6512007)(81156014)(86362001)(14444005)(486006)(305945005)(1730700003)(2616005)(186003)(6436002)(81166006)(6486002)(5640700003)(36756003)(7736002)(25786009)(54906003)(106356001)(478600001)(316002)(2351001)(6506007)(99286004)(53936002)(71190400001)(71200400001)(3846002)(105586002)(386003)(6916009)(97736004)(6116002)(5660300002)(66066001)(52116002)(102836004)(44832011)(1076003)(26005)(2906002)(14454004)(76176011)(50226002)(8936002)(256004)(4326008)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5391; 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: lFrvn5bzSb3V6gtz+f+mPkuvX+gistC+osNHMru6j/KGfXcvbL416rHuk8j+w6px9CAMBETHJl2Wrw/K5FWEEY0wcMzl8n+5JEA78cRw4yBaBswl7UFT0NSo/3WI6tVXURmwJzle9eHZg7G6xnlFE2KiDufZ3CmPr8J4dmK8FOmrjou0FvWujmWSM5Z87jAkmjfQjW95nCr8bcMNyQsCSGTAPMoFaFxssje9FQnznSIC9WrUbRV+KfapHszAWcSpGcsFAKdZ1XPLDfPCKrAYLh1mK0bNTvC0sKRf1o6fzn9BFXpik+1AQjacAHUSlIu4SvqmAMPHePqmgIWVBHOxFre5W5vRLZN6avLkjyuSmGoIyqckn6XmgVujjNy+EQ7T68l91pft+7gc7cLpm6esRaKLbxhZOOQqEPw+JaykaQ4= 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: b12e35b3-ce19-4ee0-aad4-08d6b2a7fc83 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 11:33:08.8536 (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: VI1PR04MB5391 Subject: [dpdk-dev] [PATCH v2] 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: <20190327113308.81DuHDmU1e3pIf6RxS5JM_CG2fST9k1o3Clf6DtpGRw@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..7fb2a24ea 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 uint16_t port_mask; =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