On Wed, Sep 14, 2016 at 11:41:46PM +0800, Liping Zhang wrote: > From: Liping Zhang <liping.zhang@xxxxxxxxxxxxxx> > > Currently, the user can specify the queue numbers by _QUEUE_NUM and > _QUEUE_TOTAL attributes, this is enough in most situations. > > But acctually, it is not very flexible, for example: > tcp dport 80 mapped to queue0 > tcp dport 81 mapped to queue1 > tcp dport 82 mapped to queue2 > In order to do this thing, we must add 3 nft rules, and more > mapping meant more rules ... > > So take one register to select the queue number, then we can add one > simple rule to mapping queues, maybe like this: > queue num tcp dport map { 80:0, 81:1, 82:2 ... } > > Florian Westphal also proposed wider usage scenarios: > queue num jhash ip saddr . ip daddr mod ... > queue num meta cpu ... > queue num meta mark ... > > The last point is how to load a queue number from sreg, although we can > use *(u16*)®s->data[reg] to load the queue number, just like nat expr > to load its l4port do. > > But we will cooperate with hash expr, meta cpu, meta mark expr and so on. > They all store the result to u32 type, so cast it to u16 pointer and > dereference it will generate wrong result in the big endian system. > > So just keep it simple, we treat queue number as u32 type, although u16 > type is already enough. Applied, thanks Liping. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html