Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126359/?format=api
http://patchwork.dpdk.org/api/patches/126359/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230421071603.55680-5-wenjing.qiao@intel.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": "<20230421071603.55680-5-wenjing.qiao@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230421071603.55680-5-wenjing.qiao@intel.com", "date": "2023-04-21T07:16:00", "name": "[v2,4/7] common/idpf: support timestamp offload feature for ACC", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "991e82f02b6164b3f64a1ee6dc9be29d22ce0c89", "submitter": { "id": 2680, "url": "http://patchwork.dpdk.org/api/people/2680/?format=api", "name": "Wenjing Qiao", "email": "wenjing.qiao@intel.com" }, "delegate": { "id": 1540, "url": "http://patchwork.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230421071603.55680-5-wenjing.qiao@intel.com/mbox/", "series": [ { "id": 27811, "url": "http://patchwork.dpdk.org/api/series/27811/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27811", "date": "2023-04-21T07:15:56", "name": "update idpf and cpfl timestamp", "version": 2, "mbox": "http://patchwork.dpdk.org/series/27811/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/126359/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/126359/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 824CF429A9;\n\tFri, 21 Apr 2023 09:21:42 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2767142D38;\n\tFri, 21 Apr 2023 09:21:18 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id BF72E42BD9\n for <dev@dpdk.org>; Fri, 21 Apr 2023 09:21:12 +0200 (CEST)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Apr 2023 00:21:05 -0700", "from dpdk-wenjing-01.sh.intel.com ([10.67.118.239])\n by fmsmga008.fm.intel.com with ESMTP; 21 Apr 2023 00:21:04 -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=1682061672; x=1713597672;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=Ha9BBjRAjqjBpYJ+isaz0rP5gncladtenoixdoZ3E3s=;\n b=KYloa9w0Ec4iO0HA8A9kwlwG5GOcPoQhoLzrOn7NpPaT2niRdVHS0KbD\n stDJXNGEYqy+jq6SoCyCyv0C8Ldk+8dpWgxzeQqrDkAqG37FhWHMmD9iR\n 0wktshA4WOiMCESc9GRIzVnxiQA15jdveu8zjcVA9R+YcpaxxLwl77zVC\n ax+f0hojq/ZNPz1sCnvwFj/AzP3eIfrHGHVLLF9cy0MTHc4fGeGkYcykj\n q+8JmERmX4QTePNXqshLt+dw1PU+F8jgngLMKcexQ+OvnvmG95UQ8YelY\n m2+kKy0UFwT4TP/AgKYw82wSPf/Mbh/AYfK5/KzuOY7iTJWn/DQYZrv1N A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10686\"; a=\"343425011\"", "E=Sophos;i=\"5.99,214,1677571200\"; d=\"scan'208\";a=\"343425011\"", "E=McAfee;i=\"6600,9927,10686\"; a=\"756811924\"", "E=Sophos;i=\"5.99,214,1677571200\"; d=\"scan'208\";a=\"756811924\"" ], "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,\n\tWenjing Qiao <wenjing.qiao@intel.com>", "Subject": "[PATCH v2 4/7] common/idpf: support timestamp offload feature for ACC", "Date": "Fri, 21 Apr 2023 03:16:00 -0400", "Message-Id": "<20230421071603.55680-5-wenjing.qiao@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230421071603.55680-1-wenjing.qiao@intel.com>", "References": "<20230420091935.43116-2-wenjing.qiao@intel.com>\n <20230421071603.55680-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\nSigned-off-by: Wenjing Qiao <wenjing.qiao@intel.com>\n---\n config/meson.build | 3 ++\n drivers/common/idpf/base/idpf_osdep.h | 48 ++++++++++++++++++++++++++\n drivers/common/idpf/idpf_common_rxtx.c | 30 +++++++++++++---\n meson_options.txt | 2 ++\n 4 files changed, 79 insertions(+), 4 deletions(-)", "diff": "diff --git a/config/meson.build b/config/meson.build\nindex fa730a1b14..8d74f301b4 100644\n--- a/config/meson.build\n+++ b/config/meson.build\n@@ -316,6 +316,9 @@ endif\n if get_option('mbuf_refcnt_atomic')\n dpdk_conf.set('RTE_MBUF_REFCNT_ATOMIC', true)\n endif\n+if get_option('enable_acc_timestamp')\n+ dpdk_conf.set('IDPF_ACC_TIMESTAMP', true)\n+endif\n dpdk_conf.set10('RTE_IOVA_IN_MBUF', get_option('enable_iova_as_pa'))\n \n compile_time_cpuflags = []\ndiff --git a/drivers/common/idpf/base/idpf_osdep.h b/drivers/common/idpf/base/idpf_osdep.h\nindex 99ae9cf60a..e634939a51 100644\n--- a/drivers/common/idpf/base/idpf_osdep.h\n+++ b/drivers/common/idpf/base/idpf_osdep.h\n@@ -24,6 +24,13 @@\n #include <rte_random.h>\n #include <rte_io.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@@ -361,4 +368,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 19bcb94077..9c58f3fb11 100644\n--- a/drivers/common/idpf/idpf_common_rxtx.c\n+++ b/drivers/common/idpf/idpf_common_rxtx.c\n@@ -1582,12 +1582,36 @@ idpf_qc_splitq_rx_vec_setup(struct idpf_rx_queue *rxq)\n 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@@ -1608,9 +1632,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/meson_options.txt b/meson_options.txt\nindex 82c8297065..31fc634aa0 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -52,3 +52,5 @@ option('tests', type: 'boolean', value: true, description:\n 'build unit tests')\n option('use_hpet', type: 'boolean', value: false, description:\n 'use HPET timer in EAL')\n+option('enable_acc_timestamp', type: 'boolean', value: false, description:\n+ 'enable timestamp on ACC.')\n", "prefixes": [ "v2", "4/7" ] }{ "id": 126359, "url": "