get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/79621/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 79621,
    "url": "https://patches.dpdk.org/api/patches/79621/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201005120910.189343-6-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-6-jiawenwu@trustnetic.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201005120910.189343-6-jiawenwu@trustnetic.com",
    "date": "2020-10-05T12:08:19",
    "name": "[v2,05/56] net/txgbe: add mac type and bus lan id",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ad3e9757c9b77c53b3ced81a50683183bc9eb209",
    "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-6-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/79621/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/79621/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 5473DA04B1;\n\tMon,  5 Oct 2020 14:10:20 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8839E1B87A;\n\tMon,  5 Oct 2020 14:08:53 +0200 (CEST)",
            "from smtpbg501.qq.com (smtpbg501.qq.com [203.205.250.101])\n by dpdk.org (Postfix) with ESMTP id 2A6901B7C0\n for <dev@dpdk.org>; Mon,  5 Oct 2020 14:08:49 +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:08:43 +0800 (CST)"
        ],
        "X-QQ-mid": "bizesmtp9t1601899724tzy7fvd4j",
        "X-QQ-SSF": "01400000002000C0C000B00A0000000",
        "X-QQ-FEAT": "hSE8T2z2W7rxGrYDw13Ad/UTq+PPcdAyv9Aiv1pCApqFvsgpcPwTAULkHBDD4\n u87LrhSynBbrwHvTq7WS2+gPRzbqODQyWcKhjHqjBh6Pz5i9AUumXsgiPrjrBUeY47J3AwW\n 7BSyqEKPhGR61tDu4PBtdLBGNA0+yJPhSXiRVJu32WtYtXZJvf5IvvfklRc+L6gb/X4F9Gf\n TbZ3Tma/ssMz4TkEeoTVpdrBC/j1qL0x8Rppdhn/HxKAR49HGYda4GBpzM/Xe+ckzenNywu\n iRwyBZhxc0iY5BeGBFBFBTXPQOcLl/dkYM3JwV1lzsKeKrFfA/uAOc2bPaZPNonglhYeBYu\n vwWFnTgWqMeC7F6Y90=",
        "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:19 +0800",
        "Message-Id": "<20201005120910.189343-6-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:qybgforeign5",
        "X-QQ-Bgrelay": "1",
        "Subject": "[dpdk-dev] [PATCH v2 05/56] net/txgbe: add mac type and bus lan id",
        "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 base driver shared code.\n\nSigned-off-by: jiawenwu <jiawenwu@trustnetic.com>\n---\n drivers/net/txgbe/base/meson.build  |   4 +-\n drivers/net/txgbe/base/txgbe.h      |   1 +\n drivers/net/txgbe/base/txgbe_hw.c   | 134 +++++++++++++++++++++++++\n drivers/net/txgbe/base/txgbe_hw.h   |  16 +++\n drivers/net/txgbe/base/txgbe_type.h | 146 ++++++++++++++++++++++++++++\n drivers/net/txgbe/txgbe_ethdev.c    |  32 ++++++\n 6 files changed, 332 insertions(+), 1 deletion(-)\n create mode 100644 drivers/net/txgbe/base/txgbe_hw.c\n create mode 100644 drivers/net/txgbe/base/txgbe_hw.h",
    "diff": "diff --git a/drivers/net/txgbe/base/meson.build b/drivers/net/txgbe/base/meson.build\nindex a0f65b819..54d6e399d 100644\n--- a/drivers/net/txgbe/base/meson.build\n+++ b/drivers/net/txgbe/base/meson.build\n@@ -1,7 +1,9 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2015-2020\n \n-sources = []\n+sources = [\n+\t'txgbe_hw.c',\n+]\n \n error_cflags = []\n \ndiff --git a/drivers/net/txgbe/base/txgbe.h b/drivers/net/txgbe/base/txgbe.h\nindex 9aee9738a..7783bd694 100644\n--- a/drivers/net/txgbe/base/txgbe.h\n+++ b/drivers/net/txgbe/base/txgbe.h\n@@ -6,5 +6,6 @@\n #define _TXGBE_H_\n \n #include \"txgbe_type.h\"\n+#include \"txgbe_hw.h\"\n \n #endif /* _TXGBE_H_ */\ndiff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c\nnew file mode 100644\nindex 000000000..3d8968eb4\n--- /dev/null\n+++ b/drivers/net/txgbe/base/txgbe_hw.c\n@@ -0,0 +1,134 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2015-2020\n+ */\n+\n+#include \"txgbe_type.h\"\n+#include \"txgbe_hw.h\"\n+\n+#define TXGBE_RAPTOR_RAR_ENTRIES   128\n+\n+/**\n+ *  txgbe_set_lan_id_multi_port - Set LAN id for PCIe multiple port devices\n+ *  @hw: pointer to the HW structure\n+ *\n+ *  Determines the LAN function id by reading memory-mapped registers and swaps\n+ *  the port value if requested, and set MAC instance for devices.\n+ **/\n+void txgbe_set_lan_id_multi_port(struct txgbe_hw *hw)\n+{\n+\tstruct txgbe_bus_info *bus = &hw->bus;\n+\tu32 reg;\n+\n+\tDEBUGFUNC(\"txgbe_set_lan_id_multi_port_pcie\");\n+\n+\treg = rd32(hw, TXGBE_PORTSTAT);\n+\tbus->lan_id = TXGBE_PORTSTAT_ID(reg);\n+\n+\t/* check for single port */\n+\treg = rd32(hw, TXGBE_PWR);\n+\tif (TXGBE_PWR_LANID_SWAP == TXGBE_PWR_LANID(reg))\n+\t\tbus->func = 0;\n+\telse\n+\t\tbus->func = bus->lan_id;\n+}\n+\n+s32 txgbe_init_shared_code(struct txgbe_hw *hw)\n+{\n+\ts32 status;\n+\n+\tDEBUGFUNC(\"txgbe_init_shared_code\");\n+\n+\t/*\n+\t * Set the mac type\n+\t */\n+\ttxgbe_set_mac_type(hw);\n+\n+\tswitch (hw->mac.type) {\n+\tcase txgbe_mac_raptor:\n+\t\tstatus = txgbe_init_ops_pf(hw);\n+\t\tbreak;\n+\tdefault:\n+\t\tstatus = TXGBE_ERR_DEVICE_NOT_SUPPORTED;\n+\t\tbreak;\n+\t}\n+\thw->mac.max_link_up_time = TXGBE_LINK_UP_TIME;\n+\n+\thw->bus.set_lan_id(hw);\n+\n+\treturn status;\n+}\n+\n+/**\n+ *  txgbe_set_mac_type - Sets MAC type\n+ *  @hw: pointer to the HW structure\n+ *\n+ *  This function sets the mac type of the adapter based on the\n+ *  vendor ID and device ID stored in the hw structure.\n+ **/\n+s32 txgbe_set_mac_type(struct txgbe_hw *hw)\n+{\n+\ts32 err = 0;\n+\n+\tDEBUGFUNC(\"txgbe_set_mac_type\\n\");\n+\n+\tif (hw->vendor_id != PCI_VENDOR_ID_WANGXUN) {\n+\t\tDEBUGOUT(\"Unsupported vendor id: %x\", hw->vendor_id);\n+\t\treturn TXGBE_ERR_DEVICE_NOT_SUPPORTED;\n+\t}\n+\n+\tswitch (hw->device_id) {\n+\tcase TXGBE_DEV_ID_RAPTOR_KR_KX_KX4:\n+\t\thw->phy.media_type = txgbe_media_type_backplane;\n+\t\thw->mac.type = txgbe_mac_raptor;\n+\t\tbreak;\n+\tcase TXGBE_DEV_ID_RAPTOR_XAUI:\n+\tcase TXGBE_DEV_ID_RAPTOR_SGMII:\n+\t\thw->phy.media_type = txgbe_media_type_copper;\n+\t\thw->mac.type = txgbe_mac_raptor;\n+\t\tbreak;\n+\tcase TXGBE_DEV_ID_RAPTOR_SFP:\n+\tcase TXGBE_DEV_ID_WX1820_SFP:\n+\t\thw->phy.media_type = txgbe_media_type_fiber;\n+\t\thw->mac.type = txgbe_mac_raptor;\n+\t\tbreak;\n+\tcase TXGBE_DEV_ID_RAPTOR_QSFP:\n+\t\thw->phy.media_type = txgbe_media_type_fiber_qsfp;\n+\t\thw->mac.type = txgbe_mac_raptor;\n+\t\tbreak;\n+\tcase TXGBE_DEV_ID_RAPTOR_VF:\n+\tcase TXGBE_DEV_ID_RAPTOR_VF_HV:\n+\t\thw->phy.media_type = txgbe_media_type_virtual;\n+\t\thw->mac.type = txgbe_mac_raptor_vf;\n+\t\tbreak;\n+\tdefault:\n+\t\terr = TXGBE_ERR_DEVICE_NOT_SUPPORTED;\n+\t\tDEBUGOUT(\"Unsupported device id: %x\", hw->device_id);\n+\t\tbreak;\n+\t}\n+\n+\tDEBUGOUT(\"txgbe_set_mac_type found mac: %d media: %d, returns: %d\\n\",\n+\t\t  hw->mac.type, hw->phy.media_type, err);\n+\treturn err;\n+}\n+\n+/**\n+ *  txgbe_init_ops_pf - Inits func ptrs and MAC type\n+ *  @hw: pointer to hardware structure\n+ *\n+ *  Initialize the function pointers and assign the MAC type.\n+ *  Does not touch the hardware.\n+ **/\n+s32 txgbe_init_ops_pf(struct txgbe_hw *hw)\n+{\n+\tstruct txgbe_bus_info *bus = &hw->bus;\n+\tstruct txgbe_mac_info *mac = &hw->mac;\n+\n+\tDEBUGFUNC(\"txgbe_init_ops_pf\");\n+\n+\t/* BUS */\n+\tbus->set_lan_id = txgbe_set_lan_id_multi_port;\n+\n+\tmac->num_rar_entries\t= TXGBE_RAPTOR_RAR_ENTRIES;\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/net/txgbe/base/txgbe_hw.h b/drivers/net/txgbe/base/txgbe_hw.h\nnew file mode 100644\nindex 000000000..f9cf2a8f0\n--- /dev/null\n+++ b/drivers/net/txgbe/base/txgbe_hw.h\n@@ -0,0 +1,16 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2015-2020\n+ */\n+\n+#ifndef _TXGBE_HW_H_\n+#define _TXGBE_HW_H_\n+\n+#include \"txgbe_type.h\"\n+\n+void txgbe_set_lan_id_multi_port(struct txgbe_hw *hw);\n+\n+s32 txgbe_init_shared_code(struct txgbe_hw *hw);\n+s32 txgbe_set_mac_type(struct txgbe_hw *hw);\n+s32 txgbe_init_ops_pf(struct txgbe_hw *hw);\n+\n+#endif /* _TXGBE_HW_H_ */\ndiff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h\nindex f310e154f..1bd3e45cd 100644\n--- a/drivers/net/txgbe/base/txgbe_type.h\n+++ b/drivers/net/txgbe/base/txgbe_type.h\n@@ -5,21 +5,166 @@\n #ifndef _TXGBE_TYPE_H_\n #define _TXGBE_TYPE_H_\n \n+#define TXGBE_LINK_UP_TIME\t90 /* 9.0 Seconds */\n+\n #define TXGBE_ALIGN\t\t\t\t128 /* as intel did */\n \n+#include \"txgbe_status.h\"\n #include \"txgbe_osdep.h\"\n #include \"txgbe_devids.h\"\n \n+enum txgbe_mac_type {\n+\ttxgbe_mac_unknown = 0,\n+\ttxgbe_mac_raptor,\n+\ttxgbe_mac_raptor_vf,\n+\ttxgbe_num_macs\n+};\n+\n+enum txgbe_phy_type {\n+\ttxgbe_phy_unknown = 0,\n+\ttxgbe_phy_none,\n+\ttxgbe_phy_tn,\n+\ttxgbe_phy_aq,\n+\ttxgbe_phy_ext_1g_t,\n+\ttxgbe_phy_cu_mtd,\n+\ttxgbe_phy_cu_unknown,\n+\ttxgbe_phy_qt,\n+\ttxgbe_phy_xaui,\n+\ttxgbe_phy_nl,\n+\ttxgbe_phy_sfp_tyco_passive,\n+\ttxgbe_phy_sfp_unknown_passive,\n+\ttxgbe_phy_sfp_unknown_active,\n+\ttxgbe_phy_sfp_avago,\n+\ttxgbe_phy_sfp_ftl,\n+\ttxgbe_phy_sfp_ftl_active,\n+\ttxgbe_phy_sfp_unknown,\n+\ttxgbe_phy_sfp_intel,\n+\ttxgbe_phy_qsfp_unknown_passive,\n+\ttxgbe_phy_qsfp_unknown_active,\n+\ttxgbe_phy_qsfp_intel,\n+\ttxgbe_phy_qsfp_unknown,\n+\ttxgbe_phy_sfp_unsupported, /* Enforce bit set with unsupported module */\n+\ttxgbe_phy_sgmii,\n+\ttxgbe_phy_fw,\n+\ttxgbe_phy_generic\n+};\n+\n+/*\n+ * SFP+ module type IDs:\n+ *\n+ * ID\tModule Type\n+ * =============\n+ * 0\tSFP_DA_CU\n+ * 1\tSFP_SR\n+ * 2\tSFP_LR\n+ * 3\tSFP_DA_CU_CORE0 - chip-specific\n+ * 4\tSFP_DA_CU_CORE1 - chip-specific\n+ * 5\tSFP_SR/LR_CORE0 - chip-specific\n+ * 6\tSFP_SR/LR_CORE1 - chip-specific\n+ */\n+enum txgbe_sfp_type {\n+\ttxgbe_sfp_type_unknown = 0,\n+\ttxgbe_sfp_type_da_cu,\n+\ttxgbe_sfp_type_sr,\n+\ttxgbe_sfp_type_lr,\n+\ttxgbe_sfp_type_da_cu_core0,\n+\ttxgbe_sfp_type_da_cu_core1,\n+\ttxgbe_sfp_type_srlr_core0,\n+\ttxgbe_sfp_type_srlr_core1,\n+\ttxgbe_sfp_type_da_act_lmt_core0,\n+\ttxgbe_sfp_type_da_act_lmt_core1,\n+\ttxgbe_sfp_type_1g_cu_core0,\n+\ttxgbe_sfp_type_1g_cu_core1,\n+\ttxgbe_sfp_type_1g_sx_core0,\n+\ttxgbe_sfp_type_1g_sx_core1,\n+\ttxgbe_sfp_type_1g_lx_core0,\n+\ttxgbe_sfp_type_1g_lx_core1,\n+\ttxgbe_sfp_type_not_present = 0xFFFE,\n+\ttxgbe_sfp_type_not_known = 0xFFFF\n+};\n+\n+enum txgbe_media_type {\n+\ttxgbe_media_type_unknown = 0,\n+\ttxgbe_media_type_fiber,\n+\ttxgbe_media_type_fiber_qsfp,\n+\ttxgbe_media_type_copper,\n+\ttxgbe_media_type_backplane,\n+\ttxgbe_media_type_cx4,\n+\ttxgbe_media_type_virtual\n+};\n+\n+/* PCI bus types */\n+enum txgbe_bus_type {\n+\ttxgbe_bus_type_unknown = 0,\n+\ttxgbe_bus_type_pci,\n+\ttxgbe_bus_type_pcix,\n+\ttxgbe_bus_type_pci_express,\n+\ttxgbe_bus_type_internal,\n+\ttxgbe_bus_type_reserved\n+};\n+\n+/* PCI bus speeds */\n+enum txgbe_bus_speed {\n+\ttxgbe_bus_speed_unknown\t= 0,\n+\ttxgbe_bus_speed_33\t= 33,\n+\ttxgbe_bus_speed_66\t= 66,\n+\ttxgbe_bus_speed_100\t= 100,\n+\ttxgbe_bus_speed_120\t= 120,\n+\ttxgbe_bus_speed_133\t= 133,\n+\ttxgbe_bus_speed_2500\t= 2500,\n+\ttxgbe_bus_speed_5000\t= 5000,\n+\ttxgbe_bus_speed_8000\t= 8000,\n+\ttxgbe_bus_speed_reserved\n+};\n+\n+/* PCI bus widths */\n+enum txgbe_bus_width {\n+\ttxgbe_bus_width_unknown\t= 0,\n+\ttxgbe_bus_width_pcie_x1\t= 1,\n+\ttxgbe_bus_width_pcie_x2\t= 2,\n+\ttxgbe_bus_width_pcie_x4\t= 4,\n+\ttxgbe_bus_width_pcie_x8\t= 8,\n+\ttxgbe_bus_width_32\t= 32,\n+\ttxgbe_bus_width_64\t= 64,\n+\ttxgbe_bus_width_reserved\n+};\n+\n+struct txgbe_hw;\n+\n+/* Bus parameters */\n+struct txgbe_bus_info {\n+\ts32 (*get_bus_info)(struct txgbe_hw *);\n+\tvoid (*set_lan_id)(struct txgbe_hw *);\n+\n+\tenum txgbe_bus_speed speed;\n+\tenum txgbe_bus_width width;\n+\tenum txgbe_bus_type type;\n+\n+\tu16 func;\n+\tu8 lan_id;\n+\tu16 instance_id;\n+};\n+\n struct txgbe_mac_info {\n+\tenum txgbe_mac_type type;\n \tu8 perm_addr[ETH_ADDR_LEN];\n \tu32 num_rar_entries;\n+\tu32  max_link_up_time;\n+};\n+\n+struct txgbe_phy_info {\n+\tenum txgbe_phy_type type;\n+\tenum txgbe_sfp_type sfp_type;\n+\tu32 media_type;\n };\n \n struct txgbe_hw {\n \tvoid IOMEM *hw_addr;\n \tvoid *back;\n \tstruct txgbe_mac_info mac;\n+\tstruct txgbe_phy_info phy;\n \n+\tstruct txgbe_bus_info bus;\n \tu16 device_id;\n \tu16 vendor_id;\n \tu16 subsystem_device_id;\n@@ -31,4 +176,5 @@ struct txgbe_hw {\n \tvoid IOMEM *isb_mem;\n };\n \n+#include \"txgbe_regs.h\"\n #endif /* _TXGBE_TYPE_H_ */\ndiff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c\nindex 508af8dc0..84e762864 100644\n--- a/drivers/net/txgbe/txgbe_ethdev.c\n+++ b/drivers/net/txgbe/txgbe_ethdev.c\n@@ -28,6 +28,22 @@ static const struct rte_pci_id pci_id_txgbe_map[] = {\n \n static const struct eth_dev_ops txgbe_eth_dev_ops;\n \n+static inline int\n+txgbe_is_sfp(struct txgbe_hw *hw)\n+{\n+\tswitch (hw->phy.type) {\n+\tcase txgbe_phy_sfp_avago:\n+\tcase txgbe_phy_sfp_ftl:\n+\tcase txgbe_phy_sfp_intel:\n+\tcase txgbe_phy_sfp_unknown:\n+\tcase txgbe_phy_sfp_tyco_passive:\n+\tcase txgbe_phy_sfp_unknown_passive:\n+\t\treturn 1;\n+\tdefault:\n+\t\treturn 0;\n+\t}\n+}\n+\n static int\n eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n {\n@@ -35,6 +51,7 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \tstruct txgbe_hw *hw = TXGBE_DEV_HW(eth_dev);\n \tstruct rte_intr_handle *intr_handle = &pci_dev->intr_handle;\n \tconst struct rte_memzone *mz;\n+\tint err;\n \n \tPMD_INIT_FUNC_TRACE();\n \n@@ -57,6 +74,13 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \thw->isb_dma = TMZ_PADDR(mz);\n \thw->isb_mem = TMZ_VADDR(mz);\n \n+\t/* Initialize the shared code (base driver) */\n+\terr = txgbe_init_shared_code(hw);\n+\tif (err != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Shared code init failed: %d\", err);\n+\t\treturn -EIO;\n+\t}\n+\n \t/* Allocate memory for storing MAC addresses */\n \teth_dev->data->mac_addrs = rte_zmalloc(\"txgbe\", RTE_ETHER_ADDR_LEN *\n \t\t\t\t\t       hw->mac.num_rar_entries, 0);\n@@ -87,6 +111,14 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)\n \t */\n \teth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;\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+\t\t\t     (int)hw->phy.sfp_type);\n+\telse\n+\t\tPMD_INIT_LOG(DEBUG, \"MAC: %d, PHY: %d\",\n+\t\t\t     (int)hw->mac.type, (int) hw->phy.type);\n+\n \tPMD_INIT_LOG(DEBUG, \"port %d vendorID=0x%x deviceID=0x%x\",\n \t\t     eth_dev->data->port_id, pci_dev->id.vendor_id,\n \t\t     pci_dev->id.device_id);\n",
    "prefixes": [
        "v2",
        "05/56"
    ]
}