From: Cheng Jiang Date: Tue, 2 Feb 2021 07:24:21 +0000 (+0000) Subject: examples/vhost: fix potentially overflowing expression X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ee6e451f14103b0396ae6a0087bdd33c67a79e12;p=dpdk.git examples/vhost: fix potentially overflowing expression Change the type of buff_idx from uint64_t to uint32_t to fix coverity issue. Coverity issue: 366264 Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path") Signed-off-by: Cheng Jiang Reviewed-by: Maxime Coquelin --- diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 99e8d9c69e..ca73e70860 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -861,7 +861,7 @@ static __rte_always_inline void drain_vhost(struct vhost_dev *vdev) { uint16_t ret; - uint64_t buff_idx = rte_lcore_id() * MAX_VHOST_DEVICE + vdev->vid; + uint32_t buff_idx = rte_lcore_id() * MAX_VHOST_DEVICE + vdev->vid; uint16_t nr_xmit = vhost_txbuff[buff_idx]->len; struct rte_mbuf **m = vhost_txbuff[buff_idx]->m_table;