From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05598A0A0E; Wed, 3 Feb 2021 10:54:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81A6E2404A5; Wed, 3 Feb 2021 10:54:27 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id CE19F2404A1 for ; Wed, 3 Feb 2021 10:54:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612346064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ivJjlWFjckTCpnqNn//iuct8Ag1vUAFeJdLwCHKqaUg=; b=UuOt4V2E39JQCGarncHcoGCXvLaZXEwf5DWKDcHt1JAGNqiMuaY2sdCKMN/GlqWgLWJh5Y Ft+4mFrKXtWU29fZqp0aCAKDZQ7z+CZ39KkCjQfkMidBG8N8FPzFkI7utJ2cILdX3gVr38 rBuCawwdS4PJqYhX0tuS1l1y2CcEL/4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-kehtEN4BMvmP-2vFh3fkLA-1; Wed, 03 Feb 2021 04:54:21 -0500 X-MC-Unique: kehtEN4BMvmP-2vFh3fkLA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B21E7801817; Wed, 3 Feb 2021 09:54:19 +0000 (UTC) Received: from [10.36.110.4] (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E4A9100AE2E; Wed, 3 Feb 2021 09:54:18 +0000 (UTC) To: Cheng Jiang , chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yvonnex.yang@intel.com References: <20210202062830.4490-1-Cheng1.jiang@intel.com> <20210202072421.15890-1-Cheng1.jiang@intel.com> From: Maxime Coquelin Message-ID: Date: Wed, 3 Feb 2021 10:54:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210202072421.15890-1-Cheng1.jiang@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] examples/vhost: fix potentially overflowing expression X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2/2/21 8:24 AM, Cheng Jiang wrote: > Change the type of buff_idx from uint64_t to uint32_t to fix coverity > issue. > > Coverity issue: 366264 > Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path") > > Signed-off-by: Cheng Jiang > --- > v2: fixed the format of git log > > examples/vhost/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index 233a2dc6e..e74fc8750 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -864,7 +864,7 @@ static __rte_always_inline void > drain_vhost(struct vhost_dev *vdev) > { > uint16_t ret; > - uint64_t buff_idx = rte_lcore_id() * MAX_VHOST_DEVICE + vdev->vid; > + uint32_t buff_idx = rte_lcore_id() * MAX_VHOST_DEVICE + vdev->vid; > uint16_t nr_xmit = vhost_txbuff[buff_idx]->len; > struct rte_mbuf **m = vhost_txbuff[buff_idx]->m_table; > > -- > 2.29.2 > Reviewed-by: Maxime Coquelin Thanks, Maxime