From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5CB3A5B2C for ; Tue, 27 Jan 2015 09:05:50 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 27 Jan 2015 00:05:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,473,1418112000"; d="scan'208";a="643068147" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by orsmga001.jf.intel.com with ESMTP; 27 Jan 2015 00:05:48 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 27 Jan 2015 16:04:45 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.238]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.231]) with mapi id 14.03.0195.001; Tue, 27 Jan 2015 16:04:44 +0800 From: "Ouyang, Changchun" To: "Stephen Hemminger (stephen@networkplumber.org)" , "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 02/24] virtio: Use weaker barriers Thread-Index: AQHQOdoJdWUgQ6r9QU+K5JWgMpQyTJzTE7sAgACHBKA= Date: Tue, 27 Jan 2015 08:04:44 +0000 Message-ID: References: <1421298930-15210-1-git-send-email-changchun.ouyang@intel.com> <1422326164-13697-1-git-send-email-changchun.ouyang@intel.com> <1422326164-13697-3-git-send-email-changchun.ouyang@intel.com> In-Reply-To: Accept-Language: zh-CN, 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 v2 02/24] virtio: Use weaker barriers 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: Tue, 27 Jan 2015 08:05:51 -0000 Hi Stephen, Although it is original code logic,=20 But we can move vq_update_avail_idx(rxvq) into if block to resolve it. What do you think of it? Thanks Changchun -----Original Message----- From: Xie, Huawei=20 Sent: Tuesday, January 27, 2015 3:57 PM To: Ouyang, Changchun; dev@dpdk.org Cc: Stephen Hemminger (stephen@networkplumber.org) Subject: RE: [dpdk-dev] [PATCH v2 02/24] virtio: Use weaker barriers >-------if (likely(nb_enqueued)) { >------->-------virtio_wmb(); >------->-------if (unlikely(virtqueue_kick_prepare(rxvq))) { >------->------->-------virtqueue_notify(rxvq); >------->------->-------PMD_RX_LOG(DEBUG, "Notified\n"); >------->-------} >-------} >-------vq_update_avail_idx(rxvq); Two confuses for the modification here: 1. why notify host without updating avail idx? Will this cause potential deadlock? 2. Why update avail index even no packets are enqueued?