get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53058,
    "url": "http://patches.dpdk.org/api/patches/53058/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190424173424.34628-3-barbette@kth.se/",
    "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": "<20190424173424.34628-3-barbette@kth.se>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190424173424.34628-3-barbette@kth.se",
    "date": "2019-04-24T17:34:23",
    "name": "[v3,2/3] mlx5: Implement support for read_clock",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "15a7f338b6e3875c3187de5f0a6ed9b6f36415d2",
    "submitter": {
        "id": 1155,
        "url": "http://patches.dpdk.org/api/people/1155/?format=api",
        "name": "Tom Barbette",
        "email": "barbette@kth.se"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190424173424.34628-3-barbette@kth.se/mbox/",
    "series": [
        {
            "id": 4453,
            "url": "http://patches.dpdk.org/api/series/4453/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4453",
            "date": "2019-04-24T17:34:21",
            "name": "Add rte_eth_read_clock API",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/4453/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53058/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/53058/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8662D1B555;\n\tWed, 24 Apr 2019 19:35:18 +0200 (CEST)",
            "from smtp-4.sys.kth.se (smtp-4.sys.kth.se [130.237.48.193])\n\tby dpdk.org (Postfix) with ESMTP id D1D251B544\n\tfor <dev@dpdk.org>; Wed, 24 Apr 2019 19:35:13 +0200 (CEST)",
            "from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])\n\tby smtp-4.sys.kth.se (Postfix) with ESMTP id 6A177668E;\n\tWed, 24 Apr 2019 19:35:13 +0200 (CEST)",
            "from smtp-4.sys.kth.se ([127.0.0.1])\n\tby smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith LMTP id tls5tBMGpz1p; Wed, 24 Apr 2019 19:35:12 +0200 (CEST)",
            "from nslrack14.ssvl.kth.se (nslrack14.ssvl.kth.se [192.16.125.174])\n\tby smtp-4.sys.kth.se (Postfix) with ESMTPSA id 4E43A6691;\n\tWed, 24 Apr 2019 19:35:12 +0200 (CEST)"
        ],
        "X-Virus-Scanned": "by amavisd-new at kth.se",
        "X-KTH-Auth": "barbette [192.16.125.174]",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default;\n\tt=1556127312; bh=XwA7sY5VC5En+PTNbS51Fz9VHp5vB1MTHgNIMBIAkVk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=Qpcys58IHbNXEMjp+hqpB57ge3dVQJWjWzT1C+F+j5BQA2KAtewhnh3N7gjxvSDT5\n\tiiSgkMlBgh8E72sipxLTUqmioJrvrslswrZF/W2u5QD7G7uAdFkKX58KH+zcmVqKiL\n\t/4BdRYBBuGI0HFwy4sPAZRYGAtqq4weP0FsyCWCE=",
        "X-KTH-mail-from": "barbette@kth.se",
        "From": "Tom Barbette <barbette@kth.se>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, john.mcnamara@intel.com,\n\tThomas Monjalon <thomas@monjalon.net>,\n\tFerruh Yigit <ferruh.yigit@intel.com>,\n\tAndrew Rybchenko <arybchenko@solarflare.com>,\n\tShahaf Shuler <shahafs@mellanox.com>, Yongseok Koh <yskoh@mellanox.com>, \n\tolivier.matz@6wind.com, Tom Barbette <barbette@kth.se>",
        "Date": "Wed, 24 Apr 2019 17:34:23 +0000",
        "Message-Id": "<20190424173424.34628-3-barbette@kth.se>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190424173424.34628-1-barbette@kth.se>",
        "References": "<20190424173424.34628-1-barbette@kth.se>",
        "Subject": "[dpdk-dev] [PATCH v3 2/3] mlx5: Implement support for read_clock",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Implements support for read_clock for the mlx5 driver. mlx5 supports\nhardware timestamp offload, setting packets timestamp field to the\ndevice clock. rte_eth_read_clock allows to read the device's current\nclock value and therefore compare values on similar time base.\n\nSee rxtx_callbacks for an example.\n\nSigned-off-by: Tom Barbette <barbette@kth.se>\nAcked-by: Shahaf Shuler <shahafs@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c        |  1 +\n drivers/net/mlx5/mlx5.h        |  1 +\n drivers/net/mlx5/mlx5_ethdev.c | 30 ++++++++++++++++++++++++++++++\n drivers/net/mlx5/mlx5_glue.c   |  8 ++++++++\n drivers/net/mlx5/mlx5_glue.h   |  2 ++\n 5 files changed, 42 insertions(+)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 46ca08a4d..947943346 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -748,6 +748,7 @@ const struct eth_dev_ops mlx5_dev_ops = {\n \t.xstats_get_names = mlx5_xstats_get_names,\n \t.fw_version_get = mlx5_fw_version_get,\n \t.dev_infos_get = mlx5_dev_infos_get,\n+\t.read_clock = mlx5_read_clock,\n \t.dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get,\n \t.vlan_filter_set = mlx5_vlan_filter_set,\n \t.rx_queue_setup = mlx5_rx_queue_setup,\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 0a6d7f1d5..9602001ce 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -403,6 +403,7 @@ int mlx5_set_flags(struct rte_eth_dev *dev, unsigned int keep,\n \t\t   unsigned int flags);\n int mlx5_dev_configure(struct rte_eth_dev *dev);\n void mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info);\n+int mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *time);\n int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size);\n const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev);\n int mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete);\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex 57a64495d..00906f99d 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -564,6 +564,36 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n \t}\n }\n \n+/**\n+ * Get device current raw clock counter\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param[out] time\n+ *   Current raw clock counter of the device.\n+ *\n+ * @return\n+ *   0 if the clock has correctly been read\n+ *   The value of errno in case of error\n+ */\n+int\n+mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock)\n+{\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct ibv_context *ctx = priv->sh->ctx;\n+\tstruct ibv_values_ex values;\n+\tint err = 0;\n+\n+\tvalues.comp_mask = IBV_VALUES_MASK_RAW_CLOCK;\n+\terr = mlx5_glue->query_rt_values_ex(ctx, &values);\n+\tif (err != 0) {\n+\t\tDRV_LOG(WARNING, \"Could not query the clock !\");\n+\t\treturn err;\n+\t}\n+\t*clock = values.raw_clock.tv_nsec;\n+\treturn 0;\n+}\n+\n /**\n  * Get firmware version of a device.\n  *\ndiff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c\nindex b32cd09c3..c1c650cff 100644\n--- a/drivers/net/mlx5/mlx5_glue.c\n+++ b/drivers/net/mlx5/mlx5_glue.c\n@@ -87,6 +87,13 @@ mlx5_glue_query_device_ex(struct ibv_context *context,\n \treturn ibv_query_device_ex(context, input, attr);\n }\n \n+static int\n+mlx5_glue_query_rt_values_ex(struct ibv_context *context,\n+\t\t\t  struct ibv_values_ex *values)\n+{\n+\treturn ibv_query_rt_values_ex(context, values);\n+}\n+\n static int\n mlx5_glue_query_port(struct ibv_context *context, uint8_t port_num,\n \t\t     struct ibv_port_attr *port_attr)\n@@ -834,6 +841,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){\n \t.close_device = mlx5_glue_close_device,\n \t.query_device = mlx5_glue_query_device,\n \t.query_device_ex = mlx5_glue_query_device_ex,\n+\t.query_rt_values_ex = mlx5_glue_query_rt_values_ex,\n \t.query_port = mlx5_glue_query_port,\n \t.create_comp_channel = mlx5_glue_create_comp_channel,\n \t.destroy_comp_channel = mlx5_glue_destroy_comp_channel,\ndiff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h\nindex 1d06583f4..e76e0b7af 100644\n--- a/drivers/net/mlx5/mlx5_glue.h\n+++ b/drivers/net/mlx5/mlx5_glue.h\n@@ -83,6 +83,8 @@ struct mlx5_glue {\n \tint (*query_device_ex)(struct ibv_context *context,\n \t\t\t       const struct ibv_query_device_ex_input *input,\n \t\t\t       struct ibv_device_attr_ex *attr);\n+\tint (*query_rt_values_ex)(struct ibv_context *context,\n+\t\t\t       struct ibv_values_ex *values);\n \tint (*query_port)(struct ibv_context *context, uint8_t port_num,\n \t\t\t  struct ibv_port_attr *port_attr);\n \tstruct ibv_comp_channel *(*create_comp_channel)\n",
    "prefixes": [
        "v3",
        "2/3"
    ]
}