Subject: Re: [PATCH nf-next v5 0/6] Netfilter egress hook

From: Lukas Wunner <[email-masked]>
Date: Thu, 30 Sep 2021 19:36:11 +0200

On Thu, Sep 30, 2021 at 10:19:20AM -0700, Jakub Kicinski wrote:
> On Thu, 30 Sep 2021 19:12:53 +0200 Lukas Wunner wrote:
> > On Thu, Sep 30, 2021 at 07:28:35AM -0700, Jakub Kicinski wrote:
> > > On Thu, 30 Sep 2021 11:21:42 +0200 Pablo Neira Ayuso wrote:  
> > > > this is stuffing one more bit into the skbuff  
> > > 
> > > The lifetime of this information is constrained, can't it be a percpu
> > > flag, like xmit_more?  
> > 
> > Hm, can't an skb be queued and processed later on a different cpu?
> > E.g. what about fragments?
> > 
> > That would rule out a percpu flag, leaving a flag in struct sk_buff
> > as the only option.
> 
> What queuing do you have in mind? Qdisc is after the egress hook.

Ingress queueing.  E.g. a packet may be redirected or mirrored by tc
on ingress to another interface, resulting in a recursive call to
netif_receive_skb() or dev_queue_xmit().  The packet may be bounced
around an arbitrary number of times this way.  Forwarding like that
can happen both at the tc and the netfilter "layer".

I'm concerned that a packet may be handled by different cpus along the way
and queueing might be one possibility how this could happen.

Thanks,

Lukas