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 3F9803B5 for ; Fri, 17 Mar 2017 07:56:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489733792; x=1521269792; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=c3zVaraO1hY1+hdecMaz4oK2gS/l3DYwMtkx7vWVsFE=; b=hXoHVVIcUlIMwg7+/IFsVRuKaS8RuUT/YSyl2thAIm3PjNXxAOxapxIK 3jpLitvdpfPzxkROfad+cXJa19a/wQ==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2017 23:56:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,176,1486454400"; d="scan'208";a="1109455036" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 16 Mar 2017 23:56:30 -0700 Date: Fri, 17 Mar 2017 14:54:45 +0800 From: Yuanhan Liu To: Jianfeng Tan Cc: dev@dpdk.org, david.marchand@6wind.com Message-ID: <20170317065445.GH18844@yliu-dev.sh.intel.com> References: <1488563803-87754-1-git-send-email-jianfeng.tan@intel.com> <1488563803-87754-4-git-send-email-jianfeng.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488563803-87754-4-git-send-email-jianfeng.tan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Fri, 17 Mar 2017 06:56:32 -0000 On Fri, Mar 03, 2017 at 05:56:41PM +0000, Jianfeng Tan wrote: > Signed-off-by: Jianfeng Tan Yet again, not a single work on explanation. > --- > drivers/net/virtio/virtio_user/virtio_user_dev.c | 1 + > drivers/net/virtio/virtio_user_ethdev.c | 13 +++++++------ > 2 files changed, 8 insertions(+), 6 deletions(-) > > 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()? > } > > static void > @@ -129,23 +130,23 @@ virtio_user_set_features(struct virtio_hw *hw, uint64_t features) > { > struct virtio_user_dev *dev = virtio_user_get_dev(hw); > > - dev->features = features & dev->device_features; > + dev->features = features; > } > > static uint8_t > virtio_user_get_isr(struct virtio_hw *hw __rte_unused) > { > - /* When config interrupt happens, driver calls this function to query > - * what kinds of change happen. Interrupt mode not supported for now. > + /* rxq interrupts and config interrupt are separated in virtio-user, > + * here we only report config change. > */ > - return 0; > + return VIRTIO_PCI_ISR_CONFIG; > } > > static uint16_t > virtio_user_set_config_irq(struct virtio_hw *hw __rte_unused, > uint16_t vec __rte_unused) > { > - return VIRTIO_MSI_NO_VECTOR; > + return 0; And the above two changes have something to do with this patch (support to report net statu)? --yliu