> From: PJ Waskiewicz <[EMAIL PROTECTED]> > Date: Mon, 18 Jun 2007 11:42:29 -0700 > > > + > > + /* The TX queue control structures */ > > + struct net_device_subqueue *egress_subqueue; > > + int egress_subqueue_count; > > Since every net device will have at least one subqueue, I > would suggest that you do this as follows: > > 1) In net_device change the quoted part of the patch above to: > > int egress_subqueue_count; > struct net_device_subqueue egress_subqueue[0]; > > 2) In alloc_netdev(): > > Factor (sizeof(struct egress_subqueue) * num_subqueues) into > the net_device allocation size, place the "priv" area after > the subqueues. > > This will save us pointer dereferences on all of these quite > common accesses.
I've been thinking about this more today, so please bear with me if I'm missing something. Right now, with how qdisc_restart() is running, we'd definitely call netif_subqueue_stopped(dev, skb->queue_mapping) for all multi-ring and single-ring devices. However, with Jamal's and Krishna's qdisc_restart() rewrite patch, the checks for netif_queue_stopped() and netif_subqueue_stopped() would be pushed into the qdisc's ->dequeue() functions. If that's the case, then the only checks on egress_subqueue[x] would be for multi-ring adapters, or if someone was silly enough to load sch_{rr|prio} onto a single-ring device with multiqueue hardware support compiled in. Given all of that, I'm not sure allocating egress_subqueue[0] at compile time or runtime would make any difference either way. If I'm missing something, please let me know - I'd like to reduce any unnecessary pointer dereferences if possible, but given the proposed qdisc_restart(), I think the code as-is would be ok. Thanks, -PJ Waskiewicz - 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