]> git.baikalelectronics.ru Git - kernel.git/commit
net: add function to retrieve original skb device using NAPI ID
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 19 May 2017 15:52:37 +0000 (17:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 May 2017 17:37:32 +0000 (13:37 -0400)
commit9f1566ffc57c1e92563eb6b591470c732adb2256
treeb6ce4214ce48199983704bf95540370472b5da44
parent6bfee137ecf67589c551575cf6cc9fe8d2ab54c8
net: add function to retrieve original skb device using NAPI ID

Since commit bc1611f0eb4e ("net: Make skb->skb_iif always track
skb->dev") skbs don't have the original index of the interface which
received the packet. This information is now needed for a new control
message related to hardware timestamping.

Instead of adding a new field to skb, we can find the device by the NAPI
ID if it is available, i.e. CONFIG_NET_RX_BUSY_POLL is enabled and the
driver is using NAPI. Add dev_get_by_napi_id() and also skb_napi_id() to
hide the CONFIG_NET_RX_BUSY_POLL ifdef.

CC: Richard Cochran <richardcochran@gmail.com>
Suggested-by: Willem de Bruijn <willemb@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
include/linux/skbuff.h
net/core/dev.c