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

Ben Pfaff blp at ovn.org
Wed Feb 8 16:49:34 UTC 2017


On Wed, Feb 08, 2017 at 06:27:59PM +0800, lg.yue wrote:
> 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.

allocate_chassis_queueid() is in ovn-northd, so it's dealing with
OpenFlow queue IDs (or rather OVN logical queue IDs, but so far that's
the identity map).

dpif_queue_to_priority() calls into a datapath-specific mapping
function.  For example, the dpif-netlink mapping function (used with the
Linux kernel datapath) is:

    static int
    dpif_netlink_queue_to_priority(const struct dpif *dpif OVS_UNUSED,
                                 uint32_t queue_id, uint32_t *priority)
    {
        if (queue_id < 0xf000) {
            *priority = TC_H_MAKE(1 << 16, queue_id + 1);
            return 0;
        } else {
            return EINVAL;
        }
    }

execute_masked_set_action() is in the kernel, so anything given to it
has already been mapped to a sbk_priority.

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

Yes.  See the code above.


More information about the discuss mailing list