get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1304288,
    "url": "http://patchwork.ozlabs.org/api/patches/1304288/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200605170946.23494-1-anthony.l.nguyen@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200605170946.23494-1-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-06-05T17:09:43",
    "name": "[1/4] iavf: fix speed reporting over virtchnl",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "bc322ebcd29903b3e65b04fc9ae9aed06bfff776",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200605170946.23494-1-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 181598,
            "url": "http://patchwork.ozlabs.org/api/series/181598/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=181598",
            "date": "2020-06-05T17:09:45",
            "name": "[1/4] iavf: fix speed reporting over virtchnl",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/181598/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1304288/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1304288/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49dq2c4qRjz9sT5\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  6 Jun 2020 03:12:24 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 0B40C88B26;\n\tFri,  5 Jun 2020 17:12:23 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id AsmLKlEpaEFp; Fri,  5 Jun 2020 17:12:21 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id EB96E88933;\n\tFri,  5 Jun 2020 17:12:21 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by ash.osuosl.org (Postfix) with ESMTP id 150FA1BF30B\n for <intel-wired-lan@lists.osuosl.org>; Fri,  5 Jun 2020 17:12:19 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by silver.osuosl.org (Postfix) with ESMTP id E489120461\n for <intel-wired-lan@lists.osuosl.org>; Fri,  5 Jun 2020 17:12:18 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id rEbySLZXZeOt for <intel-wired-lan@lists.osuosl.org>;\n Fri,  5 Jun 2020 17:12:15 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by silver.osuosl.org (Postfix) with ESMTPS id C0E5C20371\n for <intel-wired-lan@lists.osuosl.org>; Fri,  5 Jun 2020 17:12:15 +0000 (UTC)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Jun 2020 10:12:15 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga006.jf.intel.com with ESMTP; 05 Jun 2020 10:12:14 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n OwH9JtYCV/66fsqIxCxjyBqnucZl7SZj0dRMkvghd/fY/8YpsmZ6DBFaqTWXCkDvUzKCdFe+JG\n 0Tf6EPyRQelg==",
            "\n UskvVIUhDjPyWCd1rgXqKK/p7b+4v5nY/+iQNf9nV34mzSlvvqtHr3AQuZateHRPTJbvsO+F7o\n lVTJn44IWBkg=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,477,1583222400\"; d=\"scan'208\";a=\"273530621\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri,  5 Jun 2020 10:09:43 -0700",
        "Message-Id": "<20200605170946.23494-1-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH 1/4] iavf: fix speed reporting over\n virtchnl",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Brett Creeley <brett.creeley@intel.com>\n\nLink speeds are communicated over virtchnl using an enum\nvirtchnl_link_speed. Currently, the highest link speed is 40Gbps which\nleaves us unable to reflect some speeds that an ice VF is capable of.\nThis causes link speed to be misreported on the iavf driver.\n\nAllow for communicating link speeds using Mbps so that the proper speed can\nbe reported for an ice VF. Moving away from the enum allows us to\ncommunicate future speed changes without requiring a new enum to be added.\n\nIn order to support communicating link speeds over virtchnl in Mbps the\nfollowing functionality was added:\n    - Added u32 link_speed_mbps in the iavf_adapter structure.\n    - Added the macro ADV_LINK_SUPPORT(_a) to determine if the VF\n      driver supports communicating link speeds in Mbps.\n    - Added the function iavf_get_vpe_link_status() to fill the\n      correct link_status in the event_data union based on the\n      ADV_LINK_SUPPORT(_a) macro.\n    - Added the function iavf_set_adapter_link_speed_from_vpe()\n      to determine whether or not to fill the u32 link_speed_mbps or\n      enum virtchnl_link_speed link_speed field in the iavf_adapter\n      structure based on the ADV_LINK_SUPPORT(_a) macro.\n    - Do not free vf_res in iavf_init_get_resources() as vf_res will be\n      accessed in iavf_get_link_ksettings(); memset to 0 instead. This\n      memory is subsequently freed in iavf_remove().\n\nFixes: 7c710869d64e (\"ice: Add handlers for VF netdevice operations\")\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Sergey Nemov <sergey.nemov@intel.com>\nSigned-off-by: Paul Greenwalt <paul.greenwalt@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/iavf/iavf.h        | 14 +++\n .../net/ethernet/intel/iavf/iavf_ethtool.c    | 14 ++-\n drivers/net/ethernet/intel/iavf/iavf_main.c   | 25 ++++--\n .../net/ethernet/intel/iavf/iavf_virtchnl.c   | 88 ++++++++++++++++---\n 4 files changed, 120 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h\nindex 563da1f95b67..56cd1a39a4b5 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf.h\n+++ b/drivers/net/ethernet/intel/iavf/iavf.h\n@@ -87,6 +87,10 @@ struct iavf_vsi {\n #define IAVF_HLUT_ARRAY_SIZE ((IAVF_VFQF_HLUT_MAX_INDEX + 1) * 4)\n #define IAVF_MBPS_DIVISOR\t125000 /* divisor to convert to Mbps */\n \n+#define IAVF_VIRTCHNL_VF_RESOURCE_SIZE (sizeof(struct virtchnl_vf_resource) + \\\n+\t\t\t\t\t(IAVF_MAX_VF_VSI * \\\n+\t\t\t\t\t sizeof(struct virtchnl_vsi_resource)))\n+\n /* MAX_MSIX_Q_VECTORS of these are allocated,\n  * but we only use one per queue-specific vector.\n  */\n@@ -306,6 +310,14 @@ struct iavf_adapter {\n \tbool netdev_registered;\n \tbool link_up;\n \tenum virtchnl_link_speed link_speed;\n+\t/* This is only populated if the VIRTCHNL_VF_CAP_ADV_LINK_SPEED is set\n+\t * in vf_res->vf_cap_flags. Use ADV_LINK_SUPPORT macro to determine if\n+\t * this field is valid. This field should be used going forward and the\n+\t * enum virtchnl_link_speed above should be considered the legacy way of\n+\t * storing/communicating link speeds.\n+\t */\n+\tu32 link_speed_mbps;\n+\n \tenum virtchnl_ops current_op;\n #define CLIENT_ALLOWED(_a) ((_a)->vf_res ? \\\n \t\t\t    (_a)->vf_res->vf_cap_flags & \\\n@@ -322,6 +334,8 @@ struct iavf_adapter {\n \t\t\tVIRTCHNL_VF_OFFLOAD_RSS_PF)))\n #define VLAN_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \\\n \t\t\t  VIRTCHNL_VF_OFFLOAD_VLAN)\n+#define ADV_LINK_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \\\n+\t\t\t      VIRTCHNL_VF_CAP_ADV_LINK_SPEED)\n \tstruct virtchnl_vf_resource *vf_res; /* incl. all VSIs */\n \tstruct virtchnl_vsi_resource *vsi_res; /* our LAN VSI */\n \tstruct virtchnl_version_info pf_version;\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\nindex 032cc590292d..60a3519713d4 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\n@@ -278,7 +278,18 @@ static int iavf_get_link_ksettings(struct net_device *netdev,\n \tethtool_link_ksettings_zero_link_mode(cmd, supported);\n \tcmd->base.autoneg = AUTONEG_DISABLE;\n \tcmd->base.port = PORT_NONE;\n-\t/* Set speed and duplex */\n+\tcmd->base.duplex = DUPLEX_FULL;\n+\n+\tif (ADV_LINK_SUPPORT(adapter)) {\n+\t\tif (adapter->link_speed_mbps &&\n+\t\t    adapter->link_speed_mbps < U32_MAX)\n+\t\t\tcmd->base.speed = adapter->link_speed_mbps;\n+\t\telse\n+\t\t\tcmd->base.speed = SPEED_UNKNOWN;\n+\n+\t\treturn 0;\n+\t}\n+\n \tswitch (adapter->link_speed) {\n \tcase IAVF_LINK_SPEED_40GB:\n \t\tcmd->base.speed = SPEED_40000;\n@@ -306,7 +317,6 @@ static int iavf_get_link_ksettings(struct net_device *netdev,\n \tdefault:\n \t\tbreak;\n \t}\n-\tcmd->base.duplex = DUPLEX_FULL;\n \n \treturn 0;\n }\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c\nindex 6d0174b88954..0e2be56081e1 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_main.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c\n@@ -1745,17 +1745,17 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter)\n \tstruct net_device *netdev = adapter->netdev;\n \tstruct pci_dev *pdev = adapter->pdev;\n \tstruct iavf_hw *hw = &adapter->hw;\n-\tint err = 0, bufsz;\n+\tint err;\n \n \tWARN_ON(adapter->state != __IAVF_INIT_GET_RESOURCES);\n \t/* aq msg sent, awaiting reply */\n \tif (!adapter->vf_res) {\n-\t\tbufsz = sizeof(struct virtchnl_vf_resource) +\n-\t\t\t(IAVF_MAX_VF_VSI *\n-\t\t\tsizeof(struct virtchnl_vsi_resource));\n-\t\tadapter->vf_res = kzalloc(bufsz, GFP_KERNEL);\n-\t\tif (!adapter->vf_res)\n+\t\tadapter->vf_res = kzalloc(IAVF_VIRTCHNL_VF_RESOURCE_SIZE,\n+\t\t\t\t\t  GFP_KERNEL);\n+\t\tif (!adapter->vf_res) {\n+\t\t\terr = -ENOMEM;\n \t\t\tgoto err;\n+\t\t}\n \t}\n \terr = iavf_get_vf_config(adapter);\n \tif (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK) {\n@@ -2025,7 +2025,7 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)\n \tiavf_reset_interrupt_capability(adapter);\n \tiavf_free_queues(adapter);\n \tiavf_free_q_vectors(adapter);\n-\tkfree(adapter->vf_res);\n+\tmemset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);\n \tiavf_shutdown_adminq(&adapter->hw);\n \tadapter->netdev->flags &= ~IFF_UP;\n \tclear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);\n@@ -2476,6 +2476,16 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter,\n {\n \tint speed = 0, ret = 0;\n \n+\tif (ADV_LINK_SUPPORT(adapter)) {\n+\t\tif (adapter->link_speed_mbps < U32_MAX) {\n+\t\t\tspeed = adapter->link_speed_mbps;\n+\t\t\tgoto validate_bw;\n+\t\t} else {\n+\t\t\tdev_err(&adapter->pdev->dev, \"Unknown link speed\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \tswitch (adapter->link_speed) {\n \tcase IAVF_LINK_SPEED_40GB:\n \t\tspeed = 40000;\n@@ -2499,6 +2509,7 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter,\n \t\tbreak;\n \t}\n \n+validate_bw:\n \tif (max_tx_rate > speed) {\n \t\tdev_err(&adapter->pdev->dev,\n \t\t\t\"Invalid tx rate specified\\n\");\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\nindex d58374c2c33d..ca79bec4ebd9 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\n@@ -139,7 +139,8 @@ int iavf_send_vf_config_msg(struct iavf_adapter *adapter)\n \t       VIRTCHNL_VF_OFFLOAD_ENCAP |\n \t       VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM |\n \t       VIRTCHNL_VF_OFFLOAD_REQ_QUEUES |\n-\t       VIRTCHNL_VF_OFFLOAD_ADQ;\n+\t       VIRTCHNL_VF_OFFLOAD_ADQ |\n+\t       VIRTCHNL_VF_CAP_ADV_LINK_SPEED;\n \n \tadapter->current_op = VIRTCHNL_OP_GET_VF_RESOURCES;\n \tadapter->aq_required &= ~IAVF_FLAG_AQ_GET_CONFIG;\n@@ -891,6 +892,8 @@ void iavf_disable_vlan_stripping(struct iavf_adapter *adapter)\n \tiavf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING, NULL, 0);\n }\n \n+#define IAVF_MAX_SPEED_STRLEN\t13\n+\n /**\n  * iavf_print_link_message - print link up or down\n  * @adapter: adapter structure\n@@ -900,37 +903,99 @@ void iavf_disable_vlan_stripping(struct iavf_adapter *adapter)\n static void iavf_print_link_message(struct iavf_adapter *adapter)\n {\n \tstruct net_device *netdev = adapter->netdev;\n-\tchar *speed = \"Unknown \";\n+\tint link_speed_mbps;\n+\tchar *speed;\n \n \tif (!adapter->link_up) {\n \t\tnetdev_info(netdev, \"NIC Link is Down\\n\");\n \t\treturn;\n \t}\n \n+\tspeed = kcalloc(1, IAVF_MAX_SPEED_STRLEN, GFP_KERNEL);\n+\tif (!speed)\n+\t\treturn;\n+\n+\tif (ADV_LINK_SUPPORT(adapter)) {\n+\t\tlink_speed_mbps = adapter->link_speed_mbps;\n+\t\tgoto print_link_msg;\n+\t}\n+\n \tswitch (adapter->link_speed) {\n \tcase IAVF_LINK_SPEED_40GB:\n-\t\tspeed = \"40 G\";\n+\t\tlink_speed_mbps = SPEED_40000;\n \t\tbreak;\n \tcase IAVF_LINK_SPEED_25GB:\n-\t\tspeed = \"25 G\";\n+\t\tlink_speed_mbps = SPEED_25000;\n \t\tbreak;\n \tcase IAVF_LINK_SPEED_20GB:\n-\t\tspeed = \"20 G\";\n+\t\tlink_speed_mbps = SPEED_20000;\n \t\tbreak;\n \tcase IAVF_LINK_SPEED_10GB:\n-\t\tspeed = \"10 G\";\n+\t\tlink_speed_mbps = SPEED_10000;\n \t\tbreak;\n \tcase IAVF_LINK_SPEED_1GB:\n-\t\tspeed = \"1000 M\";\n+\t\tlink_speed_mbps = SPEED_1000;\n \t\tbreak;\n \tcase IAVF_LINK_SPEED_100MB:\n-\t\tspeed = \"100 M\";\n+\t\tlink_speed_mbps = SPEED_100;\n \t\tbreak;\n \tdefault:\n+\t\tlink_speed_mbps = SPEED_UNKNOWN;\n \t\tbreak;\n \t}\n \n-\tnetdev_info(netdev, \"NIC Link is Up %sbps Full Duplex\\n\", speed);\n+print_link_msg:\n+\tif (link_speed_mbps > SPEED_1000) {\n+\t\tif (link_speed_mbps == SPEED_2500)\n+\t\t\tsnprintf(speed, IAVF_MAX_SPEED_STRLEN, \"2.5 Gbps\");\n+\t\telse\n+\t\t\t/* convert to Gbps inline */\n+\t\t\tsnprintf(speed, IAVF_MAX_SPEED_STRLEN, \"%d %s\",\n+\t\t\t\t link_speed_mbps / 1000, \"Gbps\");\n+\t} else if (link_speed_mbps == SPEED_UNKNOWN) {\n+\t\tsnprintf(speed, IAVF_MAX_SPEED_STRLEN, \"%s\", \"Unknown Mbps\");\n+\t} else {\n+\t\tsnprintf(speed, IAVF_MAX_SPEED_STRLEN, \"%u %s\",\n+\t\t\t link_speed_mbps, \"Mbps\");\n+\t}\n+\n+\tnetdev_info(netdev, \"NIC Link is Up Speed is %s Full Duplex\\n\", speed);\n+\tkfree(speed);\n+}\n+\n+/**\n+ * iavf_get_vpe_link_status\n+ * @adapter: adapter structure\n+ * @vpe: virtchnl_pf_event structure\n+ *\n+ * Helper function for determining the link status\n+ **/\n+static bool\n+iavf_get_vpe_link_status(struct iavf_adapter *adapter,\n+\t\t\t struct virtchnl_pf_event *vpe)\n+{\n+\tif (ADV_LINK_SUPPORT(adapter))\n+\t\treturn vpe->event_data.link_event_adv.link_status;\n+\telse\n+\t\treturn vpe->event_data.link_event.link_status;\n+}\n+\n+/**\n+ * iavf_set_adapter_link_speed_from_vpe\n+ * @adapter: adapter structure for which we are setting the link speed\n+ * @vpe: virtchnl_pf_event structure that contains the link speed we are setting\n+ *\n+ * Helper function for setting iavf_adapter link speed\n+ **/\n+static void\n+iavf_set_adapter_link_speed_from_vpe(struct iavf_adapter *adapter,\n+\t\t\t\t     struct virtchnl_pf_event *vpe)\n+{\n+\tif (ADV_LINK_SUPPORT(adapter))\n+\t\tadapter->link_speed_mbps =\n+\t\t\tvpe->event_data.link_event_adv.link_speed;\n+\telse\n+\t\tadapter->link_speed = vpe->event_data.link_event.link_speed;\n }\n \n /**\n@@ -1160,12 +1225,11 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,\n \tif (v_opcode == VIRTCHNL_OP_EVENT) {\n \t\tstruct virtchnl_pf_event *vpe =\n \t\t\t(struct virtchnl_pf_event *)msg;\n-\t\tbool link_up = vpe->event_data.link_event.link_status;\n+\t\tbool link_up = iavf_get_vpe_link_status(adapter, vpe);\n \n \t\tswitch (vpe->event) {\n \t\tcase VIRTCHNL_EVENT_LINK_CHANGE:\n-\t\t\tadapter->link_speed =\n-\t\t\t\tvpe->event_data.link_event.link_speed;\n+\t\t\tiavf_set_adapter_link_speed_from_vpe(adapter, vpe);\n \n \t\t\t/* we've already got the right link status, bail */\n \t\t\tif (adapter->link_up == link_up)\n",
    "prefixes": [
        "1/4"
    ]
}