On Sat, 2005-23-07 at 06:53 +0200, Patrick McHardy wrote: > Thomas Graf wrote: > > * Patrick McHardy <[EMAIL PROTECTED]> 2005-07-23 06:39 > > > >>I'm trying to convert tc_index to a u16, which looks OK in all places > >>but sched_gred. I can't make sense of this code: > >> > >> /* fix tc_index? --could be controvesial but needed for > >> requeueing */ > >> skb->tc_index=(skb->tc_index&0xfffffff0) | t->def; > >> > >>Why is a mask of 0xfffffff0 used? It shouldn't be larger than 0xffff > >>anyway. > >
It seems someone changed the behavior of tc_index but may have forgotten to change it for gred? it used to be 32 bit at some point. > > It doesn't really matter, my red patchset will change this to: > > > > #define MAX_DPs 16 > > #define GRED_VQ_MASK (MAX_DPs - 1) > > > > skb->tc_index = (skb->tc_index & ~GRED_VQ_MASK) | dp; > > > > We can cast GRED_VQ_MASK to u16 if needed. > > Great, thanks. Patch coming up in a couple of minutes :) The only thing i would worry about is that at some point we had assumptions about tc_index being 32 bit. I think it may have been used to carry class major:minor - can you please make sure there are no side effects in other places like dsmark etc. cheers, jamal - 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