[ovs-discuss] [ovs-dev] how ovs implements QoS funtion

lg.yue kernelluck at 163.com
Wed Feb 8 10:27:59 UTC 2017


Ben Pfaff, Hi:
     i have to make it clear that QoS here refers to bandwidth limitation(TC), rather than  dscp or tos.   what i want to do is to limit the bandwidth of  vif and ovn's router port.
     allocate_chassis_queueid and dpif_queue_to_priority tell that  queue_id is a incremental number . in kernel function execute_masked_set_action just assign the value of queue_id to  skb->priority , then sent it to one queue.
 no code tell  the connection between priority and tc's class id.           ovn only support htb , and all qos rules are set to physical ethernet(for example eth0), how vif's packets are sent to eth0's tc class?


take a look at my environment:
#ovs-dpctl dump-flows
recirc_id(0),skb_priority(0),in_port(3),eth(src=02:ac:10:ff:00:11,dst=02:ac:10:ff:00:22),eth_type(0x0800),ipv4(tos=0/0x3,frag=no),actions:set(tunnel(tun_id=0x1,dst=101.158.40.159,ttl=64,tp_dst=6081,geneve({class=0x102,type=0x80,len=4,0x10002}),flags(df|csum|key))),set(skb_priority(0x10002)),2

# tc qdisc show dev eth0
qdisc htb 1: root refcnt 2 r2q 10 default 1 direct_packets_stat 17490

#  tc class show dev eth0
class htb 1:fffe root rate 100000Kbit ceil 100000Kbit burst 1500b cburst 1500b 
class htb 1:2 parent 1:fffe prio 0 rate 12000bit ceil 25000bit burst 2499b cburst 2500b

 my question is:
1.  does the flow 'set(skb_priority(0x10002))' have something to do with class htb 1:2 ? and how?      
source code is preferable


thanks very much.












At 2017-02-08 00:39:36, "Ben Pfaff" <blp at ovn.org> wrote:
>On Tue, Feb 07, 2017 at 09:21:05PM +0800, lg.yue wrote:
>>     i want to understand how QoS is implemented in ovs.  
>>     according to my understanding,  lflow 'actions=set_queue:1' is translated into a ofpbuf(type=OFPAT_RAW_QUEUE, queue_id=1).  
>>     but in funxtion do_xlate_actions,when type is  OFPACT_SET_QUEUE, queue_id is translated into skb_priority, why?
>>     
>>     whether  or not i miss something? please correct me and tell the complete process-flow.
>
>OVS depends on the datapath (usually, the Linux kernel) to actually
>implement QoS.  It uses the skb_priority field to tell the datapath the
>output queue, translating the queue number into a datapath-specific
>priority.


More information about the discuss mailing list