examples/l3fwd-power: check packet types after start

l3fwd-power uses `--parse-ptype' parameter to query egress packets
type.  Before that feature is enabled l3fwd-power verifies PMD ability
to advertise supported packet types with
rte_eth_dev_get_supported_ptypes().

The above ethdev function API contains this note:
"
Better to invoke this API after the device is already started or rx burst
function is decided, to obtain correct supported ptypes.
"

The patch updates code for PMDs that register supported types after
dev_start.

Fixes: 82bea46616 ("examples/l3fwd-power: add --parse-ptype option")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
This commit is contained in:
Gregory Etelson 2020-11-17 20:49:39 +02:00 committed by Thomas Monjalon
parent fa7ad49e96
commit 6184a02223

View File

@ -2707,9 +2707,7 @@ main(int argc, char **argv)
if (add_cb_parse_ptype(portid, queueid) < 0)
rte_exit(EXIT_FAILURE,
"Fail to add ptype cb\n");
} else if (!check_ptype(portid))
rte_exit(EXIT_FAILURE,
"PMD can not provide needed ptypes\n");
}
}
}
@ -2740,6 +2738,11 @@ main(int argc, char **argv)
}
/* initialize spinlock for each port */
rte_spinlock_init(&(locks[portid]));
if (!parse_ptype)
if (!check_ptype(portid))
rte_exit(EXIT_FAILURE,
"PMD can not provide needed ptypes\n");
}
check_all_ports_link_status(enabled_port_mask);