DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: fix missing null dev pointer check
@ 2020-07-14  6:00 patrick.fu
  2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
  2020-07-21  3:23 ` [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check patrick.fu
  0 siblings, 2 replies; 9+ messages in thread
From: patrick.fu @ 2020-07-14  6:00 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: Patrick Fu

From: Patrick Fu <patrick.fu@intel.com>

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: cd6760da10 ("vhost: introduce async enqueue for split ring")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
---
 lib/librte_vhost/virtio_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 1d0be3dd4..235c31e28 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -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",
-- 
2.18.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check
  2020-07-14  6:00 [dpdk-dev] [PATCH v1] vhost: fix missing null dev pointer check patrick.fu
@ 2020-07-16 15:37 ` patrick.fu
  2020-07-17  8:08   ` Xia, Chenbo
  2020-07-20 15:55   ` Maxime Coquelin
  2020-07-21  3:23 ` [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check patrick.fu
  1 sibling, 2 replies; 9+ messages in thread
From: patrick.fu @ 2020-07-16 15:37 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: patrick.fu

From: Patrick Fu <patrick.fu@intel.com>

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 <patrick.fu@intel.com>
---
v2:
  - change fixline number

 lib/librte_vhost/virtio_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 1d0be3dd4..235c31e28 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -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",
-- 
2.18.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check
  2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
@ 2020-07-17  8:08   ` Xia, Chenbo
  2020-07-17 13:10     ` Ferruh Yigit
  2020-07-20 15:55   ` Maxime Coquelin
  1 sibling, 1 reply; 9+ messages in thread
From: Xia, Chenbo @ 2020-07-17  8:08 UTC (permalink / raw)
  To: Fu, Patrick, dev, maxime.coquelin


> -----Original Message-----
> From: Fu, Patrick <patrick.fu@intel.com>
> Sent: Thursday, July 16, 2020 11:38 PM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Fu, Patrick <patrick.fu@intel.com>
> Subject: [PATCH v2] vhost: fix missing null dev pointer check
> 
> From: Patrick Fu <patrick.fu@intel.com>
> 
> 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 <patrick.fu@intel.com>
> ---
> v2:
>   - change fixline number
> 
>  lib/librte_vhost/virtio_net.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index
> 1d0be3dd4..235c31e28 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -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",
> --
> 2.18.4

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check
  2020-07-17  8:08   ` Xia, Chenbo
@ 2020-07-17 13:10     ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2020-07-17 13:10 UTC (permalink / raw)
  To: Xia, Chenbo, Fu, Patrick, dev, maxime.coquelin

On 7/17/2020 9:08 AM, Xia, Chenbo wrote:
> 
>> -----Original Message-----
>> From: Fu, Patrick <patrick.fu@intel.com>
>> Sent: Thursday, July 16, 2020 11:38 PM
>> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
>> <chenbo.xia@intel.com>
>> Cc: Fu, Patrick <patrick.fu@intel.com>
>> Subject: [PATCH v2] vhost: fix missing null dev pointer check
>>
>> From: Patrick Fu <patrick.fu@intel.com>
>>
>> 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 <patrick.fu@intel.com>
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> 

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check
  2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
  2020-07-17  8:08   ` Xia, Chenbo
@ 2020-07-20 15:55   ` Maxime Coquelin
  2020-07-20 16:49     ` Ferruh Yigit
  1 sibling, 1 reply; 9+ messages in thread
From: Maxime Coquelin @ 2020-07-20 15:55 UTC (permalink / raw)
  To: patrick.fu, dev, chenbo.xia

What about below title (we try to avoid passing variable names in commit
titles)?
vhost: fix missing device pointer validity check

On 7/16/20 5:37 PM, patrick.fu@intel.com wrote:
> From: Patrick Fu <patrick.fu@intel.com>
> 
> 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 <patrick.fu@intel.com>
> ---
> v2:
>   - change fixline number
> 
>  lib/librte_vhost/virtio_net.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index 1d0be3dd4..235c31e28 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -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",
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check
  2020-07-20 15:55   ` Maxime Coquelin
@ 2020-07-20 16:49     ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2020-07-20 16:49 UTC (permalink / raw)
  To: Maxime Coquelin, patrick.fu, dev, chenbo.xia

On 7/20/2020 4:55 PM, Maxime Coquelin wrote:
> 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.

> 
> On 7/16/20 5:37 PM, patrick.fu@intel.com wrote:
>> From: Patrick Fu <patrick.fu@intel.com>
>>
>> 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 <patrick.fu@intel.com>

<...>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check
  2020-07-14  6:00 [dpdk-dev] [PATCH v1] vhost: fix missing null dev pointer check patrick.fu
  2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
@ 2020-07-21  3:23 ` patrick.fu
  2020-07-21  8:36   ` Maxime Coquelin
  1 sibling, 1 reply; 9+ messages in thread
From: patrick.fu @ 2020-07-21  3:23 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: Patrick Fu

From: Patrick Fu <patrick.fu@intel.com>

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 <patrick.fu@intel.com>
---
v2:
  - change fixline number
v3:
 - revise commit message title

 lib/librte_vhost/virtio_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 1d0be3dd4..235c31e28 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -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",
-- 
2.18.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check
  2020-07-21  3:23 ` [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check patrick.fu
@ 2020-07-21  8:36   ` Maxime Coquelin
  2020-07-21 14:51     ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Coquelin @ 2020-07-21  8:36 UTC (permalink / raw)
  To: patrick.fu, dev, chenbo.xia



On 7/21/20 5:23 AM, patrick.fu@intel.com wrote:
> From: Patrick Fu <patrick.fu@intel.com>
> 
> 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 <patrick.fu@intel.com>
> ---
> v2:
>   - change fixline number
> v3:
>  - revise commit message title
> 
>  lib/librte_vhost/virtio_net.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index 1d0be3dd4..235c31e28 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -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",
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check
  2020-07-21  8:36   ` Maxime Coquelin
@ 2020-07-21 14:51     ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2020-07-21 14:51 UTC (permalink / raw)
  To: Maxime Coquelin, patrick.fu, dev, chenbo.xia

On 7/21/2020 9:36 AM, Maxime Coquelin wrote:
> 
> 
> On 7/21/20 5:23 AM, patrick.fu@intel.com wrote:
>> From: Patrick Fu <patrick.fu@intel.com>
>>
>> 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 <patrick.fu@intel.com>
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-21 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14  6:00 [dpdk-dev] [PATCH v1] vhost: fix missing null dev pointer check patrick.fu
2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
2020-07-17  8:08   ` Xia, Chenbo
2020-07-17 13:10     ` Ferruh Yigit
2020-07-20 15:55   ` Maxime Coquelin
2020-07-20 16:49     ` Ferruh Yigit
2020-07-21  3:23 ` [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check patrick.fu
2020-07-21  8:36   ` Maxime Coquelin
2020-07-21 14:51     ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git