get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130462,
    "url": "http://patchwork.dpdk.org/api/patches/130462/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230817084226.55327-3-lihuisong@huawei.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230817084226.55327-3-lihuisong@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230817084226.55327-3-lihuisong@huawei.com",
    "date": "2023-08-17T08:42:26",
    "name": "[v3,2/2] ethdev: add the check for the valitity of timestamp offload",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "73f850d932bac229922c41a1424cda8571d0e080",
    "submitter": {
        "id": 2085,
        "url": "http://patchwork.dpdk.org/api/people/2085/?format=api",
        "name": "lihuisong (C)",
        "email": "lihuisong@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230817084226.55327-3-lihuisong@huawei.com/mbox/",
    "series": [
        {
            "id": 29261,
            "url": "http://patchwork.dpdk.org/api/series/29261/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29261",
            "date": "2023-08-17T08:42:25",
            "name": "ethdev: add the check for PTP capability",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/29261/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/130462/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/130462/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 608264308C;\n\tThu, 17 Aug 2023 10:45:36 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 40F2543254;\n\tThu, 17 Aug 2023 10:45:27 +0200 (CEST)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 9645A40685\n for <dev@dpdk.org>; Thu, 17 Aug 2023 10:45:24 +0200 (CEST)",
            "from kwepemm600004.china.huawei.com (unknown [172.30.72.53])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RRJS14fQmzVkqr;\n Thu, 17 Aug 2023 16:43:13 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Thu, 17 Aug 2023 16:45:20 +0800"
        ],
        "From": "Huisong Li <lihuisong@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>,\n <andrew.rybchenko@oktetlabs.ru>, <liuyonglong@huawei.com>,\n <lihuisong@huawei.com>",
        "Subject": "[PATCH v3 2/2] ethdev: add the check for the valitity of timestamp\n offload",
        "Date": "Thu, 17 Aug 2023 16:42:26 +0800",
        "Message-ID": "<20230817084226.55327-3-lihuisong@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20230817084226.55327-1-lihuisong@huawei.com>",
        "References": "<20220628133959.21381-1-liudongdong3@huawei.com>\n <20230817084226.55327-1-lihuisong@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n kwepemm600004.china.huawei.com (7.193.23.242)",
        "X-CFilter-Loop": "Reflected",
        "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"
    },
    "content": "This patch adds the check for the valitity of timestamp offload.\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\n---\n lib/ethdev/rte_ethdev.c | 57 ++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 56 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex 0840d2b594..77fa71047a 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -5996,6 +5996,34 @@ rte_eth_dev_set_mc_addr_list(uint16_t port_id,\n \treturn ret;\n }\n \n+static int\n+rte_eth_timestamp_offload_valid(struct rte_eth_dev *dev)\n+{\n+\tstruct rte_eth_dev_info dev_info;\n+\tstruct rte_eth_rxmode *rxmode;\n+\tint ret;\n+\n+\tret = rte_eth_dev_info_get(dev->data->port_id, &dev_info);\n+\tif (ret != 0) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Cannot get port (%u) device information.\\n\",\n+\t\t\t       dev->data->port_id);\n+\t\treturn ret;\n+\t}\n+\n+\tif ((dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_TIMESTAMP) == 0) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Driver does not support PTP.\\n\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\trxmode = &dev->data->dev_conf.rxmode;\n+\tif ((rxmode->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) == 0) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Please enable 'RTE_ETH_RX_OFFLOAD_TIMESTAMP' offload.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n rte_eth_timesync_enable(uint16_t port_id)\n {\n@@ -6005,6 +6033,10 @@ rte_eth_timesync_enable(uint16_t port_id)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_enable == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev));\n@@ -6023,6 +6055,10 @@ rte_eth_timesync_disable(uint16_t port_id)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_disable == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev));\n@@ -6049,6 +6085,10 @@ rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp,\n \t\treturn -EINVAL;\n \t}\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_read_rx_timestamp == NULL)\n \t\treturn -ENOTSUP;\n \n@@ -6078,9 +6118,12 @@ rte_eth_timesync_read_tx_timestamp(uint16_t port_id,\n \t\treturn -EINVAL;\n \t}\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_read_tx_timestamp == NULL)\n \t\treturn -ENOTSUP;\n-\n \tret = eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp)\n \t\t\t       (dev, timestamp));\n \n@@ -6099,6 +6142,10 @@ rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_adjust_time == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, delta));\n@@ -6124,6 +6171,10 @@ rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp)\n \t\treturn -EINVAL;\n \t}\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_read_time == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev,\n@@ -6150,6 +6201,10 @@ rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp)\n \t\treturn -EINVAL;\n \t}\n \n+\tret = rte_eth_timestamp_offload_valid(dev);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n \tif (*dev->dev_ops->timesync_write_time == NULL)\n \t\treturn -ENOTSUP;\n \tret = eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev,\n",
    "prefixes": [
        "v3",
        "2/2"
    ]
}