[ovs-dev] offset of 0x10001 in dpif_netlink_queue_to_priority

Ben Pfaff blp at ovn.org
Fri Jul 7 16:20:07 UTC 2017


On Fri, Jul 07, 2017 at 08:56:14AM +0200, Matthias May wrote:
> On 06/07/17 17:25, Ben Pfaff wrote:
> > On Thu, Jul 06, 2017 at 08:39:21AM +0200, Matthias May wrote:
> >> On 06/07/17 02:24, Ben Pfaff wrote:
> >>> On Tue, Jul 04, 2017 at 05:09:21PM +0200, Matthias May wrote:
> >>>> Hi
> >>>>
> >>>> I'm trying to map the vlan_pcp onto 802.11 tid.
> >>>>
> >>>> net/wireless/util.c in mac80211 specifies:
> >>>>
> >>>>> 	/* skb->priority values from 256->263 are magic values to
> >>>>> 	 * directly indicate a specific 802.1d priority.  This is used
> >>>>> 	 * to allow 802.1d priority to be passed directly in from VLAN
> >>>>> 	 * tags, etc.
> >>>>> 	 */
> >>>>> 	if (skb->priority >= 256 && skb->priority <= 263)
> >>>>> 		return skb->priority - 256;
> >>>>
> >>>> However the function dpif_netlink_queue_to_priority in /lib/dpif-netlink.c sets:
> >>>>>    if (queue_id < 0xf000) {
> >>>>>        *priority = TC_H_MAKE(1 << 16, queue_id + 1);
> >>>>
> >>>> With this the lowest skb_priority I can set is 0x10001, slightly over the magic values I need to use ;)
> >>>>
> >>>> Why is this offset of 0x10000 + 1 in place?
> >>>> Is something else in ovs about which I'm not aware dependant on this offset?
> >>>
> >>> It's because this is mapping from an OpenFlow queue ID to a kernel
> >>> skb_priority value.  These aren't the same namespace and so you need a
> >>> mapping function.
> >>>
> >>
> >> What do you mean "not the same namespace"?
> >> I need to set the skb_priority, set_queue sets the skb_priority but with an offset.
> > 
> > OpenFlow queue IDs aren't kernel skb_priorities.  They never have been.
> > There is a mapping function.
> > 
> >> If I patch the line to
> >> *priority = queue_id;
> >> everything works as I expect it.
> > 
> > Good for you.  You just broke every existing user.
> > 
> 
> Yes I am aware that the queue_id isn't the same as the skb_priority.
> Please tell me:
> Is my assumption wrong that using set_queue in the end results with an skb_priority being set?
> 
> You keep mentioning that a mapping function is there.
> Isn't that what dpif_netlink_queue_to_priority is? mapping queue_id to skb_priority?
> 
> What breaks with this patch?

Every single user who configures queues using the QoS and Queue tables
that Open vSwitch provides.


More information about the dev mailing list