get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64477,
    "url": "http://patches.dpdk.org/api/patches/64477/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200113023949.26718-14-xiaolong.ye@intel.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": "<20200113023949.26718-14-xiaolong.ye@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200113023949.26718-14-xiaolong.ye@intel.com",
    "date": "2020-01-13T02:39:25",
    "name": "[v4,13/36] net/i40e/base: read LPI status from external PHY",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0b3a0ca79c0e19bdfb324d2a50a6671b59e9d7a1",
    "submitter": {
        "id": 1120,
        "url": "http://patches.dpdk.org/api/people/1120/?format=api",
        "name": "Xiaolong Ye",
        "email": "xiaolong.ye@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200113023949.26718-14-xiaolong.ye@intel.com/mbox/",
    "series": [
        {
            "id": 8064,
            "url": "http://patches.dpdk.org/api/series/8064/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8064",
            "date": "2020-01-13T02:39:12",
            "name": "update for i40e base code",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/8064/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64477/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64477/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 00A39A04F0;\n\tMon, 13 Jan 2020 03:49:06 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 117191D5D9;\n\tMon, 13 Jan 2020 03:47:38 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id BB7A21D590\n for <dev@dpdk.org>; Mon, 13 Jan 2020 03:47:18 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2020 18:47:18 -0800",
            "from dpdk_yexl_af_xdp.sh.intel.com ([10.67.119.206])\n by FMSMGA003.fm.intel.com with ESMTP; 12 Jan 2020 18:47:17 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,427,1571727600\"; d=\"scan'208\";a=\"272916347\"",
        "From": "Xiaolong Ye <xiaolong.ye@intel.com>",
        "To": "Beilei Xing <beilei.xing@intel.com>,\n\tQi Zhang <qi.z.zhang@intel.com>",
        "Cc": "dev@dpdk.org, Xiaolong Ye <xiaolong.ye@intel.com>,\n Krzysztof Galazka <krzysztof.galazka@intel.com>,\n Piotr Pietruszewski <piotr.pietruszewski@intel.com>",
        "Date": "Mon, 13 Jan 2020 10:39:25 +0800",
        "Message-Id": "<20200113023949.26718-14-xiaolong.ye@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200113023949.26718-1-xiaolong.ye@intel.com>",
        "References": "<20191202074935.97629-1-xiaolong.ye@intel.com>\n <20200113023949.26718-1-xiaolong.ye@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 13/36] net/i40e/base: read LPI status from\n\texternal PHY",
        "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": "When external PHY is used, MAC register may not reflect actual\nstate of LPI. Add function reading it directly from PHY or MAC,\ndepending on what is supported by the device.\n\nSigned-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>\nSigned-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>\nSigned-off-by: Xiaolong Ye <xiaolong.ye@intel.com>\n---\n drivers/net/i40e/base/i40e_common.c    | 45 ++++++++++++++++++++++++++\n drivers/net/i40e/base/i40e_prototype.h |  2 ++\n drivers/net/i40e/base/i40e_type.h      |  6 ++++\n 3 files changed, 53 insertions(+)",
    "diff": "diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c\nindex c2e7cf7d5..f256651d7 100644\n--- a/drivers/net/i40e/base/i40e_common.c\n+++ b/drivers/net/i40e/base/i40e_common.c\n@@ -6982,6 +6982,51 @@ enum i40e_status_code i40e_led_set_phy(struct i40e_hw *hw, bool on,\n \treturn status;\n }\n #endif /* PF_DRIVER */\n+/**\n+ * i40e_get_phy_lpi_status - read LPI status from PHY or MAC register\n+ * @hw: pointer to the hw struct\n+ * @stat: pointer to structure with status of rx and tx lpi\n+ *\n+ * Read LPI state directly from external PHY register or from MAC\n+ * register, depending on device ID and current link speed.\n+ */\n+enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw,\n+\t\t\t\t\t      struct i40e_hw_port_stats *stat)\n+{\n+\tenum i40e_status_code ret = I40E_SUCCESS;\n+\tu32 val;\n+\n+\tstat->rx_lpi_status = 0;\n+\tstat->tx_lpi_status = 0;\n+\n+\tif (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC &&\n+\t    (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB ||\n+\t     hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) {\n+\t\tret = i40e_aq_get_phy_register(hw,\n+\t\t\t\t\t       I40E_AQ_PHY_REG_ACCESS_EXTERNAL,\n+\t\t\t\t\t       I40E_BCM_PHY_PCS_STATUS1_PAGE,\n+\t\t\t\t\t       true,\n+\t\t\t\t\t       I40E_BCM_PHY_PCS_STATUS1_REG,\n+\t\t\t\t\t       &val, NULL);\n+\n+\t\tif (ret != I40E_SUCCESS)\n+\t\t\treturn ret;\n+\n+\t\tstat->rx_lpi_status = !!(val & I40E_BCM_PHY_PCS_STATUS1_RX_LPI);\n+\t\tstat->tx_lpi_status = !!(val & I40E_BCM_PHY_PCS_STATUS1_TX_LPI);\n+\n+\t\treturn ret;\n+\t}\n+\n+\tval = rd32(hw, I40E_PRTPM_EEE_STAT);\n+\tstat->rx_lpi_status = (val & I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_MASK) >>\n+\t\t\t       I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_SHIFT;\n+\tstat->tx_lpi_status = (val & I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_MASK) >>\n+\t\t\t       I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_SHIFT;\n+\n+\treturn ret;\n+}\n+\n \n /**\n  * i40e_aq_rx_ctl_read_register - use FW to read from an Rx control register\ndiff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h\nindex 38beb270b..c6c45eb5a 100644\n--- a/drivers/net/i40e/base/i40e_prototype.h\n+++ b/drivers/net/i40e/base/i40e_prototype.h\n@@ -74,6 +74,8 @@ enum i40e_status_code i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr,\n enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw,\n \t\t\t\t\t      u32 time, u32 interval);\n \n+enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw,\n+\t\t\t\t\t      struct i40e_hw_port_stats *stats);\n /* admin send queue commands */\n \n enum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,\ndiff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h\nindex 322300fa3..8d257e00a 100644\n--- a/drivers/net/i40e/base/i40e_type.h\n+++ b/drivers/net/i40e/base/i40e_type.h\n@@ -2038,4 +2038,10 @@ struct i40e_profile_info {\n \tu8 reserved[7];\n \tu8 name[I40E_DDP_NAME_SIZE];\n };\n+\n+#define I40E_BCM_PHY_PCS_STATUS1_PAGE\t0x3\n+#define I40E_BCM_PHY_PCS_STATUS1_REG\t0x0001\n+#define I40E_BCM_PHY_PCS_STATUS1_RX_LPI\tBIT(8)\n+#define I40E_BCM_PHY_PCS_STATUS1_TX_LPI\tBIT(9)\n+\n #endif /* _I40E_TYPE_H_ */\n",
    "prefixes": [
        "v4",
        "13/36"
    ]
}