DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dor Green <dorgreen1@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] Saving packet timestamp when reading from pcap
Date: Mon, 20 Apr 2015 19:06:13 +0300	[thread overview]
Message-ID: <CAKedurzVNNGiZ_q-mYxRVS-jfW7=bpoTH-vY3gJM3Sk68QZOqQ@mail.gmail.com> (raw)

To test my program and for some other uses I sometimes use vdev
(libpcap pmd) to read data from a pcap file.

Those tests would be a lot easier if the packet timestamp (which is in
the cap) was supplied by DPDK, but alas it is not.

So I could access it, I placed it in mbuf's userdata for the timebeing.
In rte_eth_pcap.c I added this after line 171:
 mbuf->userdata = (void*) header.ts.tv_sec;
Obviously this isn't the prettiest and it lacks the microseconds the
struct supplies.

Does anyone have any better ideas on how to do it, or is this a
feature planned for any future version (seems easy enough to add some
more fields to the mbuf struct to accommodate this, and maybe in the
future hardware timestamps, etc.?)

Thanks, Dor.

             reply	other threads:[~2015-04-20 16:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 16:06 Dor Green [this message]
2015-04-21 10:50 ` Nicolas Pernas Maradei
2015-04-21 12:02   ` Dor Green

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKedurzVNNGiZ_q-mYxRVS-jfW7=bpoTH-vY3gJM3Sk68QZOqQ@mail.gmail.com' \
    --to=dorgreen1@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).