hierarchical qos hardware offload
play

HIERARCHICAL QOS HARDWARE OFFLOAD Yossi Kuperman, Maxim - PowerPoint PPT Presentation

HIERARCHICAL QOS HARDWARE OFFLOAD Yossi Kuperman, Maxim Mikityanskiy, 2020 AGENDA Hierarchical Token Bucket Brief description of HTB and its issues HTB offload solution Modifications to HTB to solve the issues and offload the logic Current


  1. HIERARCHICAL QOS HARDWARE OFFLOAD Yossi Kuperman, Maxim Mikityanskiy, 2020

  2. AGENDA Hierarchical Token Bucket Brief description of HTB and its issues HTB offload solution Modifications to HTB to solve the issues and offload the logic Current status Known challenges and status of development and submission 2

  3. HTB Hierarchical Token Bucket rate node root ceil Shaping occurs in leaf nodes Child nodes borrow tokens from parents inner Classification: # tc filter add dev eth0 parent 1:0 protocol ip flower dst_port 80 classid leaf leaf leaf leaf 1:10 3

  4. HTB DRAWBACKS Single HTB instance, single lock, not aware of multi-queue netdevs 1. Contention by flow classification 2. Contention by handling packets TXQ TX lock HTB dev_queue_xmit() TXQ TX lock Driver qdisc TXQ TX lock 4

  5. SOLUTION FOR CLASSIFICATION Flow classification still takes place in software Classification takes place at the clsact hook HTB skips classification if priority “ points ” to a class For example, replace: # tc filter add dev eth0 parent 1:0 protocol ip flower dst_port 80 classid 1:10 with an equivalent filter using skbedit action: # tc filter add dev eth0 egress protocol ip flower dst_port 80 action skbedit priority 1:10 Thread-safe and lock-free classification 5

  6. REMOVING THE LOCK CONTENTION dev_queue_xmit() HTB will present itself as mq/mqprio does TXQ TXQ TXQ • Create simple qdisc (FIFO) per TX queue • Only when offload mode is set FIFO FIFO FIFO qdisc qdisc qdisc HTB serves as the root qdisc • Aggregate statistics and report to user TX lock TX lock TX lock • Delegate the requests to the driver HTB code is no longer part of the data-path Driver 6

  7. HARDWARE OFFLOAD HTB uses ndo_setup_tc to provide the QoS tree structure to the driver, which recreates it in the NIC All streams don’t have to fight for a single lock anymore 1. HTB registers as a multi-queue qdisc (like mq) and creates qdiscs per queue 2. Each leaf class is backed by a hardware queue 3. Clsact happens before ndo_select_queue, so the driver can pick a queue corresponding to the class 4. Rate limiting is performed by the hardware 7

  8. HARDWARE OFFLOAD HTB NIC leaf SQ leaf leaf SQ leaf root root inner leaf SQ leaf inner leaf SQ leaf 8

  9. PACKET FLOW 1. clsact sets skb->priority to a leaf class ID 2. ndo_select_queue looks at skb->priority and picks the TX queue 3. The SKB is enqueued into the per-queue qdisc of that TX queue 4. The SKB is dequeued from the per-queue qdisc 5. The driver puts the SKB into the hardware Send Queue 6. The NIC does the shaping and transmits the packet 9

  10. HARDWARE OFFLOAD ADVANTAGES No contention on a single lock: different traffic classes don’t interfere with each other, which allows for better throughput Rate limiting logic is offloaded to the NIC, reducing CPU load 10

  11. KNOWN CHALLENGES Qdiscs of leaf classes are applied before HTB logic, when offloaded QoS TX queues have to be preallocated on alloc_etherdev_mqs Hardware queues are created and destroyed on demand real_num_tx_queues is changed by the driver when leaf classes change Deleting a leaf class may lead to gaps in TX queue numeration 11

  12. CURRENT STATUS PoC patches for mlx5 (using sysfs for configuration) RFC was posted to netdev mailing list, showing the HTB offload interface 12

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend