[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170425135642.GB27148@localhost>
Date: Tue, 25 Apr 2017 15:56:42 +0200
From: Miroslav Lichvar <mlichvar@...hat.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Network Development <netdev@...r.kernel.org>,
Richard Cochran <richardcochran@...il.com>,
Willem de Bruijn <willemb@...gle.com>,
Soheil Hassas Yeganeh <soheil@...gle.com>,
"Keller, Jacob E" <jacob.e.keller@...el.com>,
Denny Page <dennypage@...com>, Jiri Benc <jbenc@...hat.com>
Subject: Re: [RFC PATCH 3/7] net: add option to get information about
timestamped packets
On Mon, Apr 24, 2017 at 11:18:13AM -0400, Willem de Bruijn wrote:
> On Mon, Apr 24, 2017 at 5:00 AM, Miroslav Lichvar <mlichvar@...hat.com> wrote:
> > Would "skb->data - skb->head -
> > skb->mac_header + skb->len" always work as the L2 length for received
> > packets at the time when the cmsg is prepared?
>
> (skb->data - skb->head) - skb->mac_header computes the length
> of data before the mac, such as reserve?
data - head includes the reserve, but mac_header does too, so I think
it should be just the length of MAC header and everything up to the
data.
> Do you mean skb->data -
> skb->mac_header (or - skb_mac_offset(skb))?
That would give me a pointer? If I used skb_mac_offset(), the total
length would be just skb->len - skb_mac_offset()?
> > As for the original ifindex, it seems to me it does need to be saved
> > to a new field since __netif_receive_skb_core() intentionally
> > overwrites skb->skb_iif. What would be the best place for it, sk_buff
> > or skb_shared_info?
>
> Finding storage space on the receive path will not be easy.
>
> One shortcut to avoid storing this information explicitly is to look up
> the device from skb->napi_id.
Thanks. This looks promising. It will depend on CONFIG_NET_RX_BUSY_POLL,
but I guess that's ok. It nicely isolates all costs to the timestamping
option.
--
Miroslav Lichvar
Powered by blists - more mailing lists