vhost: fix missing null dev pointer check
PATCH 1/1 vhost: fix missing null dev pointer check
From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
--- lib/librte_vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)
lib/librte_vhost/virtio_net.c +3 -0
@@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,uint16_t start_idx, pkts_idx, vq_size;uint64_t *async_pending_info; +if (!dev) +return 0 ; +VHOST_LOG_DATA (DEBUG ,"(%d) %s\n" , dev->vid, __func__);if (unlikely (!is_valid_virt_queue_idx (queue_id,0 , dev->nr_vring))) { VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
Signature · 1 line
2.18.4
PATCH v2 1/1 vhost: fix missing null dev pointer check
From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
---
v2:
- change fixline number
lib/librte_vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)
lib/librte_vhost/virtio_net.c +3 -0
@@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,uint16_t start_idx, pkts_idx, vq_size;uint64_t *async_pending_info; +if (!dev) +return 0 ; +VHOST_LOG_DATA (DEBUG ,"(%d) %s\n" , dev->vid, __func__);if (unlikely (!is_valid_virt_queue_idx (queue_id,0 , dev->nr_vring))) { VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
Signature · 1 line
2.18.4
Quoted 39 lines
-----Original Message-----
From: Fu, Patrick <[email protected]>
Sent: Thursday, July 16, 2020 11:38 PM
To: [email protected]; [email protected]; Xia, Chenbo <[email protected]>
Cc: Fu, Patrick <[email protected]>
Subject: [PATCH v2] vhost: fix missing null dev pointer checkFrom: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
Fixes cd6760da1076 ("vhost: introduce async enqueue for split ring")Signed-off-by Patrick Fu <[email protected]>---
v2:
- change fixline numberlib/librte_vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)lib/librte_vhost/virtio_net.c index renamed from lib/librte_vhost/virtio_net.c +0
-0
1d0be3dd4..235c31e28100644lib/librte_vhost/virtio_net.c +3
-0@@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid,uint16_t queue_id, uint16_t start_idx, pkts_idx, vq_size;uint64_t *async_pending_info; +if (!dev) +return 0 ; +VHOST_LOG_DATA (DEBUG ,"(%d) %s\n" , dev->vid, __func__);if (unlikely (!is_valid_virt_queue_idx (queue_id,0 , dev->nr_vring))) {
Quoted 3 lines
VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
--
2.18.4
Ferruh Yigit
AppliedQuoted 14 lines · Chenbo
Quoted 14 lines
-----Original Message-----
From: Fu, Patrick <[email protected]>
Sent: Thursday, July 16, 2020 11:38 PM
To: [email protected]; [email protected]; Xia, Chenbo <[email protected]>
Cc: Fu, Patrick <[email protected]>
Subject: [PATCH v2] vhost: fix missing null dev pointer checkFrom: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Quoted 7 lines
Quoted 4 lines
Coverity issue: 360839
Fixes cd6760da1076 ("vhost: introduce async enqueue for split ring")Signed-off-by Patrick Fu <[email protected]>Reviewed-by Chenbo Xia <[email protected]>
Applied to dpdk-next-net/master, thanks.
What about below title (we try to avoid passing variable names in commit titles)?
vhost: fix missing device pointer validity check
Quoted 32 lines · On 7/16/20 5:37 PM, [email protected] wrote:
From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
Fixes cd6760da1076 ("vhost: introduce async enqueue for split ring")Signed-off-by Patrick Fu <[email protected]>---
v2:
- change fixline numberlib/librte_vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)lib/librte_vhost/virtio_net.c +3
-0@@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,uint16_t start_idx, pkts_idx, vq_size;uint64_t *async_pending_info; +if (!dev) +return 0 ; +VHOST_LOG_DATA (DEBUG ,"(%d) %s\n" , dev->vid, __func__);if (unlikely (!is_valid_virt_queue_idx (queue_id,0 , dev->nr_vring))) { VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
Quoted 3 lines · Maxime Coquelin
What about below title (we try to avoid passing variable names in commit titles)?
vhost: fix missing device pointer validity check
Existing commit dropped from next-net and patchwork status updated.
Quoted 12 lines · On 7/16/20 5:37 PM, [email protected] wrote:
Quoted 10 lines
From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
Fixes cd6760da1076 ("vhost: introduce async enqueue for split ring")Signed-off-by Patrick Fu <[email protected]>
<...>
PATCH v3 1/1 vhost: fix missing device pointer validity check
In reply to [email protected]From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
---
v2:
- change fixline number
v3:
- revise commit message title
lib/librte_vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)
lib/librte_vhost/virtio_net.c +3 -0
@@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,uint16_t start_idx, pkts_idx, vq_size;uint64_t *async_pending_info; +if (!dev) +return 0 ; +VHOST_LOG_DATA (DEBUG ,"(%d) %s\n" , dev->vid, __func__);if (unlikely (!is_valid_virt_queue_idx (queue_id,0 , dev->nr_vring))) { VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
Signature · 1 line
2.18.4
Re: [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check
Quoted 25 lines · On 7/21/20 5:23 AM, [email protected] wrote:
From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Coverity issue: 360839
Fixes cd6760da1076 ("vhost: introduce async enqueue for split ring")Signed-off-by Patrick Fu <[email protected]>---
v2:
- change fixline number
v3:
- revise commit message titlelib/librte_vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+)lib/librte_vhost/virtio_net.c +0
-0
lib/librte_vhost/virtio_net.c uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id, · line 1643
Quoted 9 lines
lib/librte_vhost/virtio_net.c +3
-0@@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,uint16_t start_idx, pkts_idx, vq_size;uint64_t *async_pending_info; +if (!dev) +return 0 ; +VHOST_LOG_DATA (DEBUG ,"(%d) %s\n" , dev->vid, __func__);if (unlikely (!is_valid_virt_queue_idx (queue_id,0 , dev->nr_vring))) { VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
Thanks,
Maxime
Ferruh Yigit
AppliedRe: [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check
Quoted 9 lines · Maxime Coquelin
Quoted 6 lines · On 7/21/20 5:23 AM, [email protected] wrote:
From: Patrick Fu <[email protected]>
This patch adds the check of dev pointer in vhost async enqueue completion poll. If a NULL dev pointer detected, the poll function returns immediately.
Quoted 7 lines
Quoted 4 lines
Coverity issue: 360839
Fixes cd6760da1076 ("vhost: introduce async enqueue for split ring")Signed-off-by Patrick Fu <[email protected]>Reviewed-by Maxime Coquelin <[email protected]>
Applied to dpdk-next-net/master, thanks.