Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/88185/?format=api
http://patches.dpdk.org/api/patches/88185/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210225080901.3645291-2-jiawenwu@trustnetic.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": "<20210225080901.3645291-2-jiawenwu@trustnetic.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210225080901.3645291-2-jiawenwu@trustnetic.com", "date": "2021-02-25T08:08:45", "name": "[v3,01/17] net/txgbe: add ethdev probe and remove for VF device", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "446cfc7a256c36d8524a728b7cefd0690f0d5d48", "submitter": { "id": 1932, "url": "http://patches.dpdk.org/api/people/1932/?format=api", "name": "Jiawen Wu", "email": "jiawenwu@trustnetic.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210225080901.3645291-2-jiawenwu@trustnetic.com/mbox/", "series": [ { "id": 15371, "url": "http://patches.dpdk.org/api/series/15371/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15371", "date": "2021-02-25T08:08:45", "name": "net/txgbe: add VF driver support", "version": 3, "mbox": "http://patches.dpdk.org/series/15371/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/88185/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/88185/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 8E4B2A034F;\n\tThu, 25 Feb 2021 09:08:37 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 303BF40692;\n\tThu, 25 Feb 2021 09:08:37 +0100 (CET)", "from smtpproxy21.qq.com (smtpbg704.qq.com [203.205.195.105])\n by mails.dpdk.org (Postfix) with ESMTP id 4094B40692\n for <dev@dpdk.org>; Thu, 25 Feb 2021 09:08:34 +0100 (CET)", "from wxdbg.localdomain.com (unknown [183.129.236.74])\n by esmtp6.qq.com (ESMTP) with\n id ; Thu, 25 Feb 2021 16:08:28 +0800 (CST)" ], "X-QQ-mid": "bizesmtp20t1614240508t8hb64j6", "X-QQ-SSF": "01400000002000C0D000000A0000000", "X-QQ-FEAT": "nnTZLeLrWPAVSOx3hFrpTLohdNj2IHXL+70catiQexi2Sqq40vQCJdUNSsq8P\n Nua60ErVnoM/NV5ywC+sbmHX8GHRJJL2yxKApTZApx+tyB07wxpMGyqcvAmZO4vBL+0SWvo\n bLvmtrsf/TWVCCoThPzBdKfWSpbuLrwJFLTmZekk2aj1AnJZNR/RQgmW1Ag6KBLS+qhIOqw\n r/lul745Kzp+1qYrWSyQ3dgCvZws2SUmkLIbG/vTkArQTKUfDpOq6WWvF1/nVEWZs+r0iVj\n 63OeVECWquf+h1rZaU5PYsK5ocdz0hgm/j0ZL/L6guccRm8sqye5CMNrOkdUmem8aHYbK8Q\n lS0bmvbwum9wIotlJ5Wm64lXTM9Hg==", "X-QQ-GoodBg": "2", "From": "Jiawen Wu <jiawenwu@trustnetic.com>", "To": "dev@dpdk.org", "Cc": "Jiawen Wu <jiawenwu@trustnetic.com>", "Date": "Thu, 25 Feb 2021 16:08:45 +0800", "Message-Id": "<20210225080901.3645291-2-jiawenwu@trustnetic.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210225080901.3645291-1-jiawenwu@trustnetic.com>", "References": "<20210225080901.3645291-1-jiawenwu@trustnetic.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-QQ-SENDSIZE": "520", "Feedback-ID": "bizesmtp:trustnetic.com:qybgforeign:qybgforeign5", "X-QQ-Bgrelay": "1", "Subject": "[dpdk-dev] [PATCH v3 01/17] net/txgbe: add ethdev probe and remove\n for VF device", "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": "Introduce virtual function driver in txgbe PMD,\nadd simple init and uninit function to probe and remove the device.\n\nSigned-off-by: Jiawen Wu <jiawenwu@trustnetic.com>\n---\n doc/guides/nics/features/txgbe_vf.ini | 11 +++\n drivers/net/txgbe/meson.build | 1 +\n drivers/net/txgbe/txgbe_ethdev_vf.c | 132 ++++++++++++++++++++++++++\n 3 files changed, 144 insertions(+)\n create mode 100644 doc/guides/nics/features/txgbe_vf.ini\n create mode 100644 drivers/net/txgbe/txgbe_ethdev_vf.c", "diff": "diff --git a/doc/guides/nics/features/txgbe_vf.ini b/doc/guides/nics/features/txgbe_vf.ini\nnew file mode 100644\nindex 000000000..5035c5eea\n--- /dev/null\n+++ b/doc/guides/nics/features/txgbe_vf.ini\n@@ -0,0 +1,11 @@\n+;\n+; Supported features of the 'txgbe_vf' network poll mode driver.\n+;\n+; Refer to default.ini for the full list of available PMD features.\n+;\n+[Features]\n+Multiprocess aware = Y\n+Linux = Y\n+ARMv8 = Y\n+x86-32 = Y\n+x86-64 = Y\ndiff --git a/drivers/net/txgbe/meson.build b/drivers/net/txgbe/meson.build\nindex 60505e211..3b9994aa9 100644\n--- a/drivers/net/txgbe/meson.build\n+++ b/drivers/net/txgbe/meson.build\n@@ -12,6 +12,7 @@ objs = [base_objs]\n \n sources = files(\n \t'txgbe_ethdev.c',\n+\t'txgbe_ethdev_vf.c',\n \t'txgbe_fdir.c',\n \t'txgbe_flow.c',\n \t'txgbe_ipsec.c',\ndiff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c\nnew file mode 100644\nindex 000000000..1c3765e4e\n--- /dev/null\n+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c\n@@ -0,0 +1,132 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2015-2020\n+ */\n+\n+#include <sys/queue.h>\n+#include <stdio.h>\n+#include <errno.h>\n+#include <stdint.h>\n+#include <string.h>\n+#include <rte_log.h>\n+#include <ethdev_pci.h>\n+\n+#include \"base/txgbe.h\"\n+#include \"txgbe_ethdev.h\"\n+#include \"txgbe_rxtx.h\"\n+\n+static int txgbevf_dev_close(struct rte_eth_dev *dev);\n+\n+/*\n+ * The set of PCI devices this driver supports (for VF)\n+ */\n+static const struct rte_pci_id pci_id_txgbevf_map[] = {\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_RAPTOR_VF) },\n+\t{ RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_RAPTOR_VF_HV) },\n+\t{ .vendor_id = 0, /* sentinel */ },\n+};\n+\n+static const struct eth_dev_ops txgbevf_eth_dev_ops;\n+\n+/*\n+ * Virtual Function device init\n+ */\n+static int\n+eth_txgbevf_dev_init(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);\n+\tstruct txgbe_hw *hw = TXGBE_DEV_HW(eth_dev);\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\teth_dev->dev_ops = &txgbevf_eth_dev_ops;\n+\n+\t/* for secondary processes, we don't initialise any further as primary\n+\t * has already done this work. Only check we don't need a different\n+\t * RX function\n+\t */\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n+\t\tstruct txgbe_tx_queue *txq;\n+\t\tuint16_t nb_tx_queues = eth_dev->data->nb_tx_queues;\n+\t\t/* TX queue function in primary, set by last queue initialized\n+\t\t * Tx queue may not initialized by primary process\n+\t\t */\n+\t\tif (eth_dev->data->tx_queues) {\n+\t\t\ttxq = eth_dev->data->tx_queues[nb_tx_queues - 1];\n+\t\t\ttxgbe_set_tx_function(eth_dev, txq);\n+\t\t} else {\n+\t\t\t/* Use default TX function if we get here */\n+\t\t\tPMD_INIT_LOG(NOTICE,\n+\t\t\t\t \"No TX queues configured yet. Using default TX function.\");\n+\t\t}\n+\n+\t\ttxgbe_set_rx_function(eth_dev);\n+\n+\t\treturn 0;\n+\t}\n+\n+\trte_eth_copy_pci_info(eth_dev, pci_dev);\n+\n+\thw->device_id = pci_dev->id.device_id;\n+\thw->vendor_id = pci_dev->id.vendor_id;\n+\thw->subsystem_device_id = pci_dev->id.subsystem_device_id;\n+\thw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;\n+\thw->hw_addr = (void *)pci_dev->mem_resource[0].addr;\n+\n+\treturn 0;\n+}\n+\n+/* Virtual Function device uninit */\n+static int\n+eth_txgbevf_dev_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n+\ttxgbevf_dev_close(eth_dev);\n+\n+\treturn 0;\n+}\n+\n+static int eth_txgbevf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n+\tstruct rte_pci_device *pci_dev)\n+{\n+\treturn rte_eth_dev_pci_generic_probe(pci_dev,\n+\t\tsizeof(struct txgbe_adapter), eth_txgbevf_dev_init);\n+}\n+\n+static int eth_txgbevf_pci_remove(struct rte_pci_device *pci_dev)\n+{\n+\treturn rte_eth_dev_pci_generic_remove(pci_dev, eth_txgbevf_dev_uninit);\n+}\n+\n+/*\n+ * virtual function driver struct\n+ */\n+static struct rte_pci_driver rte_txgbevf_pmd = {\n+\t.id_table = pci_id_txgbevf_map,\n+\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING,\n+\t.probe = eth_txgbevf_pci_probe,\n+\t.remove = eth_txgbevf_pci_remove,\n+};\n+\n+static int\n+txgbevf_dev_close(struct rte_eth_dev *dev)\n+{\n+\tPMD_INIT_FUNC_TRACE();\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n+\treturn 0;\n+}\n+\n+/*\n+ * dev_ops for virtual function, bare necessities for basic vf\n+ * operation have been implemented\n+ */\n+static const struct eth_dev_ops txgbevf_eth_dev_ops = {\n+};\n+\n+RTE_PMD_REGISTER_PCI(net_txgbe_vf, rte_txgbevf_pmd);\n+RTE_PMD_REGISTER_PCI_TABLE(net_txgbe_vf, pci_id_txgbevf_map);\n+RTE_PMD_REGISTER_KMOD_DEP(net_txgbe_vf, \"* igb_uio | vfio-pci\");\n", "prefixes": [ "v3", "01/17" ] }{ "id": 88185, "url": "