sch_generic.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. /*
  2. * net/sched/sch_generic.c Generic packet scheduler routines.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. *
  9. * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  10. * Jamal Hadi Salim, <hadi@cyberus.ca> 990601
  11. * - Ingress support
  12. */
  13. #include <linux/bitops.h>
  14. #include <linux/module.h>
  15. #include <linux/types.h>
  16. #include <linux/kernel.h>
  17. #include <linux/sched.h>
  18. #include <linux/string.h>
  19. #include <linux/errno.h>
  20. #include <linux/netdevice.h>
  21. #include <linux/skbuff.h>
  22. #include <linux/rtnetlink.h>
  23. #include <linux/init.h>
  24. #include <linux/rcupdate.h>
  25. #include <linux/list.h>
  26. #include <net/pkt_sched.h>
  27. /* Main transmission queue. */
  28. /* Modifications to data participating in scheduling must be protected with
  29. * qdisc_root_lock(qdisc) spinlock.
  30. *
  31. * The idea is the following:
  32. * - enqueue, dequeue are serialized via qdisc root lock
  33. * - ingress filtering is also serialized via qdisc root lock
  34. * - updates to tree and tree walking are only done under the rtnl mutex.
  35. */
  36. static inline int qdisc_qlen(struct Qdisc *q)
  37. {
  38. return q->q.qlen;
  39. }
  40. static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)
  41. {
  42. if (unlikely(skb->next))
  43. q->gso_skb = skb;
  44. else
  45. q->ops->requeue(skb, q);
  46. __netif_schedule(q);
  47. return 0;
  48. }
  49. static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
  50. {
  51. struct sk_buff *skb;
  52. if ((skb = q->gso_skb))
  53. q->gso_skb = NULL;
  54. else
  55. skb = q->dequeue(q);
  56. return skb;
  57. }
  58. static inline int handle_dev_cpu_collision(struct sk_buff *skb,
  59. struct netdev_queue *dev_queue,
  60. struct Qdisc *q)
  61. {
  62. int ret;
  63. if (unlikely(dev_queue->xmit_lock_owner == smp_processor_id())) {
  64. /*
  65. * Same CPU holding the lock. It may be a transient
  66. * configuration error, when hard_start_xmit() recurses. We
  67. * detect it by checking xmit owner and drop the packet when
  68. * deadloop is detected. Return OK to try the next skb.
  69. */
  70. kfree_skb(skb);
  71. if (net_ratelimit())
  72. printk(KERN_WARNING "Dead loop on netdevice %s, "
  73. "fix it urgently!\n", dev_queue->dev->name);
  74. ret = qdisc_qlen(q);
  75. } else {
  76. /*
  77. * Another cpu is holding lock, requeue & delay xmits for
  78. * some time.
  79. */
  80. __get_cpu_var(netdev_rx_stat).cpu_collision++;
  81. ret = dev_requeue_skb(skb, q);
  82. }
  83. return ret;
  84. }
  85. /*
  86. * NOTE: Called under qdisc_lock(q) with locally disabled BH.
  87. *
  88. * __QDISC_STATE_RUNNING guarantees only one CPU can process
  89. * this qdisc at a time. qdisc_lock(q) serializes queue accesses for
  90. * this queue.
  91. *
  92. * netif_tx_lock serializes accesses to device driver.
  93. *
  94. * qdisc_lock(q) and netif_tx_lock are mutually exclusive,
  95. * if one is grabbed, another must be free.
  96. *
  97. * Note, that this procedure can be called by a watchdog timer
  98. *
  99. * Returns to the caller:
  100. * 0 - queue is empty or throttled.
  101. * >0 - queue is not empty.
  102. *
  103. */
  104. static inline int qdisc_restart(struct Qdisc *q)
  105. {
  106. struct netdev_queue *txq;
  107. int ret = NETDEV_TX_BUSY;
  108. struct net_device *dev;
  109. spinlock_t *root_lock;
  110. struct sk_buff *skb;
  111. /* Dequeue packet */
  112. if (unlikely((skb = dequeue_skb(q)) == NULL))
  113. return 0;
  114. root_lock = qdisc_root_lock(q);
  115. /* And release qdisc */
  116. spin_unlock(root_lock);
  117. dev = qdisc_dev(q);
  118. txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb));
  119. HARD_TX_LOCK(dev, txq, smp_processor_id());
  120. if (!netif_subqueue_stopped(dev, skb))
  121. ret = dev_hard_start_xmit(skb, dev, txq);
  122. HARD_TX_UNLOCK(dev, txq);
  123. spin_lock(root_lock);
  124. switch (ret) {
  125. case NETDEV_TX_OK:
  126. /* Driver sent out skb successfully */
  127. ret = qdisc_qlen(q);
  128. break;
  129. case NETDEV_TX_LOCKED:
  130. /* Driver try lock failed */
  131. ret = handle_dev_cpu_collision(skb, txq, q);
  132. break;
  133. default:
  134. /* Driver returned NETDEV_TX_BUSY - requeue skb */
  135. if (unlikely (ret != NETDEV_TX_BUSY && net_ratelimit()))
  136. printk(KERN_WARNING "BUG %s code %d qlen %d\n",
  137. dev->name, ret, q->q.qlen);
  138. ret = dev_requeue_skb(skb, q);
  139. break;
  140. }
  141. if (ret && netif_tx_queue_stopped(txq))
  142. ret = 0;
  143. return ret;
  144. }
  145. void __qdisc_run(struct Qdisc *q)
  146. {
  147. unsigned long start_time = jiffies;
  148. while (qdisc_restart(q)) {
  149. /*
  150. * Postpone processing if
  151. * 1. another process needs the CPU;
  152. * 2. we've been doing it for too long.
  153. */
  154. if (need_resched() || jiffies != start_time) {
  155. __netif_schedule(q);
  156. break;
  157. }
  158. }
  159. clear_bit(__QDISC_STATE_RUNNING, &q->state);
  160. }
  161. static void dev_watchdog(unsigned long arg)
  162. {
  163. struct net_device *dev = (struct net_device *)arg;
  164. netif_tx_lock(dev);
  165. if (!qdisc_tx_is_noop(dev)) {
  166. if (netif_device_present(dev) &&
  167. netif_running(dev) &&
  168. netif_carrier_ok(dev)) {
  169. int some_queue_stopped = 0;
  170. unsigned int i;
  171. for (i = 0; i < dev->num_tx_queues; i++) {
  172. struct netdev_queue *txq;
  173. txq = netdev_get_tx_queue(dev, i);
  174. if (netif_tx_queue_stopped(txq)) {
  175. some_queue_stopped = 1;
  176. break;
  177. }
  178. }
  179. if (some_queue_stopped &&
  180. time_after(jiffies, (dev->trans_start +
  181. dev->watchdog_timeo))) {
  182. printk(KERN_INFO "NETDEV WATCHDOG: %s: "
  183. "transmit timed out\n",
  184. dev->name);
  185. dev->tx_timeout(dev);
  186. WARN_ON_ONCE(1);
  187. }
  188. if (!mod_timer(&dev->watchdog_timer,
  189. round_jiffies(jiffies +
  190. dev->watchdog_timeo)))
  191. dev_hold(dev);
  192. }
  193. }
  194. netif_tx_unlock(dev);
  195. dev_put(dev);
  196. }
  197. void __netdev_watchdog_up(struct net_device *dev)
  198. {
  199. if (dev->tx_timeout) {
  200. if (dev->watchdog_timeo <= 0)
  201. dev->watchdog_timeo = 5*HZ;
  202. if (!mod_timer(&dev->watchdog_timer,
  203. round_jiffies(jiffies + dev->watchdog_timeo)))
  204. dev_hold(dev);
  205. }
  206. }
  207. static void dev_watchdog_up(struct net_device *dev)
  208. {
  209. __netdev_watchdog_up(dev);
  210. }
  211. static void dev_watchdog_down(struct net_device *dev)
  212. {
  213. netif_tx_lock_bh(dev);
  214. if (del_timer(&dev->watchdog_timer))
  215. dev_put(dev);
  216. netif_tx_unlock_bh(dev);
  217. }
  218. /**
  219. * netif_carrier_on - set carrier
  220. * @dev: network device
  221. *
  222. * Device has detected that carrier.
  223. */
  224. void netif_carrier_on(struct net_device *dev)
  225. {
  226. if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
  227. linkwatch_fire_event(dev);
  228. if (netif_running(dev))
  229. __netdev_watchdog_up(dev);
  230. }
  231. }
  232. EXPORT_SYMBOL(netif_carrier_on);
  233. /**
  234. * netif_carrier_off - clear carrier
  235. * @dev: network device
  236. *
  237. * Device has detected loss of carrier.
  238. */
  239. void netif_carrier_off(struct net_device *dev)
  240. {
  241. if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state))
  242. linkwatch_fire_event(dev);
  243. }
  244. EXPORT_SYMBOL(netif_carrier_off);
  245. /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
  246. under all circumstances. It is difficult to invent anything faster or
  247. cheaper.
  248. */
  249. static int noop_enqueue(struct sk_buff *skb, struct Qdisc * qdisc)
  250. {
  251. kfree_skb(skb);
  252. return NET_XMIT_CN;
  253. }
  254. static struct sk_buff *noop_dequeue(struct Qdisc * qdisc)
  255. {
  256. return NULL;
  257. }
  258. static int noop_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
  259. {
  260. if (net_ratelimit())
  261. printk(KERN_DEBUG "%s deferred output. It is buggy.\n",
  262. skb->dev->name);
  263. kfree_skb(skb);
  264. return NET_XMIT_CN;
  265. }
  266. struct Qdisc_ops noop_qdisc_ops __read_mostly = {
  267. .id = "noop",
  268. .priv_size = 0,
  269. .enqueue = noop_enqueue,
  270. .dequeue = noop_dequeue,
  271. .requeue = noop_requeue,
  272. .owner = THIS_MODULE,
  273. };
  274. static struct netdev_queue noop_netdev_queue = {
  275. .qdisc = &noop_qdisc,
  276. };
  277. struct Qdisc noop_qdisc = {
  278. .enqueue = noop_enqueue,
  279. .dequeue = noop_dequeue,
  280. .flags = TCQ_F_BUILTIN,
  281. .ops = &noop_qdisc_ops,
  282. .list = LIST_HEAD_INIT(noop_qdisc.list),
  283. .q.lock = __SPIN_LOCK_UNLOCKED(noop_qdisc.q.lock),
  284. .dev_queue = &noop_netdev_queue,
  285. };
  286. EXPORT_SYMBOL(noop_qdisc);
  287. static struct Qdisc_ops noqueue_qdisc_ops __read_mostly = {
  288. .id = "noqueue",
  289. .priv_size = 0,
  290. .enqueue = noop_enqueue,
  291. .dequeue = noop_dequeue,
  292. .requeue = noop_requeue,
  293. .owner = THIS_MODULE,
  294. };
  295. static struct Qdisc noqueue_qdisc = {
  296. .enqueue = NULL,
  297. .dequeue = noop_dequeue,
  298. .flags = TCQ_F_BUILTIN,
  299. .ops = &noqueue_qdisc_ops,
  300. .list = LIST_HEAD_INIT(noqueue_qdisc.list),
  301. };
  302. static int fifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc)
  303. {
  304. struct sk_buff_head *list = &qdisc->q;
  305. if (skb_queue_len(list) < qdisc_dev(qdisc)->tx_queue_len)
  306. return __qdisc_enqueue_tail(skb, qdisc, list);
  307. return qdisc_drop(skb, qdisc);
  308. }
  309. static struct sk_buff *fifo_fast_dequeue(struct Qdisc* qdisc)
  310. {
  311. struct sk_buff_head *list = &qdisc->q;
  312. if (!skb_queue_empty(list))
  313. return __qdisc_dequeue_head(qdisc, list);
  314. return NULL;
  315. }
  316. static int fifo_fast_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
  317. {
  318. return __qdisc_requeue(skb, qdisc, &qdisc->q);
  319. }
  320. static void fifo_fast_reset(struct Qdisc* qdisc)
  321. {
  322. __qdisc_reset_queue(qdisc, &qdisc->q);
  323. qdisc->qstats.backlog = 0;
  324. }
  325. static struct Qdisc_ops fifo_fast_ops __read_mostly = {
  326. .id = "fifo_fast",
  327. .priv_size = 0,
  328. .enqueue = fifo_fast_enqueue,
  329. .dequeue = fifo_fast_dequeue,
  330. .requeue = fifo_fast_requeue,
  331. .reset = fifo_fast_reset,
  332. .owner = THIS_MODULE,
  333. };
  334. struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
  335. struct Qdisc_ops *ops)
  336. {
  337. void *p;
  338. struct Qdisc *sch;
  339. unsigned int size;
  340. int err = -ENOBUFS;
  341. /* ensure that the Qdisc and the private data are 32-byte aligned */
  342. size = QDISC_ALIGN(sizeof(*sch));
  343. size += ops->priv_size + (QDISC_ALIGNTO - 1);
  344. p = kzalloc(size, GFP_KERNEL);
  345. if (!p)
  346. goto errout;
  347. sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);
  348. sch->padded = (char *) sch - (char *) p;
  349. INIT_LIST_HEAD(&sch->list);
  350. skb_queue_head_init(&sch->q);
  351. sch->ops = ops;
  352. sch->enqueue = ops->enqueue;
  353. sch->dequeue = ops->dequeue;
  354. sch->dev_queue = dev_queue;
  355. dev_hold(qdisc_dev(sch));
  356. atomic_set(&sch->refcnt, 1);
  357. return sch;
  358. errout:
  359. return ERR_PTR(err);
  360. }
  361. struct Qdisc * qdisc_create_dflt(struct net_device *dev,
  362. struct netdev_queue *dev_queue,
  363. struct Qdisc_ops *ops,
  364. unsigned int parentid)
  365. {
  366. struct Qdisc *sch;
  367. sch = qdisc_alloc(dev_queue, ops);
  368. if (IS_ERR(sch))
  369. goto errout;
  370. sch->parent = parentid;
  371. if (!ops->init || ops->init(sch, NULL) == 0)
  372. return sch;
  373. qdisc_destroy(sch);
  374. errout:
  375. return NULL;
  376. }
  377. EXPORT_SYMBOL(qdisc_create_dflt);
  378. /* Under qdisc_root_lock(qdisc) and BH! */
  379. void qdisc_reset(struct Qdisc *qdisc)
  380. {
  381. const struct Qdisc_ops *ops = qdisc->ops;
  382. if (ops->reset)
  383. ops->reset(qdisc);
  384. }
  385. EXPORT_SYMBOL(qdisc_reset);
  386. /* this is the rcu callback function to clean up a qdisc when there
  387. * are no further references to it */
  388. static void __qdisc_destroy(struct rcu_head *head)
  389. {
  390. struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
  391. const struct Qdisc_ops *ops = qdisc->ops;
  392. gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
  393. if (ops->reset)
  394. ops->reset(qdisc);
  395. if (ops->destroy)
  396. ops->destroy(qdisc);
  397. module_put(ops->owner);
  398. dev_put(qdisc_dev(qdisc));
  399. kfree_skb(qdisc->gso_skb);
  400. kfree((char *) qdisc - qdisc->padded);
  401. }
  402. /* Under qdisc_root_lock(qdisc) and BH! */
  403. void qdisc_destroy(struct Qdisc *qdisc)
  404. {
  405. if (qdisc->flags & TCQ_F_BUILTIN ||
  406. !atomic_dec_and_test(&qdisc->refcnt))
  407. return;
  408. if (qdisc->parent)
  409. list_del(&qdisc->list);
  410. call_rcu(&qdisc->q_rcu, __qdisc_destroy);
  411. }
  412. EXPORT_SYMBOL(qdisc_destroy);
  413. static bool dev_all_qdisc_sleeping_noop(struct net_device *dev)
  414. {
  415. unsigned int i;
  416. for (i = 0; i < dev->num_tx_queues; i++) {
  417. struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
  418. if (txq->qdisc_sleeping != &noop_qdisc)
  419. return false;
  420. }
  421. return true;
  422. }
  423. static void attach_one_default_qdisc(struct net_device *dev,
  424. struct netdev_queue *dev_queue,
  425. void *_unused)
  426. {
  427. struct Qdisc *qdisc;
  428. if (dev->tx_queue_len) {
  429. qdisc = qdisc_create_dflt(dev, dev_queue,
  430. &fifo_fast_ops, TC_H_ROOT);
  431. if (!qdisc) {
  432. printk(KERN_INFO "%s: activation failed\n", dev->name);
  433. return;
  434. }
  435. } else {
  436. qdisc = &noqueue_qdisc;
  437. }
  438. dev_queue->qdisc_sleeping = qdisc;
  439. }
  440. static void transition_one_qdisc(struct net_device *dev,
  441. struct netdev_queue *dev_queue,
  442. void *_need_watchdog)
  443. {
  444. struct Qdisc *new_qdisc = dev_queue->qdisc_sleeping;
  445. int *need_watchdog_p = _need_watchdog;
  446. rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
  447. if (new_qdisc != &noqueue_qdisc)
  448. *need_watchdog_p = 1;
  449. }
  450. void dev_activate(struct net_device *dev)
  451. {
  452. int need_watchdog;
  453. /* No queueing discipline is attached to device;
  454. * create default one i.e. fifo_fast for devices,
  455. * which need queueing and noqueue_qdisc for
  456. * virtual interfaces.
  457. */
  458. if (dev_all_qdisc_sleeping_noop(dev))
  459. netdev_for_each_tx_queue(dev, attach_one_default_qdisc, NULL);
  460. if (!netif_carrier_ok(dev))
  461. /* Delay activation until next carrier-on event */
  462. return;
  463. need_watchdog = 0;
  464. netdev_for_each_tx_queue(dev, transition_one_qdisc, &need_watchdog);
  465. if (need_watchdog) {
  466. dev->trans_start = jiffies;
  467. dev_watchdog_up(dev);
  468. }
  469. }
  470. static void dev_deactivate_queue(struct net_device *dev,
  471. struct netdev_queue *dev_queue,
  472. void *_qdisc_default)
  473. {
  474. struct Qdisc *qdisc_default = _qdisc_default;
  475. struct sk_buff *skb = NULL;
  476. struct Qdisc *qdisc;
  477. qdisc = dev_queue->qdisc;
  478. if (qdisc) {
  479. spin_lock_bh(qdisc_lock(qdisc));
  480. dev_queue->qdisc = qdisc_default;
  481. qdisc_reset(qdisc);
  482. spin_unlock_bh(qdisc_lock(qdisc));
  483. }
  484. kfree_skb(skb);
  485. }
  486. static bool some_qdisc_is_running(struct net_device *dev, int lock)
  487. {
  488. unsigned int i;
  489. for (i = 0; i < dev->num_tx_queues; i++) {
  490. struct netdev_queue *dev_queue;
  491. spinlock_t *root_lock;
  492. struct Qdisc *q;
  493. int val;
  494. dev_queue = netdev_get_tx_queue(dev, i);
  495. q = dev_queue->qdisc;
  496. root_lock = qdisc_root_lock(q);
  497. if (lock)
  498. spin_lock_bh(root_lock);
  499. val = test_bit(__QDISC_STATE_RUNNING, &q->state);
  500. if (lock)
  501. spin_unlock_bh(root_lock);
  502. if (val)
  503. return true;
  504. }
  505. return false;
  506. }
  507. void dev_deactivate(struct net_device *dev)
  508. {
  509. bool running;
  510. netdev_for_each_tx_queue(dev, dev_deactivate_queue, &noop_qdisc);
  511. dev_watchdog_down(dev);
  512. /* Wait for outstanding qdisc-less dev_queue_xmit calls. */
  513. synchronize_rcu();
  514. /* Wait for outstanding qdisc_run calls. */
  515. do {
  516. while (some_qdisc_is_running(dev, 0))
  517. yield();
  518. /*
  519. * Double-check inside queue lock to ensure that all effects
  520. * of the queue run are visible when we return.
  521. */
  522. running = some_qdisc_is_running(dev, 1);
  523. /*
  524. * The running flag should never be set at this point because
  525. * we've already set dev->qdisc to noop_qdisc *inside* the same
  526. * pair of spin locks. That is, if any qdisc_run starts after
  527. * our initial test it should see the noop_qdisc and then
  528. * clear the RUNNING bit before dropping the queue lock. So
  529. * if it is set here then we've found a bug.
  530. */
  531. } while (WARN_ON_ONCE(running));
  532. }
  533. static void dev_init_scheduler_queue(struct net_device *dev,
  534. struct netdev_queue *dev_queue,
  535. void *_qdisc)
  536. {
  537. struct Qdisc *qdisc = _qdisc;
  538. dev_queue->qdisc = qdisc;
  539. dev_queue->qdisc_sleeping = qdisc;
  540. }
  541. void dev_init_scheduler(struct net_device *dev)
  542. {
  543. netdev_for_each_tx_queue(dev, dev_init_scheduler_queue, &noop_qdisc);
  544. dev_init_scheduler_queue(dev, &dev->rx_queue, NULL);
  545. setup_timer(&dev->watchdog_timer, dev_watchdog, (unsigned long)dev);
  546. }
  547. static void shutdown_scheduler_queue(struct net_device *dev,
  548. struct netdev_queue *dev_queue,
  549. void *_qdisc_default)
  550. {
  551. struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
  552. struct Qdisc *qdisc_default = _qdisc_default;
  553. if (qdisc) {
  554. spinlock_t *root_lock = qdisc_root_lock(qdisc);
  555. dev_queue->qdisc = qdisc_default;
  556. dev_queue->qdisc_sleeping = qdisc_default;
  557. spin_lock(root_lock);
  558. qdisc_destroy(qdisc);
  559. spin_unlock(root_lock);
  560. }
  561. }
  562. void dev_shutdown(struct net_device *dev)
  563. {
  564. netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
  565. shutdown_scheduler_queue(dev, &dev->rx_queue, NULL);
  566. BUG_TRAP(!timer_pending(&dev->watchdog_timer));
  567. }