Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/87309/?format=api
https://patches.dpdk.org/api/patches/87309/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210126101639.250481-22-maxime.coquelin@redhat.com/", "project": { "id": 1, "url": "https://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": "<20210126101639.250481-22-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210126101639.250481-22-maxime.coquelin@redhat.com", "date": "2021-01-26T10:16:16", "name": "[v4,21/44] net/virtio: move config definitions to generic header", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "275f76834123b289bf383029b929c78eb1b3f331", "submitter": { "id": 512, "url": "https://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.com" }, "delegate": { "id": 2642, "url": "https://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210126101639.250481-22-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 14950, "url": "https://patches.dpdk.org/api/series/14950/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14950", "date": "2021-01-26T10:15:55", "name": "net/virtio: Virtio PMD rework", "version": 4, "mbox": "https://patches.dpdk.org/series/14950/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/87309/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/87309/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CE179A052A;\n\tTue, 26 Jan 2021 11:20:25 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6AE291413A0;\n\tTue, 26 Jan 2021 11:17:54 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by mails.dpdk.org (Postfix) with ESMTP id 3B7AA1413A0\n for <dev@dpdk.org>; Tue, 26 Jan 2021 11:17:53 +0100 (CET)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-187-MiyrVk3iOeWKXVri0euq8Q-1; Tue, 26 Jan 2021 05:17:50 -0500", "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com\n [10.5.11.11])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 99144107ACFB;\n Tue, 26 Jan 2021 10:17:49 +0000 (UTC)", "from max-t490s.redhat.com (unknown [10.36.110.31])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 4BE746F45C;\n Tue, 26 Jan 2021 10:17:42 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1611656272;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=oAICAsBAhqQpIth2c0h/vGYXliV6MyVhcdKj02oXqDk=;\n b=Wsqm9WrI0LSx8LBAjB2i2k2gFizZhx9U2xlhmyn5ip+mOCptbh2jlLWYfSaT5dh2muIORm\n pnSARKOn/5cLvrWjVV1ZyL1eFs+JK/TxwaLgXX+WYn+7x90TN8SAlGW9tgBpWd7ByqL2nz\n ZZSNlc6X8k2zctjdNE4gX0r4fua8Nko=", "X-MC-Unique": "MiyrVk3iOeWKXVri0euq8Q-1", "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com,\n amorenoz@redhat.com, david.marchand@redhat.com", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Tue, 26 Jan 2021 11:16:16 +0100", "Message-Id": "<20210126101639.250481-22-maxime.coquelin@redhat.com>", "In-Reply-To": "<20210126101639.250481-1-maxime.coquelin@redhat.com>", "References": "<20210126101639.250481-1-maxime.coquelin@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11", "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"", "Subject": "[dpdk-dev] [PATCH v4 21/44] net/virtio: move config definitions to\n generic header", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch moves config and status definitions from the PCI\nheader to the generic one.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n drivers/net/virtio/virtio.c | 43 +++++++++++++++++++\n drivers/net/virtio/virtio.h | 50 ++++++++++++++++++++++\n drivers/net/virtio/virtio_ethdev.c | 36 ++++++++--------\n drivers/net/virtio/virtio_pci.c | 44 --------------------\n drivers/net/virtio/virtio_pci.h | 55 -------------------------\n drivers/net/virtio/virtio_user_ethdev.c | 10 ++---\n 6 files changed, 116 insertions(+), 122 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio.c b/drivers/net/virtio/virtio.c\nindex d8d6bf7add..ba3203e68b 100644\n--- a/drivers/net/virtio/virtio.c\n+++ b/drivers/net/virtio/virtio.c\n@@ -20,3 +20,46 @@ virtio_negotiate_features(struct virtio_hw *hw, uint64_t host_features)\n \treturn features;\n }\n \n+\n+void\n+virtio_read_dev_config(struct virtio_hw *hw, size_t offset,\n+\t\t void *dst, int length)\n+{\n+\tVIRTIO_OPS(hw)->read_dev_cfg(hw, offset, dst, length);\n+}\n+\n+void\n+virtio_write_dev_config(struct virtio_hw *hw, size_t offset,\n+\t\t const void *src, int length)\n+{\n+\tVIRTIO_OPS(hw)->write_dev_cfg(hw, offset, src, length);\n+}\n+\n+void\n+virtio_reset(struct virtio_hw *hw)\n+{\n+\tVIRTIO_OPS(hw)->set_status(hw, VIRTIO_CONFIG_STATUS_RESET);\n+\t/* flush status write */\n+\tVIRTIO_OPS(hw)->get_status(hw);\n+}\n+\n+void\n+virtio_reinit_complete(struct virtio_hw *hw)\n+{\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER_OK);\n+}\n+\n+void\n+virtio_set_status(struct virtio_hw *hw, uint8_t status)\n+{\n+\tif (status != VIRTIO_CONFIG_STATUS_RESET)\n+\t\tstatus |= VIRTIO_OPS(hw)->get_status(hw);\n+\n+\tVIRTIO_OPS(hw)->set_status(hw, status);\n+}\n+\n+uint8_t\n+virtio_get_status(struct virtio_hw *hw)\n+{\n+\treturn VIRTIO_OPS(hw)->get_status(hw);\n+}\ndiff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h\nindex 0c2b3525d5..0ac5328c57 100644\n--- a/drivers/net/virtio/virtio.h\n+++ b/drivers/net/virtio/virtio.h\n@@ -106,6 +106,50 @@\n #define VIRTIO_MAX_VIRTQUEUE_PAIRS 8\n #define VIRTIO_MAX_VIRTQUEUES (VIRTIO_MAX_VIRTQUEUE_PAIRS * 2 + 1)\n \n+/* VirtIO device IDs. */\n+#define VIRTIO_ID_NETWORK 0x01\n+#define VIRTIO_ID_BLOCK 0x02\n+#define VIRTIO_ID_CONSOLE 0x03\n+#define VIRTIO_ID_ENTROPY 0x04\n+#define VIRTIO_ID_BALLOON 0x05\n+#define VIRTIO_ID_IOMEMORY 0x06\n+#define VIRTIO_ID_9P 0x09\n+\n+/* Status byte for guest to report progress. */\n+#define VIRTIO_CONFIG_STATUS_RESET\t\t0x00\n+#define VIRTIO_CONFIG_STATUS_ACK\t\t0x01\n+#define VIRTIO_CONFIG_STATUS_DRIVER\t\t0x02\n+#define VIRTIO_CONFIG_STATUS_DRIVER_OK\t\t0x04\n+#define VIRTIO_CONFIG_STATUS_FEATURES_OK\t0x08\n+#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET\t0x40\n+#define VIRTIO_CONFIG_STATUS_FAILED\t\t0x80\n+\n+/*\n+ * This structure is just a reference to read net device specific\n+ * config space; it is just a shadow structure.\n+ *\n+ */\n+struct virtio_net_config {\n+\t/* The config defining mac address (if VIRTIO_NET_F_MAC) */\n+\tuint8_t mac[RTE_ETHER_ADDR_LEN];\n+\t/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */\n+\tuint16_t status;\n+\tuint16_t max_virtqueue_pairs;\n+\tuint16_t mtu;\n+\t/*\n+\t * speed, in units of 1Mb. All values 0 to INT_MAX are legal.\n+\t * Any other value stands for unknown.\n+\t */\n+\tuint32_t speed;\n+\t/*\n+\t * 0x00 - half duplex\n+\t * 0x01 - full duplex\n+\t * Any other value stands for unknown.\n+\t */\n+\tuint8_t duplex;\n+\n+} __rte_packed;\n+\n struct virtio_hw {\n \tstruct virtqueue **vqs;\n \tuint64_t guest_features;\n@@ -182,5 +226,11 @@ virtio_with_packed_queue(struct virtio_hw *hw)\n }\n \n uint64_t virtio_negotiate_features(struct virtio_hw *hw, uint64_t host_features);\n+uint8_t virtio_get_status(struct virtio_hw *hw);\n+void virtio_set_status(struct virtio_hw *hw, uint8_t status);\n+void virtio_write_dev_config(struct virtio_hw *hw, size_t offset, const void *src, int length);\n+void virtio_read_dev_config(struct virtio_hw *hw, size_t offset, void *dst, int length);\n+void virtio_reset(struct virtio_hw *hw);\n+void virtio_reinit_complete(struct virtio_hw *hw);\n \n #endif /* _VIRTIO_H_ */\ndiff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 1771844fe7..dfd8d29f60 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -714,7 +714,7 @@ virtio_dev_close(struct rte_eth_dev *dev)\n \t\tdev->intr_handle->intr_vec = NULL;\n \t}\n \n-\tvtpci_reset(hw);\n+\tvirtio_reset(hw);\n \tvirtio_dev_free_mbufs(dev);\n \tvirtio_free_queues(hw);\n \n@@ -1096,7 +1096,7 @@ virtio_dev_stats_reset(struct rte_eth_dev *dev)\n static void\n virtio_set_hwaddr(struct virtio_hw *hw)\n {\n-\tvtpci_write_dev_config(hw,\n+\tvirtio_write_dev_config(hw,\n \t\t\toffsetof(struct virtio_net_config, mac),\n \t\t\t&hw->mac_addr, RTE_ETHER_ADDR_LEN);\n }\n@@ -1105,7 +1105,7 @@ static void\n virtio_get_hwaddr(struct virtio_hw *hw)\n {\n \tif (virtio_with_feature(hw, VIRTIO_NET_F_MAC)) {\n-\t\tvtpci_read_dev_config(hw,\n+\t\tvirtio_read_dev_config(hw,\n \t\t\toffsetof(struct virtio_net_config, mac),\n \t\t\t&hw->mac_addr, RTE_ETHER_ADDR_LEN);\n \t} else {\n@@ -1313,7 +1313,7 @@ virtio_ethdev_negotiate_features(struct virtio_hw *hw, uint64_t req_features)\n \tif (host_features & req_features & (1ULL << VIRTIO_NET_F_MTU)) {\n \t\tstruct virtio_net_config config;\n \n-\t\tvtpci_read_dev_config(hw,\n+\t\tvirtio_read_dev_config(hw,\n \t\t\toffsetof(struct virtio_net_config, mtu),\n \t\t\t&config.mtu, sizeof(config.mtu));\n \n@@ -1334,9 +1334,9 @@ virtio_ethdev_negotiate_features(struct virtio_hw *hw, uint64_t req_features)\n \t\treturn -1;\n \n \tif (virtio_with_feature(hw, VIRTIO_F_VERSION_1)) {\n-\t\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_FEATURES_OK);\n+\t\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_FEATURES_OK);\n \n-\t\tif (!(vtpci_get_status(hw) & VIRTIO_CONFIG_STATUS_FEATURES_OK)) {\n+\t\tif (!(virtio_get_status(hw) & VIRTIO_CONFIG_STATUS_FEATURES_OK)) {\n \t\t\tPMD_INIT_LOG(ERR, \"Failed to set FEATURES_OK status!\");\n \t\t\treturn -1;\n \t\t}\n@@ -1468,7 +1468,7 @@ virtio_interrupt_handler(void *param)\n \t\t\t\t\t\t NULL);\n \n \t\tif (virtio_with_feature(hw, VIRTIO_NET_F_STATUS)) {\n-\t\t\tvtpci_read_dev_config(hw,\n+\t\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, status),\n \t\t\t\t&status, sizeof(status));\n \t\t\tif (status & VIRTIO_NET_S_ANNOUNCE) {\n@@ -1650,7 +1650,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \tint ret;\n \n \t/* Reset the device although not necessary at startup */\n-\tvtpci_reset(hw);\n+\tvirtio_reset(hw);\n \n \tif (hw->vqs) {\n \t\tvirtio_dev_free_mbufs(eth_dev);\n@@ -1658,10 +1658,10 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \t}\n \n \t/* Tell the host we've noticed this device. */\n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_ACK);\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_ACK);\n \n \t/* Tell the host we've known how to drive the device. */\n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER);\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER);\n \tif (virtio_ethdev_negotiate_features(hw, req_features) < 0)\n \t\treturn -1;\n \n@@ -1696,10 +1696,10 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \tif (hw->speed == ETH_SPEED_NUM_UNKNOWN) {\n \t\tif (virtio_with_feature(hw, VIRTIO_NET_F_SPEED_DUPLEX)) {\n \t\t\tconfig = &local_config;\n-\t\t\tvtpci_read_dev_config(hw,\n+\t\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, speed),\n \t\t\t\t&config->speed, sizeof(config->speed));\n-\t\t\tvtpci_read_dev_config(hw,\n+\t\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, duplex),\n \t\t\t\t&config->duplex, sizeof(config->duplex));\n \t\t\thw->speed = config->speed;\n@@ -1713,12 +1713,12 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \tif (virtio_with_feature(hw, VIRTIO_NET_F_CTRL_VQ)) {\n \t\tconfig = &local_config;\n \n-\t\tvtpci_read_dev_config(hw,\n+\t\tvirtio_read_dev_config(hw,\n \t\t\toffsetof(struct virtio_net_config, mac),\n \t\t\t&config->mac, sizeof(config->mac));\n \n \t\tif (virtio_with_feature(hw, VIRTIO_NET_F_STATUS)) {\n-\t\t\tvtpci_read_dev_config(hw,\n+\t\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, status),\n \t\t\t\t&config->status, sizeof(config->status));\n \t\t} else {\n@@ -1728,7 +1728,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \t\t}\n \n \t\tif (virtio_with_feature(hw, VIRTIO_NET_F_MQ)) {\n-\t\t\tvtpci_read_dev_config(hw,\n+\t\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, max_virtqueue_pairs),\n \t\t\t\t&config->max_virtqueue_pairs,\n \t\t\t\tsizeof(config->max_virtqueue_pairs));\n@@ -1741,7 +1741,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \t\thw->max_queue_pairs = config->max_virtqueue_pairs;\n \n \t\tif (virtio_with_feature(hw, VIRTIO_NET_F_MTU)) {\n-\t\t\tvtpci_read_dev_config(hw,\n+\t\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, mtu),\n \t\t\t\t&config->mtu,\n \t\t\t\tsizeof(config->mtu));\n@@ -1793,7 +1793,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \t\t}\n \t}\n \n-\tvtpci_reinit_complete(hw);\n+\tvirtio_reinit_complete(hw);\n \n \treturn 0;\n }\n@@ -2374,7 +2374,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet\n \t\tlink.link_speed = ETH_SPEED_NUM_NONE;\n \t} else if (virtio_with_feature(hw, VIRTIO_NET_F_STATUS)) {\n \t\tPMD_INIT_LOG(DEBUG, \"Get link status from hw\");\n-\t\tvtpci_read_dev_config(hw,\n+\t\tvirtio_read_dev_config(hw,\n \t\t\t\toffsetof(struct virtio_net_config, status),\n \t\t\t\t&status, sizeof(status));\n \t\tif ((status & VIRTIO_NET_S_LINK_UP) == 0) {\ndiff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c\nindex 977a21317f..baadc79c43 100644\n--- a/drivers/net/virtio/virtio_pci.c\n+++ b/drivers/net/virtio/virtio_pci.c\n@@ -603,50 +603,6 @@ const struct virtio_ops modern_ops = {\n \t.dev_close\t= modern_dev_close,\n };\n \n-\n-void\n-vtpci_read_dev_config(struct virtio_hw *hw, size_t offset,\n-\t\t void *dst, int length)\n-{\n-\tVIRTIO_OPS(hw)->read_dev_cfg(hw, offset, dst, length);\n-}\n-\n-void\n-vtpci_write_dev_config(struct virtio_hw *hw, size_t offset,\n-\t\t const void *src, int length)\n-{\n-\tVIRTIO_OPS(hw)->write_dev_cfg(hw, offset, src, length);\n-}\n-\n-void\n-vtpci_reset(struct virtio_hw *hw)\n-{\n-\tVIRTIO_OPS(hw)->set_status(hw, VIRTIO_CONFIG_STATUS_RESET);\n-\t/* flush status write */\n-\tVIRTIO_OPS(hw)->get_status(hw);\n-}\n-\n-void\n-vtpci_reinit_complete(struct virtio_hw *hw)\n-{\n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER_OK);\n-}\n-\n-void\n-vtpci_set_status(struct virtio_hw *hw, uint8_t status)\n-{\n-\tif (status != VIRTIO_CONFIG_STATUS_RESET)\n-\t\tstatus |= VIRTIO_OPS(hw)->get_status(hw);\n-\n-\tVIRTIO_OPS(hw)->set_status(hw, status);\n-}\n-\n-uint8_t\n-vtpci_get_status(struct virtio_hw *hw)\n-{\n-\treturn VIRTIO_OPS(hw)->get_status(hw);\n-}\n-\n uint8_t\n vtpci_isr(struct virtio_hw *hw)\n {\ndiff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h\nindex 2c27c906fb..cc1a3a37fd 100644\n--- a/drivers/net/virtio/virtio_pci.h\n+++ b/drivers/net/virtio/virtio_pci.h\n@@ -49,25 +49,6 @@ struct virtnet_ctl;\n /* Vector value used to disable MSI for queue. */\n #define VIRTIO_MSI_NO_VECTOR 0xFFFF\n \n-/* VirtIO device IDs. */\n-#define VIRTIO_ID_NETWORK 0x01\n-#define VIRTIO_ID_BLOCK 0x02\n-#define VIRTIO_ID_CONSOLE 0x03\n-#define VIRTIO_ID_ENTROPY 0x04\n-#define VIRTIO_ID_BALLOON 0x05\n-#define VIRTIO_ID_IOMEMORY 0x06\n-#define VIRTIO_ID_9P 0x09\n-\n-/* Status byte for guest to report progress. */\n-#define VIRTIO_CONFIG_STATUS_RESET\t\t0x00\n-#define VIRTIO_CONFIG_STATUS_ACK\t\t0x01\n-#define VIRTIO_CONFIG_STATUS_DRIVER\t\t0x02\n-#define VIRTIO_CONFIG_STATUS_DRIVER_OK\t\t0x04\n-#define VIRTIO_CONFIG_STATUS_FEATURES_OK\t0x08\n-#define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET\t0x40\n-#define VIRTIO_CONFIG_STATUS_FAILED\t\t0x80\n-\n-\n /* Common configuration */\n #define VIRTIO_PCI_CAP_COMMON_CFG\t1\n /* Notifications */\n@@ -135,32 +116,6 @@ struct virtio_pci_dev {\n \n #define virtio_pci_get_dev(hwp) container_of(hwp, struct virtio_pci_dev, hw)\n \n-/*\n- * This structure is just a reference to read\n- * net device specific config space; it just a chodu structure\n- *\n- */\n-struct virtio_net_config {\n-\t/* The config defining mac address (if VIRTIO_NET_F_MAC) */\n-\tuint8_t mac[RTE_ETHER_ADDR_LEN];\n-\t/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */\n-\tuint16_t status;\n-\tuint16_t max_virtqueue_pairs;\n-\tuint16_t mtu;\n-\t/*\n-\t * speed, in units of 1Mb. All values 0 to INT_MAX are legal.\n-\t * Any other value stands for unknown.\n-\t */\n-\tuint32_t speed;\n-\t/*\n-\t * 0x00 - half duplex\n-\t * 0x01 - full duplex\n-\t * Any other value stands for unknown.\n-\t */\n-\tuint8_t duplex;\n-\n-} __rte_packed;\n-\n /*\n * How many bits to shift physical queue address written to QUEUE_PFN.\n * 12 is historical, and due to x86 page size.\n@@ -181,16 +136,6 @@ enum virtio_msix_status {\n * Function declaration from virtio_pci.c\n */\n int vtpci_init(struct rte_pci_device *pci_dev, struct virtio_pci_dev *dev);\n-void vtpci_reset(struct virtio_hw *);\n-\n-void vtpci_reinit_complete(struct virtio_hw *);\n-\n-uint8_t vtpci_get_status(struct virtio_hw *);\n-void vtpci_set_status(struct virtio_hw *, uint8_t);\n-\n-void vtpci_write_dev_config(struct virtio_hw *, size_t, const void *, int);\n-\n-void vtpci_read_dev_config(struct virtio_hw *, size_t, void *, int);\n \n uint8_t vtpci_isr(struct virtio_hw *);\n \ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 8e609333c6..6e59fe4b58 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -79,11 +79,11 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)\n \tdev->vhostfd = connectfd;\n \told_status = dev->status;\n \n-\tvtpci_reset(hw);\n+\tvirtio_reset(hw);\n \n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_ACK);\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_ACK);\n \n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER);\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER);\n \n \tif (dev->ops->send_request(dev, VHOST_USER_GET_FEATURES,\n \t\t\t\t &dev->device_features) < 0) {\n@@ -129,10 +129,10 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)\n \t\tvirtio_user_reset_queues_packed(eth_dev);\n \t}\n \n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_FEATURES_OK);\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_FEATURES_OK);\n \n \t/* Start the device */\n-\tvtpci_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER_OK);\n+\tvirtio_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER_OK);\n \tif (!dev->started)\n \t\treturn -1;\n \n", "prefixes": [ "v4", "21/44" ] }{ "id": 87309, "url": "