On Fri, Apr 28, 2017 at 15:31 +0200, Mike Belopuhov wrote:
> One of the prerequisites for FQ_CoDel is ability to track packet
> enqueue time.  To avoid allocating per-packet mbuf tags, I'd prefer
> to include the timestamp directly into the packet header structure.
> This can be later used for other purposes as well if need be.  OK?
> 

As it appears, there's an argument to use a single 64 bit integer
instead.  Whether use a signed or value or not is debatable, but
here's an argument to go for signed: time_t, timespec and timeval
are all signed.  I didn't specify the desired precision in the
comment here and left it up to the implementation

OK?

---
 sys/sys/mbuf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git sys/sys/mbuf.h sys/sys/mbuf.h
index 202ce8ced8b..7ca1a779fe0 100644
--- sys/sys/mbuf.h
+++ sys/sys/mbuf.h
@@ -127,10 +127,11 @@ struct    pkthdr {
        u_int16_t                ph_flowid;     /* pseudo unique flow id */
        u_int16_t                csum_flags;    /* checksum flags */
        u_int16_t                ether_vtag;    /* Ethernet 802.1p+Q vlan tag */
        u_int                    ph_rtableid;   /* routing table id */
        u_int                    ph_ifidx;      /* rcv interface index */
+       int64_t                  ph_timestamp;  /* packet timestamp */
        u_int8_t                 ph_loopcnt;    /* mbuf is looping in kernel */
        struct pkthdr_pf         pf;
 };
 
 /* description of external storage mapped into mbuf, valid if M_EXT set */
-- 
2.12.2


Reply via email to