* ip_list_rcv() question
@ 2021-10-07 12:14 Stephen Suryaputra
2021-10-13 16:17 ` Edward Cree
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Suryaputra @ 2021-10-07 12:14 UTC (permalink / raw)
To: netdev
Hi,
Under what condition that ip_list_rcv() would restart the sublist, i.e.
that the skb in the list is having different skb->dev?
void ip_list_rcv(struct list_head *head, struct packet_type *pt,
struct net_device *orig_dev)
{
...
list_for_each_entry_safe(skb, next, head, list) {
...
if (curr_dev != dev || curr_net != net) {
/* dispatch old sublist */
...
/* start new sublist */
...
}
...
}
...
}
In my system, the function gets called from the following call chain:
net_rx_action()->napi_poll()->gro_normal_list()
It seems to me that there is one to one relationship between napi_struct
and net_device, but I saw an archived discussion about it might be one
to many. But I didn't see it.
Thanks in advance for the clarifications.
Regards,
Stephen.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ip_list_rcv() question
2021-10-07 12:14 ip_list_rcv() question Stephen Suryaputra
@ 2021-10-13 16:17 ` Edward Cree
2021-10-14 14:42 ` Stephen Suryaputra
0 siblings, 1 reply; 3+ messages in thread
From: Edward Cree @ 2021-10-13 16:17 UTC (permalink / raw)
To: Stephen Suryaputra; +Cc: Network Development
On 07/10/2021 13:14, Stephen Suryaputra wrote:
> Under what condition that ip_list_rcv() would restart the sublist, i.e.
> that the skb in the list is having different skb->dev?
IIRC, something earlier in the call chain (possibly
__netif_receive_skb_core()?) can change skb->dev to something other
than the device that originally received the packet (orig_dev). I
think it's if the packet gets handled/transformed by a software
netdevice (maybe a VLAN device?).
But really when I wrote ip_list_rcv() I just worked on the basis
that "I don't know it can't change, so I shall assume it can".
HTH,
-ed
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ip_list_rcv() question
2021-10-13 16:17 ` Edward Cree
@ 2021-10-14 14:42 ` Stephen Suryaputra
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Suryaputra @ 2021-10-14 14:42 UTC (permalink / raw)
To: Edward Cree; +Cc: Network Development
On Wed, Oct 13, 2021 at 05:17:51PM +0100, Edward Cree wrote:
> On 07/10/2021 13:14, Stephen Suryaputra wrote:
> > Under what condition that ip_list_rcv() would restart the sublist, i.e.
> > that the skb in the list is having different skb->dev?
>
> IIRC, something earlier in the call chain (possibly
> __netif_receive_skb_core()?) can change skb->dev to something other
> than the device that originally received the packet (orig_dev). I
> think it's if the packet gets handled/transformed by a software
> netdevice (maybe a VLAN device?).
> But really when I wrote ip_list_rcv() I just worked on the basis
> that "I don't know it can't change, so I shall assume it can".
I see now that vlan_do_receive() changes the skb->dev. It didn't occur
to me because __netif_receive_skb_list_core() has a similar logic for
dispatching sublists. But still the skb->dev could be different that
orig_dev.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-14 14:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 12:14 ip_list_rcv() question Stephen Suryaputra
2021-10-13 16:17 ` Edward Cree
2021-10-14 14:42 ` Stephen Suryaputra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.