* David S. Miller <[EMAIL PROTECTED]> 2005-07-25 15:56 > From: Thomas Graf <[EMAIL PROTECTED]> > Date: Tue, 26 Jul 2005 00:35:05 +0200 > > > We can also use ifindex and hold a reference. We won't access input_dev > > too often so a __dev_get_by_ifindex() won't be too expensive given the > > number of interfaces is not too big but that's another issue. > > Since the reference is very local in each instance we actually use it, > we can elide the refcounting overhead most of the time perhaps.
Not sure but as I see it: in netif_receive_skb(): if (!skb->input_dev) { dev_hold(skb->dev); skb->input_dev = skb->dev->ifindex; } in __kfree_skb(): if (skb->input_dev) dev_put(__dev_get_by_index(skb->input_dev)); in mirred: if (skb2->input_dev) dev_put(__dev_get_by_index(skb2->input_dev)); dev_hold(skb->dev); skb2->input_dev = skb2->dev->ifindex; in skb_clone() ... The __dev_get_by_index() can be expensive with more than a 1k interfaces but the hash generally does well so I don't see much of a problem. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html