DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: slot_idx needs to be initialised to fix gcc compile error
@ 2020-11-04 17:02 Conor Walsh
  2020-11-04 17:05 ` Maxime Coquelin
  0 siblings, 1 reply; 2+ messages in thread
From: Conor Walsh @ 2020-11-04 17:02 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, linglix.chen, Conor Walsh

When DPDK is compiled with gcc < 9 with the optimization level set to 1
gcc sees slot_idx as possibly being uninitialised. To correct this error
slot_idx has been initialised to 0.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 lib/librte_vhost/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index 3a019b7446..bef39180b5 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -1491,7 +1491,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,
 	struct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1);
 	struct rte_vhost_iov_iter *src_it = it_pool;
 	struct rte_vhost_iov_iter *dst_it = it_pool + 1;
-	uint16_t n_free_slot, slot_idx;
+	uint16_t n_free_slot, slot_idx = 0;
 	uint16_t pkt_err = 0;
 	uint16_t segs_await = 0;
 	struct async_inflight_info *pkts_info = vq->async_pkts_info;
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH v1] vhost: slot_idx needs to be initialised to fix gcc compile error
  2020-11-04 17:02 [dpdk-dev] [PATCH v1] vhost: slot_idx needs to be initialised to fix gcc compile error Conor Walsh
@ 2020-11-04 17:05 ` Maxime Coquelin
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2020-11-04 17:05 UTC (permalink / raw)
  To: Conor Walsh, chenbo.xia; +Cc: dev, linglix.chen

Hi Conor,

On 11/4/20 6:02 PM, Conor Walsh wrote:
> When DPDK is compiled with gcc < 9 with the optimization level set to 1
> gcc sees slot_idx as possibly being uninitialised. To correct this error
> slot_idx has been initialised to 0.
> 
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> ---
>  lib/librte_vhost/virtio_net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index 3a019b7446..bef39180b5 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -1491,7 +1491,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,
>  	struct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1);
>  	struct rte_vhost_iov_iter *src_it = it_pool;
>  	struct rte_vhost_iov_iter *dst_it = it_pool + 1;
> -	uint16_t n_free_slot, slot_idx;
> +	uint16_t n_free_slot, slot_idx = 0;
>  	uint16_t pkt_err = 0;
>  	uint16_t segs_await = 0;
>  	struct async_inflight_info *pkts_info = vq->async_pkts_info;
> 


Same patch has already been submitted and merged:
https://patches.dpdk.org/patch/82281/

Thanks,
Maxime


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

end of thread, other threads:[~2020-11-04 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 17:02 [dpdk-dev] [PATCH v1] vhost: slot_idx needs to be initialised to fix gcc compile error Conor Walsh
2020-11-04 17:05 ` Maxime Coquelin

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