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?
--> My original question: what is dependant on the skb_priority being offset 
with 0x10001.


What is see is with the rule:
ovs-ofctl add-flow br0 "table=0 priority=1 actions=set_queue:0x100, normal"

results without the patch in:
root@RM1:~# ovs-dpctl dump-flows
recirc_id(0),skb_priority(0),in_port(7),eth(src=02:b3:32:ba:be:02,dst=00:0e:0c:64:cc:33),eth_type(0x0800),ipv4(frag=no),
packets:11, bytes:1078, used:0.225s, actions:set(skb_priority(0x10101)),3

and with the patch in:
root@RM1:~# ovs-dpctl dump-flows
recirc_id(0),skb_priority(0),in_port(7),eth(src=02:b3:32:ba:be:02,dst=00:0e:0c:64:cc:33),eth_type(0x0800),ipv4(frag=no),
packets:49938, bytes:4893924, used:0.124s, actions:set(skb_priority(0x00100)),3

The difference being
actions:set(skb_priority(0x10101))
vs.
actions:set(skb_priority(0x00100))

Is this not setting the skb_priority in the kernel?
Am I on a completely wrong path?


BR
Matthias
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to