[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 12 Nov 2008 01:15:08 +0200
From: Octavian Purdila <opurdila@...acom.com>
To: Patrick Ohly <patrick.ohly@...el.com>
Cc: netdev@...r.kernel.org, Stephen Hemminger <shemminger@...tta.com>,
Ingo Oeser <netdev@...eo.de>, Andi Kleen <ak@...ux.intel.com>,
John Ronciak <john.ronciak@...el.com>,
Eric Dumazet <dada1@...mosbay.com>,
Oliver Hartkopp <oliver@...tkopp.net>
Subject: Re: [RFC PATCH 04/13] net: implement generic SOF_TIMESTAMPING_TX_* support
From: Patrick Ohly <patrick.ohly@...el.com>
Date: Fri, 24 Oct 2008 15:41:34 +0200
> + if (dev) {
> + skb_hwtstamp_set(skb,
> + dev->hwtstamp_raw2sys ?
> + dev->hwtstamp_raw2sys(dev, stamp) :
> + stamp);
> + } else {
> + skb->tstamp = stamp;
> +#if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR)
> + skb->tstamp.tv.sec = skb->tstamp.tv.sec / 2 * 2;
> +#else
> + skb->tstamp.tv64 = skb->tstamp.tv64 / 2 * 2;
> +#endif
> + }
> +
I think the addition of the following bits will be of use to applications:
serr = SKB_EXT_ERR(skb);
serr->ee.ee_origin = SO_EE_ORIGIN_TXTSTAMP;
serr->ee.ee_mac = skb->mac.raw - skb->data;
serr->ee.ee_network = skb->nh.raw - skb->data;
serr->ee.ee_transport = skb->h.raw - skb->data;
For example, for UDP PTP we don't have to manually skip the ethernet (and take
into account VLANs) and IP headers.
Thanks,
tavi
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists