From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0072.outbound.protection.outlook.com [104.47.41.72]) by dpdk.org (Postfix) with ESMTP id D2BFD7D30; Fri, 2 Jun 2017 13:21:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fG7x4bwoOhuJTBFB+Z+wncU1rnkzmmfJWpnjPDq7k8Y=; b=dAjFPTro+leWm0OQrH9aTNp2cfStXRIZdNU2wnfML8oe0KdfxQm+lXyGqM+NAKYOj/MuhHWITRMDtg/oksEqs9HBn3WQmo7awHm7taCHhFrpIPpRSEqn+i/DKNJKPabsbYltte6uOgomwYj2I0TrwaOkZEvd2WtomD2tJGbzgck= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 2 Jun 2017 11:21:20 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, thomas@monjalon.net, cristian.dumitrescu@intel.com, yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com, Jerin Jacob , stable@dpdk.org Date: Fri, 2 Jun 2017 16:50:31 +0530 Message-Id: <20170602112031.9112-4-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170602112031.9112-1-jerin.jacob@caviumnetworks.com> References: <20170602112031.9112-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0087.INDPRD01.PROD.OUTLOOK.COM (10.174.56.27) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1714: X-MS-Office365-Filtering-Correlation-Id: ae2d0ced-24cb-49d4-3445-08d4a9a97fef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:dfBZbgDKy0VESLXDOwiTPRuu04UwjLhDjs9ec8nAeB1YZwq4wXfZju6EJoEM0qi1kvEsDozBJmdw4YryRQmOn0eBQOEyVQ7jXG8XKc2cV4QnlusUqcTLdh69fjdmMtU/+MudOTzGF0Ng5jaBTeTyFF6hf8Hj1Aq8t0JJbHnKts9z48xJzGp56XGRdr/IinobunnzCCku8PGwqFwNgEsrud0WRmj3Q+946d+a6volxlwL/cbDC+fa6ObDNXybI9LPSBAoCAtqdphH3zi4Mlg0HDBQTy65CMgKxcR0ZmlP8M2GDNEUmX+5MrV5BXiDNUrOwbM2GufgoPqRlfNbKPxvQQ==; 25:i8fS1nCGFSgB4rnUWTnAM1VlZalUsVM5DwGtkYWV6n3EmeVr8tRDQKNwXMgB+mgkZ6dibuiGwGbS/pGZLBPbHAiCYh7PexvPQ3CiJeZxHBh9tC8qkC6CbMuNft6i4PGLQ3mpc2R7/ZIUnU6GF23rkjTrscy7sR5JSaspwO/566LB2ygGZqBicaLpxiIL0OIMGyykQi1oYh3FKRQpCth69uiyZeciZfzbLUZm2e0WQF8pU/mpx2Lh8jVOIOrcu5pc4FX0aj2cQfAb0QbAJs1w7/EOhiyMQR40zBwiLxHIVxrrWQTasLHGZlqvdqzujin6YnXqRLCz3pf5qi2/YskUenIDDGH+H1JtI+2KcQjP31fM5jIk2+r/kXio3x7r6xaKYCoMlIE1q0FUzNMwEVG5eE12Vu4IzZI+xsqWLJXNMUYQzslbziRmFAH5cWqjRerTf6QCzFoZGTG2ctHk5THT7PRTz1u7XS0468vaRwGtJSw= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:05osapaasbtLODQUjweHTYT6f7au1dpRRjqbob5+STV//+h22zMBDzFi9fjRivPVbcLEkic30ILYwFcxRtf4dRDJLfWqwyEZiFlN8hAZdCYdN+epVs6ZN/FyLfib4dFL2+fksQ9kDWpwYq88eqcYnUcAe9l2cFffVkav8kggnRa9TVzcs2Dy1lxY25YNTiDk15eUgX+NS7aEm5wB9CtNsP/At92ZymfWf4tCSbTsPAM=; 20:/UCJLdxbcWPN55IanxlmRbaFv6KSXEho55U2XN01vBfYvqqC5FWQkBZZNJQ4IDUSkfzn4RC3fFlWSa4zTGDmHtyC5+x5WLRIXMMBn5G5zBAKtVchqE2ZS108yFdvzddfG18G70K/oki8HwNUpONUrsY28NcdKd5iAkRjjpa9mIMSIeicDkUO3my91S7fjp3dzBkS/q2zzgwrzVQsKa1zDxV6G/0UhY9w3klkaCd0zC/DL2EvV4irKM8zSkjQkVSWpkc2yzXV261lRExGoncU9uL5yK0TlatTfYSqXZ7kx6/Qga+1UqjauAutIgbWXPoYEleL+iGVQgHwIBirD2RCLivVrBLDy81HldB7dS5my2pDHy1QAld7G4GEVFLpXJZ5KZsZh5XURqZhZ7WN+BkHahY/yqlvss3WFqT756x1S/LNb3C/Dn6KNhMBmuNJOR1FC1D17M8isHuah8324ymqThQXkY3PDRSl2sKGEs3+X2y3tKs6iwEcvgiHyF01sgsrdfDLt9STmKqPJXFDi7vAev88Vet4APDPJdMZxpKkrLwbTKftkNa2REKwD3vCcUxXqs8kMyWne5/S6EzIs23oZ8vCB4ewxcFa8XNVG/zM3AM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(100000703101)(100105400095)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjA3MDFNQjE3MTQ7NDpmL2VLTUtrQWtmR3FiUDdjSFYrcnhjaVNM?= =?utf-8?B?L21xWjFobEo5QjF5VlB4QkRSWUUySWVIZHRiOVpUR3FjNmF3RkYwNEdyV1hJ?= =?utf-8?B?L2J4cUgzbWZJRTUzektEUG1uVFU2eVo0MGVwaVFBU3RUY2F3V083eWZaSXA3?= =?utf-8?B?Mm90YzE0UWlRd0xVdHU4d2VPR205bFY4clJkMWxpSG9sMUovdFlGWXAvK2Rt?= =?utf-8?B?bm0yOGJqNHBORWpjbEdRQklFZHYrQzMvelJra05qMjBxWktIVDN6RzBhd0Nv?= =?utf-8?B?bzk3RWdUOTFESlJmR2RJc29HMEtDaUpvZWUxNVRlM09VSWdCVlp5OWlIMVg0?= =?utf-8?B?STIyWC9hN2Zlb2hESVh0M0o0UWFXWk1xVS9ESCtwaHRmVmk0cWNUbWxqelVm?= =?utf-8?B?VGZzOW9PWTJFY0NLNCtyTFJwZ3IxK0hqdnZTc1JaMllDVisxQkJ1ZnV0d2E5?= =?utf-8?B?YURlSFRzWHk2dWVxQWREVUI3NnJNTHhlOGVtOVZwZkNET0M3WTZwNlMxdEw1?= =?utf-8?B?b2NMZ1RIZDVzVnQvRWs5dURQK2dpYjVTZ3dYZEQwbTNuelZIdzI0OEVEOFIx?= =?utf-8?B?aFV3ZUlhaEFxc3NLcUplalRISlUvT2ROTi9wektJanBBSW9hM1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YKeLniaE=3D?= X-Forefront-PRVS: 03264AEA72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(39840400002)(39450400003)(39410400002)(39400400002)(39850400002)(3846002)(1076002)(6512007)(6116002)(6486002)(53936002)(23676002)(53416004)(2351001)(305945005)(50986999)(4326008)(5009440100003)(7736002)(2361001)(5660300001)(33646002)(38730400002)(189998001)(6506006)(50226002)(110136004)(76176999)(42186005)(2870700001)(81166006)(72206003)(8676002)(47776003)(2950100002)(36756003)(66066001)(6916009)(6666003)(42882006)(478600001)(25786009)(50466002)(2906002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:jerin.caveonetworks.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjA3MDFNQjE3MTQ7MjM6UzBQc01DSFpza1JuUkZHalBZZnl4cm14?= =?utf-8?B?SEJXZUhxeHBvWXh4cFBESUQ4c0JMcndWa0tqaU5kZ3RyKzl6SnhkUjlrRTVw?= =?utf-8?B?ZjRUOWY1aWVPZm93MlhxOHoyR0thSHkvTlkxM2ZvWWIwY3JWczhvb0xjLzla?= =?utf-8?B?K215UVpuVXFGWHdjbElhYzZGTnlaQWdTcHVxbEM0RmR1RWR4VmtDNHpSQnVB?= =?utf-8?B?RmEzQjhpUk4vVDlPbHJ3c0I4aU9wc1pOYTdGWU93dU0yYjF4dXZ4MWhBdzIx?= =?utf-8?B?TWd1U3ZYb3lSbE1kNkdlT2lLb1JBRE9NMC9WT2tuSkovN0tNb1FXVER6Ykda?= =?utf-8?B?SGJnMG5SbWJYSjZiTldkN24vNU1ZNWRnRDBLbHA4bk1MVW9aUUxIQndqaUw2?= =?utf-8?B?TWJJb1RURHFVR2xYVnAvZkk1VTNHSnJmbHlGQ0pVQWw5Q3ZqbmxpZGFxd1Mz?= =?utf-8?B?L3ZUWl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phXYfCy04/23q80amwko9ML+aQ5OSTBmh2XreAQW7iQakWsHACAgDu70rvXsu5o4m0W2gcfbCdsvALsgyjiEPIYz5bEr2DRurQnSlVW45SWw1qBPYdDL5RC8Hw2f0dbzlbONVyuhgfTiYthWWRNhgYLLQ6xC7hd/oAgXAWvd8551uapXqexlbyjTGD67nKhXbSNlGmfCIvjeNXUaItVEJkVJJE7rtr3gitr1s5MYMK5dH5hkt/Jtdi/aqgl62DN+lmAySvlt4v0LR2CIZ7V5GVPC1kyrY1UXaI6WFNUnaEZi8uG7zGFxLhtKjXwyVs0x2nXpQW6FXKnQMv27PR4yvk9443lun4SYzL7KkpxDV3ADLs9PVyNNXGhENQCrggQkovXd7SHru4TfrsgRYpg4Vy6rdzmeZFIi3wuLlmvsJH3l0ur4GiUd0AW1EnOCPrAd5Xez; 24:N19FUSMYiUhbbmuG2Fsjs55QpoNVxhFluAS4NEFXjqsRz8P3/veB/bYbL0azZaesJ7+wpXME43Im6WqeYgzFU2bJB/7FKfizghlfurmoLjQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:cICpM4ofyBbTw08k2tGvYHdetWf4ZhPNcO6BBHC3mNoWb6LS2EpBAYYbzw99QKe9JSnmiUjW9n2i07FWI+4DdC/Zm09XapAmrcVbeeZLUOs4C2a7I/cmq6/TNVs+TKNpwcpkVXi2Uiw8ZtUTig5cYoM8kGXcjS+ueiQeT3szZhZzGVWpNM/9RsuMHIzpNU3ZnVaG/u7UpvA0RJD1UK4hCL5Sj2dR22XoRlGahaDpXTpmwLA/24Jwjf/eRD8IRf4v7pqK88IJgpRegIO7btq4xodhtLkzf8CCZzltEkTsBgavFTX5FvobHmPeOtsDO7Ci/SKuY0OtGnvvbTSw5AmVfw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2017 11:21:20.1562 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH 4/4] examples/vhost: fix uninitialized desc indexes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 11:21:25 -0000 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") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob --- 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 cc2c3d882..5e1ed44a5 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.13.0