Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/42057/?format=api
http://patches.dpdk.org/api/patches/42057/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180702135642.52577-4-yong.liu@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20180702135642.52577-4-yong.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180702135642.52577-4-yong.liu@intel.com", "date": "2018-07-02T13:56:36", "name": "[v5,3/9] net/virtio-user: add unsupported features mask", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ba94ad0099db150dee2e50562f43fa3fd5ed3d73", "submitter": { "id": 17, "url": "http://patches.dpdk.org/api/people/17/?format=api", "name": "Marvin Liu", "email": "yong.liu@intel.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180702135642.52577-4-yong.liu@intel.com/mbox/", "series": [ { "id": 345, "url": "http://patches.dpdk.org/api/series/345/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=345", "date": "2018-07-02T13:56:33", "name": "support in-order feature", "version": 5, "mbox": "http://patches.dpdk.org/series/345/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/42057/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/42057/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F3C8D5323;\n\tMon, 2 Jul 2018 08:11:14 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 3EC78324B\n\tfor <dev@dpdk.org>; Mon, 2 Jul 2018 08:11:10 +0200 (CEST)", "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Jul 2018 23:11:09 -0700", "from dpdk-test32.sh.intel.com ([10.67.119.193])\n\tby orsmga005.jf.intel.com with ESMTP; 01 Jul 2018 23:11:08 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,298,1526367600\"; d=\"scan'208\";a=\"237141565\"", "From": "Marvin Liu <yong.liu@intel.com>", "To": "maxime.coquelin@redhat.com,\n\ttiwei.bie@intel.com", "Cc": "zhihong.wang@intel.com,\n\tdev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>", "Date": "Mon, 2 Jul 2018 21:56:36 +0800", "Message-Id": "<20180702135642.52577-4-yong.liu@intel.com>", "X-Mailer": "git-send-email 2.17.0", "In-Reply-To": "<20180702135642.52577-1-yong.liu@intel.com>", "References": "<20180702135642.52577-1-yong.liu@intel.com>", "Subject": "[dpdk-dev] [PATCH v5 3/9] net/virtio-user: add unsupported features\n\tmask", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch introduces unsupported features mask for virtio-user device.\nFor virtio-user server mode, when reconnecting virtio-user will retrieve\nvhost device features as base and then unmask unsupported features.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>", "diff": "diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 4322527f2..e0e956888 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -384,6 +384,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \tdev->queue_pairs = 1; /* mq disabled by default */\n \tdev->queue_size = queue_size;\n \tdev->mac_specified = 0;\n+\tdev->unsupported_features = 0;\n \tparse_mac(dev, mac);\n \n \tif (*ifname) {\n@@ -419,10 +420,12 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\tdev->device_features = VIRTIO_USER_SUPPORTED_FEATURES;\n \t}\n \n-\tif (dev->mac_specified)\n+\tif (dev->mac_specified) {\n \t\tdev->device_features |= (1ull << VIRTIO_NET_F_MAC);\n-\telse\n+\t} else {\n \t\tdev->device_features &= ~(1ull << VIRTIO_NET_F_MAC);\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_MAC);\n+\t}\n \n \tif (cq) {\n \t\t/* device does not really need to know anything about CQ,\n@@ -437,6 +440,14 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\tdev->device_features &= ~(1ull << VIRTIO_NET_F_GUEST_ANNOUNCE);\n \t\tdev->device_features &= ~(1ull << VIRTIO_NET_F_MQ);\n \t\tdev->device_features &= ~(1ull << VIRTIO_NET_F_CTRL_MAC_ADDR);\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_CTRL_RX);\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_CTRL_VLAN);\n+\t\tdev->unsupported_features |=\n+\t\t\t(1ull << VIRTIO_NET_F_GUEST_ANNOUNCE);\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_MQ);\n+\t\tdev->unsupported_features |=\n+\t\t\t(1ull << VIRTIO_NET_F_CTRL_MAC_ADDR);\n \t}\n \n \t/* The backend will not report this feature, we add it explicitly */\n@@ -444,6 +455,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t\tdev->device_features |= (1ull << VIRTIO_NET_F_STATUS);\n \n \tdev->device_features &= VIRTIO_USER_SUPPORTED_FEATURES;\n+\tdev->unsupported_features |= ~VIRTIO_USER_SUPPORTED_FEATURES;\n \n \tif (rte_mem_event_callback_register(VIRTIO_USER_MEM_EVENT_CLB_NAME,\n \t\t\t\tvirtio_user_mem_event_cb, dev)) {\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex d2d4cb825..c23ddfcc5 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -33,6 +33,7 @@ struct virtio_user_dev {\n \t\t\t\t * and will be sync with device\n \t\t\t\t */\n \tuint64_t\tdevice_features; /* supported features by device */\n+\tuint64_t\tunsupported_features; /* unsupported features mask */\n \tuint8_t\t\tstatus;\n \tuint16_t\tport_id;\n \tuint8_t\t\tmac_addr[ETHER_ADDR_LEN];\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 8747cbf94..08fa4bd47 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -30,7 +30,6 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)\n \tint ret;\n \tint flag;\n \tint connectfd;\n-\tuint64_t features = dev->device_features;\n \tstruct rte_eth_dev *eth_dev = &rte_eth_devices[dev->port_id];\n \n \tconnectfd = accept(dev->listenfd, NULL, NULL);\n@@ -45,15 +44,8 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)\n \t\treturn -1;\n \t}\n \n-\tfeatures &= ~dev->device_features;\n-\t/* For following bits, vhost-user doesn't really need to know */\n-\tfeatures &= ~(1ull << VIRTIO_NET_F_MAC);\n-\tfeatures &= ~(1ull << VIRTIO_NET_F_CTRL_VLAN);\n-\tfeatures &= ~(1ull << VIRTIO_NET_F_CTRL_MAC_ADDR);\n-\tfeatures &= ~(1ull << VIRTIO_NET_F_STATUS);\n-\tif (features)\n-\t\tPMD_INIT_LOG(ERR, \"WARNING: Some features 0x%\" PRIx64 \" are not supported by vhost-user!\",\n-\t\t\t features);\n+\t/* umask vhost-user unsupported features */\n+\tdev->device_features &= ~(dev->unsupported_features);\n \n \tdev->features &= dev->device_features;\n \n", "prefixes": [ "v5", "3/9" ] }{ "id": 42057, "url": "