get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127106,
    "url": "http://patches.dpdk.org/api/patches/127106/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230519083110.809913-5-wenjing.qiao@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": "<20230519083110.809913-5-wenjing.qiao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230519083110.809913-5-wenjing.qiao@intel.com",
    "date": "2023-05-19T08:31:07",
    "name": "[v4,4/7] common/idpf: enhance timestamp offload feature for ACC",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "86493087797841d1a890c9a31baeb7e4c1dd9504",
    "submitter": {
        "id": 2680,
        "url": "http://patches.dpdk.org/api/people/2680/?format=api",
        "name": "Wenjing Qiao",
        "email": "wenjing.qiao@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230519083110.809913-5-wenjing.qiao@intel.com/mbox/",
    "series": [
        {
            "id": 28088,
            "url": "http://patches.dpdk.org/api/series/28088/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28088",
            "date": "2023-05-19T08:31:03",
            "name": "fix idpf and cpfl timestamp",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/28088/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/127106/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/127106/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 D005142B47;\n\tFri, 19 May 2023 10:37:19 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 73EF742D51;\n\tFri, 19 May 2023 10:37:05 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 021B542D2D;\n Fri, 19 May 2023 10:37:03 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 May 2023 01:37:03 -0700",
            "from dpdk-wenjing-01.sh.intel.com ([10.67.118.161])\n by fmsmga004.fm.intel.com with ESMTP; 19 May 2023 01:37:01 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1684485424; x=1716021424;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=KcoauCa+T8bBnh9bHnHPnvUS1ER/ylUeJxpIjDv7Ifw=;\n b=SpTrH26Z9oGEWo6OodJLhPPXb+5W6+aTdMkCX8jv8gSDAT8wyw1ze/KU\n PDQvx0Ii8CJ33Dz8GK0roRXc1sjHZHWRSH0nfkn2IP4K2i8ZA8SmsbDdN\n tMzV3JHaJrWpP/j7yxw4DhIc6rKbPfGaApxDcpPUo2dR7A69z/fVBXH8C\n A96Cg8GjOToQPx9fv2DdIfV+cSks632v050ochAwwBhJXUR/1sTSV9AAQ\n cJQQjqaQUuZNS1lcDup+yESLB8+45f7Z/eSNN6flQhq+4QWtOaSXqx0sW\n 7uvA+w2c5GybbVu9J/KvJin+xQ6u4IQMrmayxM5jqHePSAG0BOgV7ph0C g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10714\"; a=\"354670399\"",
            "E=Sophos;i=\"6.00,176,1681196400\"; d=\"scan'208\";a=\"354670399\"",
            "E=McAfee;i=\"6600,9927,10714\"; a=\"772216246\"",
            "E=Sophos;i=\"6.00,176,1681196400\"; d=\"scan'208\";a=\"772216246\""
        ],
        "X-ExtLoop1": "1",
        "From": "Wenjing Qiao <wenjing.qiao@intel.com>",
        "To": "jingjing.wu@intel.com,\n\tbeilei.xing@intel.com,\n\tqi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org, mingxia.liu@intel.com,\n Wenjing Qiao <wenjing.qiao@intel.com>,\n stable@dpdk.org",
        "Subject": "[PATCH v4 4/7] common/idpf: enhance timestamp offload feature for ACC",
        "Date": "Fri, 19 May 2023 04:31:07 -0400",
        "Message-Id": "<20230519083110.809913-5-wenjing.qiao@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230519083110.809913-1-wenjing.qiao@intel.com>",
        "References": "<20230424091707.488045-2-wenjing.qiao@intel.com>\n <20230519083110.809913-1-wenjing.qiao@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "For ACC, getting main time from MTS registers by shared memory.\n\nNotice: it is a workaround, and it will be removed after generic\nsolution are provided.\n\nFixes: 8c6098afa075 (\"common/idpf: add Rx/Tx data path\")\nCc: stable@dpdk.org\n\nSigned-off-by: Wenjing Qiao <wenjing.qiao@intel.com>\n---\n drivers/common/idpf/base/idpf_osdep.h  | 48 ++++++++++++++++++++++++++\n drivers/common/idpf/idpf_common_rxtx.c | 30 +++++++++++++---\n drivers/common/idpf/meson.build        |  2 ++\n 3 files changed, 76 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/common/idpf/base/idpf_osdep.h b/drivers/common/idpf/base/idpf_osdep.h\nindex 2a817a9807..d1668aa603 100644\n--- a/drivers/common/idpf/base/idpf_osdep.h\n+++ b/drivers/common/idpf/base/idpf_osdep.h\n@@ -25,6 +25,13 @@\n #include <rte_io.h>\n #include <rte_compat.h>\n \n+#ifdef IDPF_ACC_TIMESTAMP\n+#include <stdio.h>\n+#include <fcntl.h>\n+#include <unistd.h>\n+#include <sys/mman.h>\n+#endif /* IDPF_ACC_TIMESTAMP */\n+\n #define INLINE inline\n #define STATIC static\n \n@@ -346,4 +353,45 @@ idpf_hweight32(u32 num)\n \n #endif\n \n+#ifdef IDPF_ACC_TIMESTAMP\n+#define IDPF_ACC_TIMESYNC_BASE_ADDR 0x480D500000\n+#define IDPF_ACC_GLTSYN_TIME_H (IDPF_ACC_TIMESYNC_BASE_ADDR + 0x1C)\n+#define IDPF_ACC_GLTSYN_TIME_L (IDPF_ACC_TIMESYNC_BASE_ADDR + 0x10)\n+\n+inline uint32_t\n+idpf_mmap_r32(uint64_t pa)\n+{\n+\tint fd;\n+\tvoid *bp, *vp;\n+\tuint32_t rval = 0xdeadbeef;\n+\tuint32_t ps, ml, of;\n+\n+\tfd = open(\"/dev/mem\", (O_RDWR | O_SYNC));\n+\tif (fd == -1) {\n+\t\tperror(\"/dev/mem\");\n+\t\treturn -1;\n+\t}\n+\tml = ps = getpagesize();\n+\tof = (uint32_t)pa & (ps - 1);\n+\tif (of + (sizeof(uint32_t) * 4) > ps)\n+\t\tml *= 2;\n+\tbp = mmap(NULL, ml, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, pa & ~(uint64_t)(ps - 1));\n+\tif (bp == MAP_FAILED) {\n+\t\tperror(\"mmap\");\n+\t\tgoto done;\n+\t}\n+\n+\tvp = (char *)bp + of;\n+\n+\trval = *(volatile uint32_t *)vp;\n+\tif (munmap(bp, ml) == -1)\n+\t\tperror(\"munmap\");\n+done:\n+\tclose(fd);\n+\n+\treturn rval;\n+}\n+\n+#endif /* IDPF_ACC_TIMESTAMP */\n+\n #endif /* _IDPF_OSDEP_H_ */\ndiff --git a/drivers/common/idpf/idpf_common_rxtx.c b/drivers/common/idpf/idpf_common_rxtx.c\nindex b487c2a8a6..13e94dda43 100644\n--- a/drivers/common/idpf/idpf_common_rxtx.c\n+++ b/drivers/common/idpf/idpf_common_rxtx.c\n@@ -354,12 +354,36 @@ idpf_qc_tx_queue_release(void *txq)\n static void\n idpf_dev_read_time_hw(void *cb_arg)\n {\n-#ifdef RTE_ARCH_X86_64\n \tstruct idpf_adapter *ad = (struct idpf_adapter *)cb_arg;\n \tuint32_t hi, lo, lo2;\n \tint rc = 0;\n+#ifndef IDPF_ACC_TIMESTAMP\n \tstruct idpf_hw *hw = &ad->hw;\n+#endif /*  !IDPF_ACC_TIMESTAMP */\n \n+#ifdef IDPF_ACC_TIMESTAMP\n+\n+\tlo = idpf_mmap_r32(IDPF_ACC_GLTSYN_TIME_L);\n+\thi = idpf_mmap_r32(IDPF_ACC_GLTSYN_TIME_H);\n+\tDRV_LOG(DEBUG, \"lo : %X,\", lo);\n+\tDRV_LOG(DEBUG, \"hi : %X,\", hi);\n+\t/*\n+\t * On typical system, the delta between lo and lo2 is ~1000ns,\n+\t * so 10000 seems a large-enough but not overly-big guard band.\n+\t */\n+\tif (lo > (UINT32_MAX - IDPF_TIMESYNC_REG_WRAP_GUARD_BAND))\n+\t\tlo2 = idpf_mmap_r32(IDPF_ACC_GLTSYN_TIME_L);\n+\telse\n+\t\tlo2 = lo;\n+\n+\tif (lo2 < lo) {\n+\t\tlo = idpf_mmap_r32(IDPF_ACC_GLTSYN_TIME_L);\n+\t\thi = idpf_mmap_r32(IDPF_ACC_GLTSYN_TIME_H);\n+\t}\n+\n+\tad->time_hw = ((uint64_t)hi << 32) | lo;\n+\n+#else  /* !IDPF_ACC_TIMESTAMP */\n \tIDPF_WRITE_REG(hw, GLTSYN_CMD_SYNC_0_0, PF_GLTSYN_CMD_SYNC_SHTIME_EN_M);\n \tIDPF_WRITE_REG(hw, GLTSYN_CMD_SYNC_0_0,\n \t\t       PF_GLTSYN_CMD_SYNC_EXEC_CMD_M | PF_GLTSYN_CMD_SYNC_SHTIME_EN_M);\n@@ -380,9 +404,7 @@ idpf_dev_read_time_hw(void *cb_arg)\n \t}\n \n \tad->time_hw = ((uint64_t)hi << 32) | lo;\n-#else  /* !RTE_ARCH_X86_64 */\n-\tad->time_hw = 0;\n-#endif /* RTE_ARCH_X86_64 */\n+#endif /* IDPF_ACC_TIMESTAMP */\n \n \t/* re-alarm watchdog */\n \trc = rte_eal_alarm_set(1000 * 1000, &idpf_dev_read_time_hw, cb_arg);\ndiff --git a/drivers/common/idpf/meson.build b/drivers/common/idpf/meson.build\nindex 80c8906f80..11682a27d5 100644\n--- a/drivers/common/idpf/meson.build\n+++ b/drivers/common/idpf/meson.build\n@@ -45,3 +45,5 @@ if arch_subdir == 'x86'\n endif\n \n subdir('base')\n+\n+ dpdk_conf.set('IDPF_ACC_TIMESTAMP', false)\n",
    "prefixes": [
        "v4",
        "4/7"
    ]
}