[dpdk-dev,v11,5/7] mbuf: add a timestamp to the mbuf for latencystats

Message ID 1489076734-31474-6-git-send-email-remy.horton@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Remy Horton March 9, 2017, 4:25 p.m. UTC
  From: Harry van Haaren <harry.van.haaren@intel.com>

This commit adds a uint64_t to the mbuf struct,
allowing collection of latency and jitter statistics
by measuring packet I/O timestamps. This change is
required by the latencystats library.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 lib/librte_mbuf/rte_mbuf.h | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Stephen Hemminger March 9, 2017, 7:02 p.m. UTC | #1
On Thu,  9 Mar 2017 16:25:32 +0000
Remy Horton <remy.horton@intel.com> wrote:

> From: Harry van Haaren <harry.van.haaren@intel.com>
> 
> This commit adds a uint64_t to the mbuf struct,
> allowing collection of latency and jitter statistics
> by measuring packet I/O timestamps. This change is
> required by the latencystats library.
> 
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>  lib/librte_mbuf/rte_mbuf.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index ce57d47..e0dad6e 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -514,6 +514,9 @@ struct rte_mbuf {
>  
>  	/** Timesync flags for use with IEEE1588. */
>  	uint16_t timesync;
> +
> +	/** Timestamp for measuring latency. */
> +	uint64_t timestamp;
>  } __rte_cache_aligned;
>  
>  /**

This creates a hole in the mbuf structure, and won't apply to current
version of mbuf that has priv_size.
  
Van Haaren, Harry March 10, 2017, 9:48 a.m. UTC | #2
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Cc: dev@dpdk.org; Van Haaren, Harry <harry.van.haaren@intel.com>; Thomas Monjalon
> <thomas.monjalon@6wind.com>; Pattan, Reshma <reshma.pattan@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v11 5/7] mbuf: add a timestamp to the mbuf for
> latencystats
> 
> On Thu,  9 Mar 2017 16:25:32 +0000
> Remy Horton <remy.horton@intel.com> wrote:
> 
> > From: Harry van Haaren <harry.van.haaren@intel.com>
> >
> > This commit adds a uint64_t to the mbuf struct,
> > allowing collection of latency and jitter statistics
> > by measuring packet I/O timestamps. This change is
> > required by the latencystats library.
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> > Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> > ---
> >  lib/librte_mbuf/rte_mbuf.h | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > index ce57d47..e0dad6e 100644
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -514,6 +514,9 @@ struct rte_mbuf {
> >
> >  	/** Timesync flags for use with IEEE1588. */
> >  	uint16_t timesync;
> > +
> > +	/** Timestamp for measuring latency. */
> > +	uint64_t timestamp;
> >  } __rte_cache_aligned;
> >
> >  /**
> 
> This creates a hole in the mbuf structure, and won't apply to current
> version of mbuf that has priv_size.

This series was previously targeted to 17.02 when the mbuf rework was on the horizon, so placement of the timestamp was not as critical as it is now. Given the mbuf rework[1] is currently in progress, perhaps it is smarter to remove this patch from the patchset and depend on the mbuf rework patchset to add the timestamp instead.

The latency stat library should probably also set the new PKT_RX_TIMESTAMP field in the mbuf[2].

[1] mbuf rework    http://dpdk.org/dev/patchwork/patch/21601/
[2] mbuf timestamp http://dpdk.org/dev/patchwork/patch/21607/
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index ce57d47..e0dad6e 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -514,6 +514,9 @@  struct rte_mbuf {
 
 	/** Timesync flags for use with IEEE1588. */
 	uint16_t timesync;
+
+	/** Timestamp for measuring latency. */
+	uint64_t timestamp;
 } __rte_cache_aligned;
 
 /**