multiqueue.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. HOWTO for multiqueue network device support
  2. ===========================================
  3. Section 1: Base driver requirements for implementing multiqueue support
  4. Intro: Kernel support for multiqueue devices
  5. ---------------------------------------------------------
  6. Kernel support for multiqueue devices is always present.
  7. Section 1: Base driver requirements for implementing multiqueue support
  8. -----------------------------------------------------------------------
  9. Base drivers are required to use the new alloc_etherdev_mq() or
  10. alloc_netdev_mq() functions to allocate the subqueues for the device. The
  11. underlying kernel API will take care of the allocation and deallocation of
  12. the subqueue memory, as well as netdev configuration of where the queues
  13. exist in memory.
  14. The base driver will also need to manage the queues as it does the global
  15. netdev->queue_lock today. Therefore base drivers should use the
  16. netif_{start|stop|wake}_subqueue() functions to manage each queue while the
  17. device is still operational. netdev->queue_lock is still used when the device
  18. comes online or when it's completely shut down (unregister_netdev(), etc.).
  19. Finally, the base driver should indicate that it is a multiqueue device. The
  20. feature flag NETIF_F_MULTI_QUEUE should be added to the netdev->features
  21. bitmap on device initialization. Below is an example from e1000:
  22. #ifdef CONFIG_E1000_MQ
  23. if ( (adapter->hw.mac.type == e1000_82571) ||
  24. (adapter->hw.mac.type == e1000_82572) ||
  25. (adapter->hw.mac.type == e1000_80003es2lan))
  26. netdev->features |= NETIF_F_MULTI_QUEUE;
  27. #endif
  28. Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>