Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/71064/?format=api
https://patches.dpdk.org/api/patches/71064/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200609141713.11614-4-patrick.keroulas@radio-canada.ca/", "project": { "id": 1, "url": "https://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": "<20200609141713.11614-4-patrick.keroulas@radio-canada.ca>", "list_archive_url": "https://inbox.dpdk.org/dev/20200609141713.11614-4-patrick.keroulas@radio-canada.ca", "date": "2020-06-09T14:17:13", "name": "[RFC,v1,3/3] net/pcap: dump hardware timestamps", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a524de67bd71fc970a46b7cdc406f6211e8359da", "submitter": { "id": 1776, "url": "https://patches.dpdk.org/api/people/1776/?format=api", "name": "Patrick Keroulas", "email": "patrick.keroulas@radio-canada.ca" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200609141713.11614-4-patrick.keroulas@radio-canada.ca/mbox/", "series": [ { "id": 10361, "url": "https://patches.dpdk.org/api/series/10361/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10361", "date": "2020-06-09T14:17:10", "name": "pdump HW timestamps for mlx5", "version": 1, "mbox": "https://patches.dpdk.org/series/10361/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/71064/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/71064/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 C6885A04FE;\n\tTue, 9 Jun 2020 16:18:11 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 61D2B1BED0;\n\tTue, 9 Jun 2020 16:17:58 +0200 (CEST)", "from mail-qk1-f194.google.com (mail-qk1-f194.google.com\n [209.85.222.194]) by dpdk.org (Postfix) with ESMTP id 33A701BEC3\n for <dev@dpdk.org>; Tue, 9 Jun 2020 16:17:57 +0200 (CEST)", "by mail-qk1-f194.google.com with SMTP id v79so20857465qkb.10\n for <dev@dpdk.org>; Tue, 09 Jun 2020 07:17:57 -0700 (PDT)", "from localhost.localdomain (104-163-142-249.qc.dsl.ebox.net.\n [104.163.142.249])\n by smtp.gmail.com with ESMTPSA id a82sm10287148qkb.29.2020.06.09.07.17.55\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 09 Jun 2020 07:17:55 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=radio-canada-ca.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=bbumoIL1GQDHiCjr2O5eAilHqbnCE0Ruv4WLPro2G3o=;\n b=zN4HyzOYQS/LrzRdC256gxgLYSluP+GbLp6VkQQaV1Wn4pTvckQPJsHy2oUzSx5y0W\n YPwMNnr94vjccTHNQ0GEjRcdAwXB8SwaNwaaNTgFYZFhgQH9Zy51SYsDbHZRUiajfu4n\n KnduSu7+pBaTJdrlYs84ek6h+VpFg+I3Du9VXrF0m2T61hpBJRYSaIxwrjuX3xke90hi\n MxwGGW65bjMVWyBOiRK45cdWMBvE3fwClwOIw/cMsVbjxyGhsWXecz+01+iHM4b81Aln\n 4H4l3KO36mdrynr7Fzc6lw3MsTB+kNsICnrV0zOtOZxKE9d3/8nlurge4dOM+o0/6ShN\n SliQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references;\n bh=bbumoIL1GQDHiCjr2O5eAilHqbnCE0Ruv4WLPro2G3o=;\n b=YyCnDAJwbzodZoyeiLIRCsEH1ZhB9wItx0CVvilEvBJ13BFNmHuDIFa5CTX/2vvtl2\n elE/KzTSdr1p/QJW09EhJvm55D1c6DbhK0v6KZHav6q8lZ9J67PKoD54Z9Sar0PRNNhJ\n KmIoh3hb5KAa4j2BRWUDFmgtvmJybZEPxKL7oVVdLkage3C4OVgFpwEcPhju+bMTPpmS\n bLYkC+t8oUEoaIOIGj1oufpIti/wlBJPiIxWL6UyDXofEz2vAx6aYdHSbeEFsjSKd9FA\n NorNAbQDo5GFkJtclks1tF+dkogGSh/FPj1Gk9e2EstTRrqq1tS4UzuLYl3j9nxp18Fr\n c2rw==", "X-Gm-Message-State": "AOAM532lVnpqBtQp9SM/6I9VjyDm5hnMshCoSC2pb/L5OQvaT78gTFzg\n hfk3pJgMNjqjzpkUTZmc1WopxJtM70nU6w==", "X-Google-Smtp-Source": "\n ABdhPJz7djA/CYd0MkNN0+XTTmSD0zB18nVvZIWJdTxymviQdcGbnbvuyRqsIsJteQRBQOrSz/3QbA==", "X-Received": "by 2002:a37:b883:: with SMTP id\n i125mr27762400qkf.392.1591712276220;\n Tue, 09 Jun 2020 07:17:56 -0700 (PDT)", "From": "Patrick Keroulas <patrick.keroulas@radio-canada.ca>", "To": "dev@dpdk.org", "Cc": "Patrick Keroulas <patrick.keroulas@radio-canada.ca>,\n Vivien Didelot <vivien.didelot@gmail.com>", "Date": "Tue, 9 Jun 2020 10:17:13 -0400", "Message-Id": "<20200609141713.11614-4-patrick.keroulas@radio-canada.ca>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200609141713.11614-1-patrick.keroulas@radio-canada.ca>", "References": "<20200609141713.11614-1-patrick.keroulas@radio-canada.ca>", "Subject": "[dpdk-dev] [RFC] [PATCH v1 3/3] net/pcap: dump hardware timestamps", "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 hardware timestamping is activated, system time should no longer be\nused to timestamp dumped the packets. Instead, use value held by\nforwarded and assume they were converted to nanoseconds.\n\nSigned-off-by: Patrick Keroulas <patrick.keroulas@radio-canada.ca>\nSigned-off-by: Vivien Didelot <vivien.didelot@gmail.com>\n---\n drivers/net/pcap/rte_eth_pcap.c | 32 ++++++++++++++++++++++----------\n 1 file changed, 22 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c\nindex b4c79d174..1303e3338 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -45,6 +45,8 @@\n \n #define RTE_PMD_PCAP_MAX_QUEUES 16\n \n+#define NSEC_PER_SEC\t1000000000L\n+\n static char errbuf[PCAP_ERRBUF_SIZE];\n static struct timeval start_time;\n static uint64_t start_cycles;\n@@ -288,14 +290,24 @@ eth_null_rx(void *queue __rte_unused,\n }\n \n static inline void\n-calculate_timestamp(struct timeval *ts) {\n-\tuint64_t cycles;\n-\tstruct timeval cur_time;\n-\n-\tcycles = rte_get_timer_cycles() - start_cycles;\n-\tcur_time.tv_sec = cycles / hz;\n-\tcur_time.tv_usec = (cycles % hz) * 1e6 / hz;\n-\ttimeradd(&start_time, &cur_time, ts);\n+calculate_timestamp(const struct rte_mbuf *mbuf, struct timeval *ts) {\n+\tif (mbuf->ol_flags & PKT_RX_TIMESTAMP) {\n+\t\t/* timestamp unit is nanoseconds but must fit in timeval */\n+\t\tts->tv_sec = mbuf->timestamp / NSEC_PER_SEC;\n+\t\tts->tv_usec = mbuf->timestamp % NSEC_PER_SEC;\n+\t}\n+\telse {\n+\t\tuint64_t cycles = rte_get_timer_cycles() - start_cycles;\n+\t\tstruct timeval cur_time;\n+\t\tcur_time.tv_sec = cycles / hz;\n+\t\tcur_time.tv_usec = (cycles % hz) * NSEC_PER_SEC / hz;\n+\t\tts->tv_sec = start_time.tv_sec + cur_time.tv_sec;\n+\t\tts->tv_usec = start_time.tv_usec + cur_time.tv_usec;\n+\t\tif (ts->tv_usec > NSEC_PER_SEC) {\n+\t\t\tts->tv_usec -= NSEC_PER_SEC;\n+\t\t\tts->tv_sec += 1;\n+\t\t}\n+\t}\n }\n \n /*\n@@ -331,7 +343,7 @@ eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n \t\t\tcaplen = sizeof(temp_data);\n \t\t}\n \n-\t\tcalculate_timestamp(&header.ts);\n+\t\tcalculate_timestamp(mbuf, &header.ts);\n \t\theader.len = len;\n \t\theader.caplen = caplen;\n \t\t/* rte_pktmbuf_read() returns a pointer to the data directly\n@@ -475,7 +487,7 @@ open_single_tx_pcap(const char *pcap_filename, pcap_dumper_t **dumper)\n \t * with pcap_dump_open(). We create big enough an Ethernet\n \t * pcap holder.\n \t */\n-\ttx_pcap = pcap_open_dead(DLT_EN10MB, RTE_ETH_PCAP_SNAPSHOT_LEN);\n+\ttx_pcap = pcap_open_dead_with_tstamp_precision(DLT_EN10MB, RTE_ETH_PCAP_SNAPSHOT_LEN, PCAP_TSTAMP_PRECISION_NANO);\n \tif (tx_pcap == NULL) {\n \t\tPMD_LOG(ERR, \"Couldn't create dead pcap\");\n \t\treturn -1;\n", "prefixes": [ "RFC", "v1", "3/3" ] }{ "id": 71064, "url": "