From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by dpdk.org (Postfix) with ESMTP id B5CF22C8 for ; Tue, 20 Jun 2017 13:36:19 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id d5so22245198pfe.1 for ; Tue, 20 Jun 2017 04:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aa5qNhFqv3z5CDJuYVqBXbEO+kjOQF4IhgJPvggbBuA=; b=t+9dYD97yoYdf4pENBe1KVt/zJfWlnB804UJj/y8R4UIuWuiJFomr0pZ0pc2IZ2e78 YXkiz42yJwCU5nXy6FLOgZGUADQfwproTMGl6T6g1wZ2zrVl0X820fwDZdZNLnMjy6KC 8FFZFQeNs2kCXwekFENEM3iw6Aa18Vz67Q/hPsRW6v6FSFpeXWUEyYKkIXrJDiw2AvM4 yySdjvS9FGVIkO2bM/506r3HCDdsUcNQH2lbPimsJ4d2UlgcjzSYVam7d1wVWssfU8/6 yjsSfCTkj+jny0ukn/dvNCCHbUPW1npgNADE5dxua1aY3mkUAowbN+pp573/zJ1ix9x6 Vj8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aa5qNhFqv3z5CDJuYVqBXbEO+kjOQF4IhgJPvggbBuA=; b=lEW9DpAnxuEqHSbOvAUWhd0tRzL543H6tfc43Ep9pDQo+w1zxun4GUFv2Q40N9xMsp K45K694Gr47lMP1HRMWyxMpLICepx+We+pskmDcRVB/80IWYFz9jCA5bLb958vYi3W+1 c30kILyBMT9EMceXU39pOfL7lUERU5X9L9pJdcSALnK/DUVKuB41KipMQdDPIcrhKcDj ODuN24rZSQ/YhFiZ4VxVa/O4bHDV+9Jt8pdk4I0+nudQy7KV9OFX4nTEh3S8TT8rBA7+ xw+IdjQULtzhIwlltBPMlOG1dJ0UT3SUdn2O6xi1nXMCUo/3hnRNJRBPcDayVTXL4ic0 co/w== X-Gm-Message-State: AKS2vOy49797Atpw7WRI6xvT4NWFk3sZY8MvnKkRz99Z4HefDSCqkHA8 0oEB/oa98hcYUC6Dwr8+tw== X-Received: by 10.98.218.65 with SMTP id w1mr30134507pfl.234.1497958578983; Tue, 20 Jun 2017 04:36:18 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.36.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:36:17 -0700 (PDT) From: Yuanhan Liu To: Jerin Jacob Cc: Maxime Coquelin , dpdk stable Date: Tue, 20 Jun 2017 19:35:13 +0800 Message-Id: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/vhost: fix uninitialized descriptor indexes' has been queued to stable release 17.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 11:36:20 -0000 Hi, FYI, your patch has been queued to stable release 17.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/22/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 8dccb2094bb42b56d42df0071f848b32c500321d Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Fri, 2 Jun 2017 16:50:31 +0530 Subject: [PATCH] examples/vhost: fix uninitialized descriptor indexes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 62a0e941b5000fec02dc3bd3efed092b809ce570 ] Fixing the below error by returning from the function early when count == 0. Issue flagged by GCC 7.1.1 examples/vhost/virtio_net.c:370:38: error: ‘desc_indexes[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] rte_prefetch0(&vr->desc[desc_indexes[0]]); Fixes: ca059fa5e290 ("examples/vhost: demonstrate the new generic APIs") Signed-off-by: Jerin Jacob Reviewed-by: Maxime Coquelin --- examples/vhost/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c index cc2c3d8..5e1ed44 100644 --- a/examples/vhost/virtio_net.c +++ b/examples/vhost/virtio_net.c @@ -350,6 +350,9 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, count = RTE_MIN(count, MAX_PKT_BURST); count = RTE_MIN(count, free_entries); + if (unlikely(count == 0)) + return 0; + /* * Retrieve all of the head indexes first and pre-update used entries * to avoid caching issues. @@ -385,8 +388,6 @@ vs_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id, } } - if (!i) - return 0; queue->last_avail_idx += i; queue->last_used_idx += i; -- 2.7.4