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 CAC7A9E7 for ; Wed, 6 Apr 2016 11:37:57 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 06 Apr 2016 02:37:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,447,1455004800"; d="scan'208";a="926540043" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga001.jf.intel.com with ESMTP; 06 Apr 2016 02:37:56 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX107.ger.corp.intel.com (163.33.3.99) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 6 Apr 2016 10:37:53 +0100 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.172]) by irsmsx155.ger.corp.intel.com ([169.254.14.201]) with mapi id 14.03.0248.002; Wed, 6 Apr 2016 10:37:53 +0100 From: "Loftus, Ciara" To: Yuanhan Liu , Tetsuya Mukawa CC: "dev@dpdk.org" , "Tan, Jianfeng" Thread-Topic: [PATCH] vhost: Fix retrieval of numa information in PMD Thread-Index: AQHRj9CFKMbVaXOClUKEPXMpnsrQwp98eHoAgAA2nVA= Date: Wed, 6 Apr 2016 09:37:53 +0000 Message-ID: <74F120C019F4A64C9B78E802F6AD4CC24F861D10@IRSMSX106.ger.corp.intel.com> References: <1459872587-11655-1-git-send-email-ciara.loftus@intel.com> <5704B175.3040700@igel.co.jp> <20160406071754.GY3080@yliu-dev.sh.intel.com> In-Reply-To: <20160406071754.GY3080@yliu-dev.sh.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWNmZTI4M2YtMmI4MC00ZGI2LTg0MjEtZmNlYTQwMDJjN2M3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik1EWTcxa0VUVlI0d1dLYmhnNVJXcDVWVDMzSXo0WnVOcUltOUJCSytXd0E9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: Fix retrieval of numa information in PMD 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: Wed, 06 Apr 2016 09:37:58 -0000 >=20 > On Wed, Apr 06, 2016 at 03:49:25PM +0900, Tetsuya Mukawa wrote: > > On 2016/04/06 1:09, Ciara Loftus wrote: > > > After some testing, it was found that retrieving numa information > > > about a vhost device via a call to get_mempolicy is more > > > accurate when performed during the new_device callback versus > > > the vring_state_changed callback, in particular upon initial boot > > > of the VM. Performing this check during new_device is also > > > potentially more efficient as this callback is only triggered once > > > during device initialisation, compared with vring_state_changed > > > which may be called multiple times depending on the number of > > > queues assigned to the device. > > > > > > Reorganise the code to perform this check and assign the correct > > > socket_id to the device during the new_device callback. > > > > > > Signed-off-by: Ciara Loftus > > > --- > > > drivers/net/vhost/rte_eth_vhost.c | 28 ++++++++++++++-------------- > > > 1 file changed, 14 insertions(+), 14 deletions(-) > > > > > > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > > > index 4cc6bec..b1eb082 100644 > > > --- a/drivers/net/vhost/rte_eth_vhost.c > > > +++ b/drivers/net/vhost/rte_eth_vhost.c > > > > > > > Hi, > > > > I appreciate fixing it. > > Just one worry is that state changed event may be occurred before new > > device event. > > The users should not call rte_eth_dev_socket_id() until new device even= t > > comes, even if they catch queue state events. > > Otherwise, they will get wrong socket id to call > > rte_eth_rx/tx_queue_setup(). >=20 > There is no way to guarantee that the socket id stuff would work > perfectly in vhost, right? I mean, it's likely that virtio device > would allocate memory from 2 or more sockets. >=20 > So, it doesn't matter too much whether it's set perfectly right > or not. Instead, we should assign it with a saner value instead > of a obvious wrong one when new_device() is not invoked yet. So, > I'd suggest to make an assignment first based on vhost_dev (or > whatever) struct, and then make it "right" at new_device() > callback? Thanks for the feedback. At the moment with this patch numa_node is initially set to rte_socket_id()= during pmd init and then updated to the correct value during new_device. Are you suggesting we set it again in between these two steps ("based on vh= ost_dev")? If so where do you think would be a good place? Thanks, Ciara >=20 > > So how about commenting it in 'rte_eth_vhost.h'? >=20 > It asks a different usage than other PMDs, which I don't think > it's a good idea. >=20 > --yliu