From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 71BCCCE7 for ; Mon, 21 Sep 2015 11:19:31 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 21 Sep 2015 02:19:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,567,1437462000"; d="scan'208";a="809219033" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga002.jf.intel.com with ESMTP; 21 Sep 2015 02:19:29 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Sep 2015 17:19:22 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.210]) with mapi id 14.03.0248.002; Mon, 21 Sep 2015 17:19:20 +0800 From: "Tan, Jianfeng" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] virtio: fix used ring address calculation Thread-Index: AQHQ9B8tBXr+RRaDREG9FZkrO1QXD55GtIVw Date: Mon, 21 Sep 2015 09:19:19 +0000 Message-ID: References: <1442806742-32547-1-git-send-email-huawei.xie@intel.com> In-Reply-To: <1442806742-32547-1-git-send-email-huawei.xie@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] virtio: fix used ring address calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2015 09:19:31 -0000 -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie Sent: Monday, September 21, 2015 11:39 AM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH] virtio: fix used ring address calculation used event idx is put at the end of available ring. It isn't taken into acc= ount when we calculate the address of used ring. Fortunately, it doesn't in= troduce the bug with fixed queue number 256 and 4KB alignment. Signed-off-by: hxie5 --- drivers/net/virtio/virtio_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_r= ing.h index a16c499..92e430d 100644 --- a/drivers/net/virtio/virtio_ring.h +++ b/drivers/net/virtio/virtio_ring.h @@ -145,7 +145,7 @@ vring_init(struct vring *vr, unsigned int num, uint8_t = *p, vr->avail =3D (struct vring_avail *) (p + num * sizeof(struct vring_desc)); vr->used =3D (void *) - RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align); + RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num + 1]), align); } =20 /* -- Acked-by: Jianfeng Tan 1.9.3