27/03/2019 12:33, Akhil Goyal:
> 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: sta...@dpdk.org
> 
> Signed-off-by: Akhil Goyal <akhil.go...@nxp.com>
> ---
>               for (portid = 0; portid < port_num; portid++) {

The logic of this loop is wrong.
The port ids may be not contiguous.
Look at RTE_ETH_FOREACH_DEV* for such iteration.

> -                     if ((port_mask & (1 << portid)) == 0)
> +                     if ((mask & (1 << portid)) == 0)
>                               continue;
[...]
> -             check_all_ports_link_status((uint8_t)num_ports, (~0x0));
> +             check_all_ports_link_status(rte_eth_dev_count(), port_mask);

The function rte_eth_dev_count is deprecated.
It should be noticed when compiling.

On more comment, I think such wrong implementation is existing
in many examples:
% git grep -l 'check_all_ports_link_status(.*num'
        app/test/test_pmd_perf.c
        examples/link_status_interrupt/main.c
        examples/load_balancer/init.c
        examples/multi_process/client_server_mp/mp_server/init.c
        examples/multi_process/symmetric_mp/main.c
        examples/server_node_efd/server/init.c


Reply via email to