From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: [PATCH v2] examples/multi_process/symmetric_mp: fix link check 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> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "anatoly.burakov@intel.com" , "thomas@monjalon.net" , Akhil Goyal , "stable@dpdk.org" To: "dev@dpdk.org" Return-path: In-Reply-To: <20190327111318.12347-1-akhil.goyal@nxp.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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