From patchwork Fri Mar 31 19:44:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianfeng Tan X-Patchwork-Id: 23090 X-Patchwork-Delegate: yuanhan.liu@linux.intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 264C437B3; Fri, 31 Mar 2017 21:47:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id F37233798 for ; Fri, 31 Mar 2017 21:44:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490989459; x=1522525459; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=5VzMybwlMiYUGyzuQk4D3KUq+RIAw9FN7fDBGUObcfY=; b=YSpuge/7cY+0ypdDKzLCnJg0ry66Z9YN462b6Wq3o8T5DUUtK0f0acxG Ri7VQdSCdWEj49lX5HoV4MJORh9vFw==; Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2017 12:44:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,253,1486454400"; d="scan'208";a="242579404" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by fmsmga004.fm.intel.com with ESMTP; 31 Mar 2017 12:44:17 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: yuanhan.liu@linux.intel.com, david.marchand@6wind.com, maxime.coquelin@redhat.com, Jianfeng Tan Date: Fri, 31 Mar 2017 19:44:57 +0000 Message-Id: <1490989498-87546-5-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490989498-87546-1-git-send-email-jianfeng.tan@intel.com> References: <1488563803-87754-1-git-send-email-jianfeng.tan@intel.com> <1490989498-87546-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-dev] [PATCH v3 4/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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Originally, we did not report support of VIRTIO_NET_F_STATUS. This feature is not reported by vhost backend, instead, it is added/removed by QEMU in virtio PCI case. We report the support of this feature so that following patch will depend on this feature to enable LSC interrupt. Signed-off-by: Jianfeng Tan --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 ++++ drivers/net/virtio/virtio_user_ethdev.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index ce4ead0..6e26df0 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -139,6 +139,7 @@ virtio_user_start_device(struct virtio_user_dev *dev) 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; @@ -356,6 +357,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, dev->device_features &= ~(1ull << VIRTIO_NET_F_CTRL_MAC_ADDR); } + /* The backend will not report this feature, we add it explicitly */ + dev->device_features |= (1ull << VIRTIO_NET_F_STATUS); + return 0; } diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 335d70d..e8b14e5 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -135,17 +135,17 @@ virtio_user_set_features(struct virtio_hw *hw, uint64_t 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; } static uint16_t