Re: [RFC][PATCH 2/9] deadlock prevention core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2006-08-09 at 15:19 +0200, Thomas Graf wrote:
> * Daniel Phillips <[email protected]> 2006-08-08 22:47
> > David Miller wrote:
> > >From: Daniel Phillips <[email protected]>
> >  >>Can you please characterize the conditions under which skb->dev changes
> > >>after the alloc?  Are there writings on this subtlety?
> > >
> > >The packet scheduler and classifier can redirect packets to different
> > >devices, and can the netfilter layer.
> > >
> > >The setting of skb->dev is wholly transient and you cannot rely upon
> > >it to be the same as when you set it on allocation.
> > >
> > >Even simple things like the bonding device change skb->dev on every
> > >receive.
> > 
> > Thankyou, this is easily fixed.
> 
> It's not that simple, in order to just fix the most obvious case
> being packet forwarding when skb->dev changes its meaning from
> device the packet is coming from to device the packet will be leaving
> on is difficult.
> 
> You can't unreserve at that point so you need to keep the original
> skb->dev. Since the packet is mostly likely queued before freeing
> you will lose the refcnt on the original skb->dev. Keeping a
> refcnt just for this memalloc stuff is out of question. Even keeping
> the ifindex on a best effort basis is unlikely an option, sk_buff is
> way overweight already.

I think Daniel was thinking of adding struct net_device *
sk_buff::alloc_dev,
I know I was after reading the first few mails. However if adding a
field 
there is strict no-no....

/me takes a look at struct sk_buff

Hmm, what does sk_buff::input_dev do? That seems to store the initial
device?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux