From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2EDFA10DA for ; Fri, 2 Aug 2019 10:58:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C0981C234; Fri, 2 Aug 2019 10:58:44 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 0959B1C228 for ; Fri, 2 Aug 2019 10:58:43 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id n9so51271295wrr.4 for ; Fri, 02 Aug 2019 01:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexatech-fr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=URTxIu2XJjess3YPsZerIsLIUAm6CcTy9ZEmEggOglU=; b=ifdTiINSWD6IMvWgY7kSc1cQCIbsF363iast4L7e619PsUM9VhUctCN1V832INv9Xc UOrQWcQTvMzj2kuueV5T9zqxsd8FP3jqiwqQH2RuN45rbmtOr2nOZR8f9mCdGLkpzRWl 2aa0U+lq1hg1Q+x9LwfnVmKmwYJSQNA77VInyz3YRi7bK9c/7C9K8rgWfwtiXjCPVmMY 7IJgVzapdsNTHIAhy4YLNnUlbIb+k2bdJ3PqjSkNp3w831+bOUqsaxEC0JBPB2Lh70n4 qtVae1skOGdUUXAMgHi0KrNu4FwjxM1bb8t9e02aea+KcJuj0t03lBjndgfFPQcqpVL9 wDCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=URTxIu2XJjess3YPsZerIsLIUAm6CcTy9ZEmEggOglU=; b=n5mFtVkDZqVdPJsG1TcmZ0WYjJSF7kJKTCGwTc1hWHZIaI1PhBxCdQJvcKFEYUtfqy RH+9XJlr5A+Meb1sKyTHZ0MHA+LQrSaym8W89Jx9PBx3KG6CXg9URBjfnH2Kbs4jTbYl Cpl7FinYe3r1UkIw962Be90jXp+w7EnScdEw88ZwgwdyfjngYfm0DNwh6/JyFSSH/tnP 9gRpsJ1oTvqh7CskmP6WenR/sFl6KuwdLciAdx54er544YTE/J1x1oJYVWXRMAWTtB/c q6W0K7U4HuTdwSdyCtQbmTla0DWARcLq+IctaiiV1As2dnaAWKmYHRW9fX7W0mcj7O81 upFg== X-Gm-Message-State: APjAAAVbGltdQdjxCbCXfFhJ1jktaiOMKgrT1/laBZ7M7WM1wG15QUD2 hUu+PwsEeQt8/odmDP3cEsZpNQ== X-Google-Smtp-Source: APXvYqwG1b0cTHeDqYbeQ4uN+Xo0Mc7MCkDMGHgU/MFFAyjJY6ijhp8Nq38i+HL+2jgB1dvYHNN41Q== X-Received: by 2002:adf:e790:: with SMTP id n16mr127267696wrm.120.1564736322716; Fri, 02 Aug 2019 01:58:42 -0700 (PDT) Received: from cyrodiil.nexatech.local (128.60.136.77.rev.sfr.net. [77.136.60.128]) by smtp.googlemail.com with ESMTPSA id o20sm191996296wrh.8.2019.08.02.01.58.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Aug 2019 01:58:41 -0700 (PDT) From: Sylvain Rodon X-Google-Original-From: Sylvain Rodon To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Sylvain Rodon Date: Fri, 2 Aug 2019 10:57:23 +0200 Message-Id: <1564736244-5906-1-git-send-email-s.rodon@mail.nexatech.local> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1564586321-22818-1-git-send-email-s.rodon@mail.nexatech.local> References: <1564586321-22818-1-git-send-email-s.rodon@mail.nexatech.local> Subject: [dpdk-dev] [PATCH v2] net/pcap: propagate timestamp from pcap_pkthdr to mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sylvain Rodon Timestamp is always set in PCAP header, whether it reads a file or listen on an interface. This information can be important for some applications and it cannot be obtained otherwise (especially when reading a PCAP file, where the timestamp is not the current time). Timestamp here is the number of microseconds since epoch. Signed-off-by: Sylvain Rodon --- v2: * Be more compliant about DPDK patch rules drivers/net/pcap/rte_eth_pcap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 95d4b5b..5489010 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -265,6 +265,9 @@ struct pmd_devargs_all { } mbuf->pkt_len = (uint16_t)header.caplen; + mbuf->timestamp = (uint64_t)header.ts.tv_sec * 1000000 + + header.ts.tv_usec; + mbuf->ol_flags |= PKT_RX_TIMESTAMP; mbuf->port = pcap_q->port_id; bufs[num_rx] = mbuf; num_rx++; -- 1.9.1