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