Fixed integer overflow by casting link_params.link_speed to
uint64_t type.
Coverity issue: 195016
Fixes:
5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
memset(&link_params, 0, sizeof(link_params));
rte_eth_link_get(port_id, &link_params);
- tm_port_rate = link_params.link_speed * BYTES_IN_MBPS;
+ tm_port_rate = (uint64_t)link_params.link_speed * BYTES_IN_MBPS;
if (tm_port_rate > UINT32_MAX)
tm_port_rate = UINT32_MAX;