Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/79656/?format=api
https://patches.dpdk.org/api/patches/79656/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201005120910.189343-39-jiawenwu@trustnetic.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": "<20201005120910.189343-39-jiawenwu@trustnetic.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20201005120910.189343-39-jiawenwu@trustnetic.com", "date": "2020-10-05T12:08:52", "name": "[v2,38/56] net/txgbe: add PF module init and uninit for SRIOV", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "118758149ff4a1da008935ab12693d11917da017", "submitter": { "id": 1932, "url": "https://patches.dpdk.org/api/people/1932/?format=api", "name": "Jiawen Wu", "email": "jiawenwu@trustnetic.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201005120910.189343-39-jiawenwu@trustnetic.com/mbox/", "series": [ { "id": 12690, "url": "https://patches.dpdk.org/api/series/12690/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12690", "date": "2020-10-05T12:08:14", "name": "net: txgbe PMD", "version": 2, "mbox": "https://patches.dpdk.org/series/12690/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/79656/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/79656/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5FDD1A04B1;\n\tMon, 5 Oct 2020 14:24:54 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5EE4E1BFCF;\n\tMon, 5 Oct 2020 14:09:52 +0200 (CEST)", "from smtpbg506.qq.com (smtpbg506.qq.com [203.205.250.33])\n by dpdk.org (Postfix) with ESMTP id 96DA81BDD7\n for <dev@dpdk.org>; Mon, 5 Oct 2020 14:09:28 +0200 (CEST)", "from localhost.localdomain.com (unknown [183.129.236.74])\n by esmtp6.qq.com (ESMTP) with\n id ; Mon, 05 Oct 2020 20:09:25 +0800 (CST)" ], "X-QQ-mid": "bizesmtp9t1601899765t714srinl", "X-QQ-SSF": "01400000002000C0C000B00A0000000", "X-QQ-FEAT": "9MsTBLS6yXHO2Bc3XK1tnGV4j+fY/j3Rxes9RUCzOjoD4V5TVlJGrIN6x/bQd\n otuJDKRAJYs/Z4o8oD2Be2VojunFJXvqU/dxMPxnXSnYkBa+DfpVEip9hes5h7pM7DdzuPb\n B/KiLXUIJJTDl7pmRKEKCmBoBA9Za7bkiw1ri7DtBo65AG8mZXglussBm0990gfIwUMQGd0\n 93gAEmh+rFKdZdgyEOZB8WSsKTiamp1+8+A5UHGqSGmwJCp1bKOcmU0WvaF/HtiZoP/e6y8\n Hr3pi/dhAFxbiHRZe1UOaV0vroK2vZDchn1J8mTLiouQuCAnkNCf+tOXTy4fFjwBW64MQux\n RMz+7EL7lCbltrgVWF1sik/GO0lBg==", "X-QQ-GoodBg": "2", "From": "Jiawen Wu <jiawenwu@trustnetic.com>", "To": "dev@dpdk.org", "Cc": "jiawenwu <jiawenwu@trustnetic.com>", "Date": "Mon, 5 Oct 2020 20:08:52 +0800", "Message-Id": "<20201005120910.189343-39-jiawenwu@trustnetic.com>", "X-Mailer": "git-send-email 2.18.4", "In-Reply-To": "<20201005120910.189343-1-jiawenwu@trustnetic.com>", "References": "<20201005120910.189343-1-jiawenwu@trustnetic.com>", "X-QQ-SENDSIZE": "520", "Feedback-ID": "bizesmtp:trustnetic.com:qybgforeign:qybgforeign7", "X-QQ-Bgrelay": "1", "Subject": "[dpdk-dev] [PATCH v2 38/56] net/txgbe: add PF module init and\n\tuninit for SRIOV", "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 <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": "From: jiawenwu <jiawenwu@trustnetic.com>\n\nAdd PF module init and uninit operations with mailbox.\n\nSigned-off-by: jiawenwu <jiawenwu@trustnetic.com>\n---\n doc/guides/nics/features/txgbe.ini | 1 +\n drivers/net/txgbe/base/meson.build | 1 +\n drivers/net/txgbe/base/txgbe.h | 1 +\n drivers/net/txgbe/base/txgbe_hw.c | 4 +\n drivers/net/txgbe/base/txgbe_mbx.c | 29 ++++++\n drivers/net/txgbe/base/txgbe_mbx.h | 12 +++\n drivers/net/txgbe/base/txgbe_type.h | 14 +++\n drivers/net/txgbe/meson.build | 1 +\n drivers/net/txgbe/txgbe_ethdev.c | 15 +++\n drivers/net/txgbe/txgbe_ethdev.h | 21 +++++\n drivers/net/txgbe/txgbe_pf.c | 140 ++++++++++++++++++++++++++++\n 11 files changed, 239 insertions(+)\n create mode 100644 drivers/net/txgbe/base/txgbe_mbx.c\n create mode 100644 drivers/net/txgbe/base/txgbe_mbx.h\n create mode 100644 drivers/net/txgbe/txgbe_pf.c", "diff": "diff --git a/doc/guides/nics/features/txgbe.ini b/doc/guides/nics/features/txgbe.ini\nindex bd39d6642..1d00f3105 100644\n--- a/doc/guides/nics/features/txgbe.ini\n+++ b/doc/guides/nics/features/txgbe.ini\n@@ -15,6 +15,7 @@ LRO = Y\n TSO = Y\n Unicast MAC filter = Y\n Multicast MAC filter = Y\n+SR-IOV = Y\n VLAN filter = Y\n CRC offload = P\n VLAN offload = P\ndiff --git a/drivers/net/txgbe/base/meson.build b/drivers/net/txgbe/base/meson.build\nindex d0100714e..6490d4ed8 100644\n--- a/drivers/net/txgbe/base/meson.build\n+++ b/drivers/net/txgbe/base/meson.build\n@@ -4,6 +4,7 @@\n sources = [\n \t'txgbe_eeprom.c',\n \t'txgbe_hw.c',\n+\t'txgbe_mbx.c',\n \t'txgbe_mng.c',\n \t'txgbe_phy.c',\n ]\ndiff --git a/drivers/net/txgbe/base/txgbe.h b/drivers/net/txgbe/base/txgbe.h\nindex 764caa439..bf95d5681 100644\n--- a/drivers/net/txgbe/base/txgbe.h\n+++ b/drivers/net/txgbe/base/txgbe.h\n@@ -7,6 +7,7 @@\n \n #include \"txgbe_type.h\"\n #include \"txgbe_mng.h\"\n+#include \"txgbe_mbx.h\"\n #include \"txgbe_eeprom.h\"\n #include \"txgbe_phy.h\"\n #include \"txgbe_hw.h\"\ndiff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c\nindex 0bd8e072e..68cd29767 100644\n--- a/drivers/net/txgbe/base/txgbe_hw.c\n+++ b/drivers/net/txgbe/base/txgbe_hw.c\n@@ -3,6 +3,7 @@\n */\n \n #include \"txgbe_type.h\"\n+#include \"txgbe_mbx.h\"\n #include \"txgbe_phy.h\"\n #include \"txgbe_eeprom.h\"\n #include \"txgbe_mng.h\"\n@@ -1708,6 +1709,7 @@ s32 txgbe_init_ops_pf(struct txgbe_hw *hw)\n \tstruct txgbe_mac_info *mac = &hw->mac;\n \tstruct txgbe_phy_info *phy = &hw->phy;\n \tstruct txgbe_rom_info *rom = &hw->rom;\n+\tstruct txgbe_mbx_info *mbx = &hw->mbx;\n \n \tDEBUGFUNC(\"txgbe_init_ops_pf\");\n \n@@ -1769,6 +1771,8 @@ s32 txgbe_init_ops_pf(struct txgbe_hw *hw)\n \tmac->get_thermal_sensor_data = txgbe_get_thermal_sensor_data;\n \tmac->init_thermal_sensor_thresh = txgbe_init_thermal_sensor_thresh;\n \n+\tmbx->init_params = txgbe_init_mbx_params_pf;\n+\n \t/* EEPROM */\n \trom->init_params = txgbe_init_eeprom_params;\n \trom->read16 = txgbe_ee_read16;\ndiff --git a/drivers/net/txgbe/base/txgbe_mbx.c b/drivers/net/txgbe/base/txgbe_mbx.c\nnew file mode 100644\nindex 000000000..e53024674\n--- /dev/null\n+++ b/drivers/net/txgbe/base/txgbe_mbx.c\n@@ -0,0 +1,29 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2015-2020\n+ */\n+\n+#include \"txgbe_type.h\"\n+\n+#include \"txgbe_mbx.h\"\n+\n+/**\n+ * txgbe_init_mbx_params_pf - set initial values for pf mailbox\n+ * @hw: pointer to the HW structure\n+ *\n+ * Initializes the hw->mbx struct to correct values for pf mailbox\n+ */\n+void txgbe_init_mbx_params_pf(struct txgbe_hw *hw)\n+{\n+\tstruct txgbe_mbx_info *mbx = &hw->mbx;\n+\n+\tmbx->timeout = 0;\n+\tmbx->usec_delay = 0;\n+\n+\tmbx->size = TXGBE_P2VMBX_SIZE;\n+\n+\tmbx->stats.msgs_tx = 0;\n+\tmbx->stats.msgs_rx = 0;\n+\tmbx->stats.reqs = 0;\n+\tmbx->stats.acks = 0;\n+\tmbx->stats.rsts = 0;\n+}\ndiff --git a/drivers/net/txgbe/base/txgbe_mbx.h b/drivers/net/txgbe/base/txgbe_mbx.h\nnew file mode 100644\nindex 000000000..ab2c5dd97\n--- /dev/null\n+++ b/drivers/net/txgbe/base/txgbe_mbx.h\n@@ -0,0 +1,12 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2015-2020\n+ */\n+\n+#ifndef _TXGBE_MBX_H_\n+#define _TXGBE_MBX_H_\n+\n+#include \"txgbe_type.h\"\n+\n+void txgbe_init_mbx_params_pf(struct txgbe_hw *);\n+\n+#endif /* _TXGBE_MBX_H_ */\ndiff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h\nindex 74eb90ff4..9ee542407 100644\n--- a/drivers/net/txgbe/base/txgbe_type.h\n+++ b/drivers/net/txgbe/base/txgbe_type.h\n@@ -587,6 +587,15 @@ struct txgbe_phy_info {\n \tu32 link_mode;\n };\n \n+struct txgbe_mbx_stats {\n+\tu32 msgs_tx;\n+\tu32 msgs_rx;\n+\n+\tu32 acks;\n+\tu32 reqs;\n+\tu32 rsts;\n+};\n+\n struct txgbe_mbx_info {\n \tvoid (*init_params)(struct txgbe_hw *hw);\n \ts32 (*read)(struct txgbe_hw *, u32 *, u16, u16);\n@@ -596,6 +605,11 @@ struct txgbe_mbx_info {\n \ts32 (*check_for_msg)(struct txgbe_hw *, u16);\n \ts32 (*check_for_ack)(struct txgbe_hw *, u16);\n \ts32 (*check_for_rst)(struct txgbe_hw *, u16);\n+\n+\tstruct txgbe_mbx_stats stats;\n+\tu32 timeout;\n+\tu32 usec_delay;\n+\tu16 size;\n };\n \n enum txgbe_isb_idx {\ndiff --git a/drivers/net/txgbe/meson.build b/drivers/net/txgbe/meson.build\nindex ea028d208..62f650504 100644\n--- a/drivers/net/txgbe/meson.build\n+++ b/drivers/net/txgbe/meson.build\n@@ -7,6 +7,7 @@ objs = [base_objs]\n sources = files(\n \t'txgbe_ethdev.c',\n \t'txgbe_ptypes.c',\n+\t'txgbe_pf.c',\n \t'txgbe_rxtx.c',\n )\n \ndiff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c\nindex b82fe062f..a04e2ecc9 100644\n--- a/drivers/net/txgbe/txgbe_ethdev.c\n+++ b/drivers/net/txgbe/txgbe_ethdev.c\n@@ -367,6 +367,7 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \tstruct txgbe_hwstrip *hwstrip = TXGBE_DEV_HWSTRIP(eth_dev);\n \tstruct rte_intr_handle *intr_handle = &pci_dev->intr_handle;\n \tconst struct rte_memzone *mz;\n+\tuint32_t ctrl_ext;\n \tuint16_t csum;\n \tint err;\n \n@@ -517,6 +518,17 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \t/* initialize the hw strip bitmap*/\n \tmemset(hwstrip, 0, sizeof(*hwstrip));\n \n+\t/* initialize PF if max_vfs not zero */\n+\ttxgbe_pf_host_init(eth_dev);\n+\n+\tctrl_ext = rd32(hw, TXGBE_PORTCTL);\n+\t/* let hardware know driver is loaded */\n+\tctrl_ext |= TXGBE_PORTCTL_DRVLOAD;\n+\t/* Set PF Reset Done bit so PF/VF Mail Ops can work */\n+\tctrl_ext |= TXGBE_PORTCTL_RSTDONE;\n+\twr32(hw, TXGBE_PORTCTL, ctrl_ext);\n+\ttxgbe_flush(hw);\n+\n \tif (txgbe_is_sfp(hw) && hw->phy.sfp_type != txgbe_sfp_type_not_present)\n \t\tPMD_INIT_LOG(DEBUG, \"MAC: %d, PHY: %d, SFP+: %d\",\n \t\t\t (int)hw->mac.type, (int)hw->phy.type,\n@@ -1503,6 +1515,9 @@ txgbe_dev_close(struct rte_eth_dev *dev)\n \t/* cancel the delay handler before remove dev */\n \trte_eal_alarm_cancel(txgbe_dev_interrupt_delayed_handler, dev);\n \n+\t/* uninitialize PF if max_vfs not zero */\n+\ttxgbe_pf_host_uninit(dev);\n+\n \trte_free(dev->data->mac_addrs);\n \tdev->data->mac_addrs = NULL;\n \ndiff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h\nindex 1dcd1b1af..10eda96a1 100644\n--- a/drivers/net/txgbe/txgbe_ethdev.h\n+++ b/drivers/net/txgbe/txgbe_ethdev.h\n@@ -79,6 +79,18 @@ struct txgbe_uta_info {\n \tuint32_t uta_shadow[TXGBE_MAX_UTA];\n };\n \n+#define TXGBE_MAX_MIRROR_RULES 4 /* Maximum nb. of mirror rules. */\n+\n+struct txgbe_mirror_info {\n+\tstruct rte_eth_mirror_conf mr_conf[TXGBE_MAX_MIRROR_RULES];\n+\t/* store PF mirror rules configuration */\n+};\n+\n+struct txgbe_vf_info {\n+\tuint8_t vf_mac_addresses[RTE_ETHER_ADDR_LEN];\n+\tuint16_t switch_domain_id;\n+};\n+\n /*\n * Structure to store private data for each driver instance (for each port).\n */\n@@ -89,6 +101,8 @@ struct txgbe_adapter {\n \tstruct txgbe_stat_mappings stat_mappings;\n \tstruct txgbe_vfta shadow_vfta;\n \tstruct txgbe_hwstrip hwstrip;\n+\tstruct txgbe_mirror_info mr_data;\n+\tstruct txgbe_vf_info *vfdata;\n \tstruct txgbe_uta_info uta_info;\n \tbool rx_bulk_alloc_allowed;\n };\n@@ -117,6 +131,9 @@ struct txgbe_adapter {\n #define TXGBE_DEV_VFDATA(dev) \\\n \t(&((struct txgbe_adapter *)(dev)->data->dev_private)->vfdata)\n \n+#define TXGBE_DEV_MR_INFO(dev) \\\n+\t(&((struct txgbe_adapter *)(dev)->data->dev_private)->mr_data)\n+\n #define TXGBE_DEV_UTA_INFO(dev) \\\n \t(&((struct txgbe_adapter *)(dev)->data->dev_private)->uta_info)\n \n@@ -191,6 +208,10 @@ void txgbe_set_ivar_map(struct txgbe_hw *hw, int8_t direction,\n int\n txgbe_dev_link_update_share(struct rte_eth_dev *dev,\n \t\tint wait_to_complete);\n+void txgbe_pf_host_init(struct rte_eth_dev *eth_dev);\n+\n+void txgbe_pf_host_uninit(struct rte_eth_dev *eth_dev);\n+\n \n #define TXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */\n #define TXGBE_LINK_UP_CHECK_TIMEOUT 1000 /* ms */\ndiff --git a/drivers/net/txgbe/txgbe_pf.c b/drivers/net/txgbe/txgbe_pf.c\nnew file mode 100644\nindex 000000000..7ed992e72\n--- /dev/null\n+++ b/drivers/net/txgbe/txgbe_pf.c\n@@ -0,0 +1,140 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2015-2020\n+ */\n+\n+#include <stdio.h>\n+#include <errno.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#include <stdarg.h>\n+#include <inttypes.h>\n+\n+#include <rte_interrupts.h>\n+#include <rte_log.h>\n+#include <rte_debug.h>\n+#include <rte_eal.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev_driver.h>\n+#include <rte_memcpy.h>\n+#include <rte_malloc.h>\n+#include <rte_random.h>\n+#include <rte_bus_pci.h>\n+\n+#include \"base/txgbe.h\"\n+#include \"txgbe_ethdev.h\"\n+\n+static inline uint16_t\n+dev_num_vf(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);\n+\n+\treturn pci_dev->max_vfs;\n+}\n+\n+static inline\n+int txgbe_vf_perm_addr_gen(struct rte_eth_dev *dev, uint16_t vf_num)\n+{\n+\tunsigned char vf_mac_addr[RTE_ETHER_ADDR_LEN];\n+\tstruct txgbe_vf_info *vfinfo = *TXGBE_DEV_VFDATA(dev);\n+\tuint16_t vfn;\n+\n+\tfor (vfn = 0; vfn < vf_num; vfn++) {\n+\t\trte_eth_random_addr(vf_mac_addr);\n+\t\t/* keep the random address as default */\n+\t\tmemcpy(vfinfo[vfn].vf_mac_addresses, vf_mac_addr,\n+\t\t\t RTE_ETHER_ADDR_LEN);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static inline int\n+txgbe_mb_intr_setup(struct rte_eth_dev *dev)\n+{\n+\tstruct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev);\n+\n+\tintr->mask_misc |= TXGBE_ICRMISC_VFMBX;\n+\n+\treturn 0;\n+}\n+\n+void txgbe_pf_host_init(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct txgbe_vf_info **vfinfo = TXGBE_DEV_VFDATA(eth_dev);\n+\tstruct txgbe_mirror_info *mirror_info = TXGBE_DEV_MR_INFO(eth_dev);\n+\tstruct txgbe_uta_info *uta_info = TXGBE_DEV_UTA_INFO(eth_dev);\n+\tstruct txgbe_hw *hw = TXGBE_DEV_HW(eth_dev);\n+\tuint16_t vf_num;\n+\tuint8_t nb_queue;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tRTE_ETH_DEV_SRIOV(eth_dev).active = 0;\n+\tvf_num = dev_num_vf(eth_dev);\n+\tif (vf_num == 0)\n+\t\treturn;\n+\n+\t*vfinfo = rte_zmalloc(\"vf_info\", sizeof(struct txgbe_vf_info) * vf_num, 0);\n+\tif (*vfinfo == NULL)\n+\t\trte_panic(\"Cannot allocate memory for private VF data\\n\");\n+\n+\trte_eth_switch_domain_alloc(&(*vfinfo)->switch_domain_id);\n+\n+\tmemset(mirror_info, 0, sizeof(struct txgbe_mirror_info));\n+\tmemset(uta_info, 0, sizeof(struct txgbe_uta_info));\n+\thw->mac.mc_filter_type = 0;\n+\n+\tif (vf_num >= ETH_32_POOLS) {\n+\t\tnb_queue = 2;\n+\t\tRTE_ETH_DEV_SRIOV(eth_dev).active = ETH_64_POOLS;\n+\t} else if (vf_num >= ETH_16_POOLS) {\n+\t\tnb_queue = 4;\n+\t\tRTE_ETH_DEV_SRIOV(eth_dev).active = ETH_32_POOLS;\n+\t} else {\n+\t\tnb_queue = 8;\n+\t\tRTE_ETH_DEV_SRIOV(eth_dev).active = ETH_16_POOLS;\n+\t}\n+\n+\tRTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = nb_queue;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = vf_num;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).def_pool_q_idx = (uint16_t)(vf_num * nb_queue);\n+\n+\ttxgbe_vf_perm_addr_gen(eth_dev, vf_num);\n+\n+\t/* init_mailbox_params */\n+\thw->mbx.init_params(hw);\n+\n+\t/* set mb interrupt mask */\n+\ttxgbe_mb_intr_setup(eth_dev);\n+}\n+\n+void txgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct txgbe_vf_info **vfinfo;\n+\tuint16_t vf_num;\n+\tint ret;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tRTE_ETH_DEV_SRIOV(eth_dev).active = 0;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = 0;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).def_pool_q_idx = 0;\n+\n+\tvf_num = dev_num_vf(eth_dev);\n+\tif (vf_num == 0)\n+\t\treturn;\n+\n+\tvfinfo = TXGBE_DEV_VFDATA(eth_dev);\n+\tif (*vfinfo == NULL)\n+\t\treturn;\n+\n+\tret = rte_eth_switch_domain_free((*vfinfo)->switch_domain_id);\n+\tif (ret)\n+\t\tPMD_INIT_LOG(WARNING, \"failed to free switch domain: %d\", ret);\n+\n+\trte_free(*vfinfo);\n+\t*vfinfo = NULL;\n+}\n+\n", "prefixes": [ "v2", "38/56" ] }{ "id": 79656, "url": "