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 3FF18101B for ; Wed, 29 Mar 2017 09:48:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490773691; x=1522309691; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=rVgGEQ7Z/Ux7hOyuXt878F++BCzysSLOBYsfmfqPv9o=; b=WGfuniLNqF2wRP+HdX9SgwaiiWEgYrJzJcs71X9QoiFuZ3+xu38Mz19N Dlw96ehi7HXjvapAl/j5FBznMZY4gQ==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2017 00:48:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,240,1486454400"; d="scan'208";a="81793102" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.186]) ([10.239.67.186]) by fmsmga005.fm.intel.com with ESMTP; 29 Mar 2017 00:48:05 -0700 To: Yuanhan Liu References: <1488563803-87754-1-git-send-email-jianfeng.tan@intel.com> <1488563803-87754-4-git-send-email-jianfeng.tan@intel.com> <20170317065445.GH18844@yliu-dev.sh.intel.com> <20170329063301.GE18844@yliu-dev.sh.intel.com> <29d1e442-1c5b-6ba0-dbf1-9d35d36e37e1@intel.com> <20170329071423.GH18844@yliu-dev.sh.intel.com> Cc: "dev@dpdk.org" , "david.marchand@6wind.com" From: "Tan, Jianfeng" Message-ID: <006baeef-4167-edcf-407a-e149e01e8d65@intel.com> Date: Wed, 29 Mar 2017 15:48:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170329071423.GH18844@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 3/5] net/virtio-user: support to report net status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 07:48:11 -0000 On 3/29/2017 3:14 PM, Yuanhan Liu wrote: > On Wed, Mar 29, 2017 at 03:07:28PM +0800, Tan, Jianfeng wrote: >> >> On 3/29/2017 2:33 PM, Yuanhan Liu wrote: >>> On Mon, Mar 27, 2017 at 07:46:32AM +0000, Tan, Jianfeng wrote: >>>>>> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c >>>>> b/drivers/net/virtio/virtio_user/virtio_user_dev.c >>>>>> index 9777d6b..cc6f557 100644 >>>>>> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c >>>>>> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c >>>>>> @@ -176,6 +176,7 @@ virtio_user_start_device(struct virtio_user_dev >>>>> *dev, uint8_t portid) >>>>>> features &= ~(1ull << VIRTIO_NET_F_MAC); >>>>>> /* Strip VIRTIO_NET_F_CTRL_VQ, as devices do not really need to >>>>> know */ >>>>>> features &= ~(1ull << VIRTIO_NET_F_CTRL_VQ); >>>>>> + features &= ~(1ull << VIRTIO_NET_F_STATUS); >>>>>> ret = dev->ops->send_request(dev, VHOST_USER_SET_FEATURES, >>>>> &features); >>>>>> if (ret < 0) >>>>>> goto error; >>>>>> diff --git a/drivers/net/virtio/virtio_user_ethdev.c >>>>> b/drivers/net/virtio/virtio_user_ethdev.c >>>>>> index fa79419..fbdd0a8 100644 >>>>>> --- a/drivers/net/virtio/virtio_user_ethdev.c >>>>>> +++ b/drivers/net/virtio/virtio_user_ethdev.c >>>>>> @@ -121,7 +121,8 @@ virtio_user_get_features(struct virtio_hw *hw) >>>>>> struct virtio_user_dev *dev = virtio_user_get_dev(hw); >>>>>> >>>>>> /* unmask feature bits defined in vhost user protocol */ >>>>>> - return dev->device_features & >>>>> VIRTIO_PMD_SUPPORTED_GUEST_FEATURES; >>>>>> + return (dev->device_features | (1 << VIRTIO_NET_F_STATUS)) >>>>>> + & VIRTIO_PMD_SUPPORTED_GUEST_FEATURES; >>>>> Why not handle the features at virtio_user_dev_init()? >>>> You mean add VIRTIO_NET_F_STATUS when get_features from device? Yes, we could do that there. But we originally add device_features to only record features supported by device. >>>> >>> Aren't you adding the F_STATUS features to this device? >>> >> For virtio driver, yes, we are adding F_STATUS feature so the it sees a >> device supporting LSC. > That means you are adding a device feature (F_STATUS) and reporting it to > the driver that this feature is always on, no matter whether the device > actually supports it or not? This looks wrong to me. Why? IMO, device is not necessary to know this feature. For vhost-user, except explicitly cutting down the unix connection, I don't see a message of vhost-user protocol to report that. > >> But for backend driver, we need hide this feature, it >> happens when we set_features to the backend driver. > The feature negotion of virtio-user seems broken to me. > > Why? vhost does not claim to support this feature, VHOST_SUPPORTED_FEATURES. Thanks, Jianfeng