From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by dpdk.org (Postfix) with ESMTP id DBFB12C64 for ; Wed, 6 Apr 2016 09:28:28 +0200 (CEST) Received: by mail-pf0-f180.google.com with SMTP id e128so28004746pfe.3 for ; Wed, 06 Apr 2016 00:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=HaIZ6pOyrI0HSTroM0FOKy/psiHqGowX5XM8+KU+/6Q=; b=xR1ed7voFXBzN1UC+qUW5Wb2cP138MwNHcfsUDa45lr9C57EQprcslJGKLvA1XvGxD DNPJzQVKGCY6fcfPvbv8dvPA2OEnnfVfqA1W7wiQvoX8xHelvq/+B518FnlAVHGmo3+q XQRU/AT636V39MjChix2UWbzGSTUc/T+9sePyyw3CQEkVAxccckzHpVkA0sbyszrBY0N b1V5CrP+C34heHCG+Fn5TUf1g885aoF4JWOenaJ7YV0fCMgN4a07W0D0YPRWXgoliN6G X3PNbOJYdZKpcPgarKlwIUP8OtJrdKIlj0o4ZVoGsJSD0NU3yEutpyEqLCEAnd9h4sif DI+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HaIZ6pOyrI0HSTroM0FOKy/psiHqGowX5XM8+KU+/6Q=; b=B0v8Elnbl8M3nE3rq2j7SaVFajTdEUvGuAKIME5REhW2/gGWIgsXgQlYPsHKM5iM0U JsEMaYbgFZIQk2XTDxvbFHkVexmInG2n0FhUEHhQLUGUhx1AtUHi8rV6LFy8HV65Jhlu ZzwtdmaMaX4/6q03a10o503z9Zg0yfA5D0+RJSTUL7OHN0cHDvtdSB2h+11E13gJWGgl eU8PoifWdCNzY2aVcYxhsogEKQPyBKqprHhf4RQiE/C66uZYb8uguB0aQDW0ty7nKolo UzvVJPdz0B0WCq5pbUri4Wiz3ZSIgnjd/kiN2TBGBxBfTje7SaRXtYZCnI9Lz13F8Ci2 Alqg== X-Gm-Message-State: AD7BkJIrCyfIIkk2bVXxPvM1t6DSOZ19P41o7f2RYG8pQG3IpDeVx3RPd9Q/smfZ/YpMnw== X-Received: by 10.98.70.67 with SMTP id t64mr36240791pfa.110.1459927707710; Wed, 06 Apr 2016 00:28:27 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id xs10sm2455587pab.4.2016.04.06.00.28.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2016 00:28:27 -0700 (PDT) To: Yuanhan Liu References: <1459872587-11655-1-git-send-email-ciara.loftus@intel.com> <5704B175.3040700@igel.co.jp> <20160406071754.GY3080@yliu-dev.sh.intel.com> Cc: Ciara Loftus , dev@dpdk.org, "Tan, Jianfeng" From: Tetsuya Mukawa Message-ID: <5704BA99.4050308@igel.co.jp> Date: Wed, 6 Apr 2016 16:28:25 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160406071754.GY3080@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 07:28:29 -0000 On 2016/04/06 16:17, Yuanhan Liu wrote: > 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 event >> comes, even if they catch queue state events. >> Otherwise, they will get wrong socket id to call >> rte_eth_rx/tx_queue_setup(). > 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. > > 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? Yes, I agree with you idea. Thanks, Tetsuya >> So how about commenting it in 'rte_eth_vhost.h'? > It asks a different usage than other PMDs, which I don't think > it's a good idea. > > --yliu