examples/vhost: fix potentially overflowing expression
PATCH 1/1 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
--- examples/vhost/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/vhost/main.c +1 -1
@@ -864,7 +864,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;
Signature · 1 line
2.29.2
PATCH v2 1/1 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
---
v2: fixed the format of git log
examples/vhost/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/vhost/main.c +1 -1
@@ -864,7 +864,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;
--
2.29.2
Quoted 27 lines · Cheng Jiang
Change the type of
buff_idxfromuint64_ttouint32_tto fix coverity issue.Coverity issue: 366264
Fixes a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")Signed-off-by Cheng Jiang <[email protected]>---
v2: fixed the format of git logexamples/vhost/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)examples/vhost/main.c +1
-2@@ -864,7 +864,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; --
Quoted 2 lines
2.29.2
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 5 lines · Cheng Jiang
|Change the type of
buff_idxfromuint64_ttouint32_tto fix coverity issue. Coverity issue: 366264 Fixes:a68ba8e0a6b6("examples/vhost:
refactor vhost data path") Signed-off-by: Cheng Jiang <[email protected]> --- v2: fixed the format of git logexamples/vhost/main.c| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)|
Applied to dpdk-next-virtio/main with typo fixed.
Thanks,
Maxime