interface.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. /*
  2. * Network-device interface management.
  3. *
  4. * Copyright (c) 2004-2005, Keir Fraser
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation; or, when distributed
  9. * separately from the Linux kernel or incorporated into other
  10. * software packages, subject to the following license:
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13. * of this source file (the "Software"), to deal in the Software without
  14. * restriction, including without limitation the rights to use, copy, modify,
  15. * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  16. * and to permit persons to whom the Software is furnished to do so, subject to
  17. * the following conditions:
  18. *
  19. * The above copyright notice and this permission notice shall be included in
  20. * all copies or substantial portions of the Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  25. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  27. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  28. * IN THE SOFTWARE.
  29. */
  30. #include "common.h"
  31. #include <linux/kthread.h>
  32. #include <linux/ethtool.h>
  33. #include <linux/rtnetlink.h>
  34. #include <linux/if_vlan.h>
  35. #include <linux/vmalloc.h>
  36. #include <xen/events.h>
  37. #include <asm/xen/hypercall.h>
  38. #include <xen/balloon.h>
  39. #define XENVIF_QUEUE_LENGTH 32
  40. #define XENVIF_NAPI_WEIGHT 64
  41. int xenvif_schedulable(struct xenvif *vif)
  42. {
  43. return netif_running(vif->dev) && netif_carrier_ok(vif->dev);
  44. }
  45. static irqreturn_t xenvif_tx_interrupt(int irq, void *dev_id)
  46. {
  47. struct xenvif *vif = dev_id;
  48. if (RING_HAS_UNCONSUMED_REQUESTS(&vif->tx))
  49. napi_schedule(&vif->napi);
  50. return IRQ_HANDLED;
  51. }
  52. static int xenvif_poll(struct napi_struct *napi, int budget)
  53. {
  54. struct xenvif *vif = container_of(napi, struct xenvif, napi);
  55. int work_done;
  56. work_done = xenvif_tx_action(vif, budget);
  57. if (work_done < budget) {
  58. int more_to_do = 0;
  59. unsigned long flags;
  60. /* It is necessary to disable IRQ before calling
  61. * RING_HAS_UNCONSUMED_REQUESTS. Otherwise we might
  62. * lose event from the frontend.
  63. *
  64. * Consider:
  65. * RING_HAS_UNCONSUMED_REQUESTS
  66. * <frontend generates event to trigger napi_schedule>
  67. * __napi_complete
  68. *
  69. * This handler is still in scheduled state so the
  70. * event has no effect at all. After __napi_complete
  71. * this handler is descheduled and cannot get
  72. * scheduled again. We lose event in this case and the ring
  73. * will be completely stalled.
  74. */
  75. local_irq_save(flags);
  76. RING_FINAL_CHECK_FOR_REQUESTS(&vif->tx, more_to_do);
  77. if (!more_to_do)
  78. __napi_complete(napi);
  79. local_irq_restore(flags);
  80. }
  81. return work_done;
  82. }
  83. static irqreturn_t xenvif_rx_interrupt(int irq, void *dev_id)
  84. {
  85. struct xenvif *vif = dev_id;
  86. xenvif_kick_thread(vif);
  87. return IRQ_HANDLED;
  88. }
  89. static irqreturn_t xenvif_interrupt(int irq, void *dev_id)
  90. {
  91. xenvif_tx_interrupt(irq, dev_id);
  92. xenvif_rx_interrupt(irq, dev_id);
  93. return IRQ_HANDLED;
  94. }
  95. static void xenvif_wake_queue(unsigned long data)
  96. {
  97. struct xenvif *vif = (struct xenvif *)data;
  98. if (netif_queue_stopped(vif->dev)) {
  99. netdev_err(vif->dev, "draining TX queue\n");
  100. vif->rx_queue_purge = true;
  101. xenvif_kick_thread(vif);
  102. netif_wake_queue(vif->dev);
  103. }
  104. }
  105. static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev)
  106. {
  107. struct xenvif *vif = netdev_priv(dev);
  108. int min_slots_needed;
  109. BUG_ON(skb->dev != dev);
  110. /* Drop the packet if vif is not ready */
  111. if (vif->task == NULL ||
  112. vif->dealloc_task == NULL ||
  113. !xenvif_schedulable(vif))
  114. goto drop;
  115. /* At best we'll need one slot for the header and one for each
  116. * frag.
  117. */
  118. min_slots_needed = 1 + skb_shinfo(skb)->nr_frags;
  119. /* If the skb is GSO then we'll also need an extra slot for the
  120. * metadata.
  121. */
  122. if (skb_is_gso(skb))
  123. min_slots_needed++;
  124. /* If the skb can't possibly fit in the remaining slots
  125. * then turn off the queue to give the ring a chance to
  126. * drain.
  127. */
  128. if (!xenvif_rx_ring_slots_available(vif, min_slots_needed)) {
  129. vif->wake_queue.function = xenvif_wake_queue;
  130. vif->wake_queue.data = (unsigned long)vif;
  131. xenvif_stop_queue(vif);
  132. mod_timer(&vif->wake_queue,
  133. jiffies + rx_drain_timeout_jiffies);
  134. }
  135. skb_queue_tail(&vif->rx_queue, skb);
  136. xenvif_kick_thread(vif);
  137. return NETDEV_TX_OK;
  138. drop:
  139. vif->dev->stats.tx_dropped++;
  140. dev_kfree_skb(skb);
  141. return NETDEV_TX_OK;
  142. }
  143. static struct net_device_stats *xenvif_get_stats(struct net_device *dev)
  144. {
  145. struct xenvif *vif = netdev_priv(dev);
  146. return &vif->dev->stats;
  147. }
  148. static void xenvif_up(struct xenvif *vif)
  149. {
  150. napi_enable(&vif->napi);
  151. enable_irq(vif->tx_irq);
  152. if (vif->tx_irq != vif->rx_irq)
  153. enable_irq(vif->rx_irq);
  154. xenvif_check_rx_xenvif(vif);
  155. }
  156. static void xenvif_down(struct xenvif *vif)
  157. {
  158. napi_disable(&vif->napi);
  159. disable_irq(vif->tx_irq);
  160. if (vif->tx_irq != vif->rx_irq)
  161. disable_irq(vif->rx_irq);
  162. del_timer_sync(&vif->credit_timeout);
  163. }
  164. static int xenvif_open(struct net_device *dev)
  165. {
  166. struct xenvif *vif = netdev_priv(dev);
  167. if (netif_carrier_ok(dev))
  168. xenvif_up(vif);
  169. netif_start_queue(dev);
  170. return 0;
  171. }
  172. static int xenvif_close(struct net_device *dev)
  173. {
  174. struct xenvif *vif = netdev_priv(dev);
  175. if (netif_carrier_ok(dev))
  176. xenvif_down(vif);
  177. netif_stop_queue(dev);
  178. return 0;
  179. }
  180. static int xenvif_change_mtu(struct net_device *dev, int mtu)
  181. {
  182. struct xenvif *vif = netdev_priv(dev);
  183. int max = vif->can_sg ? 65535 - VLAN_ETH_HLEN : ETH_DATA_LEN;
  184. if (mtu > max)
  185. return -EINVAL;
  186. dev->mtu = mtu;
  187. return 0;
  188. }
  189. static netdev_features_t xenvif_fix_features(struct net_device *dev,
  190. netdev_features_t features)
  191. {
  192. struct xenvif *vif = netdev_priv(dev);
  193. if (!vif->can_sg)
  194. features &= ~NETIF_F_SG;
  195. if (~(vif->gso_mask | vif->gso_prefix_mask) & GSO_BIT(TCPV4))
  196. features &= ~NETIF_F_TSO;
  197. if (~(vif->gso_mask | vif->gso_prefix_mask) & GSO_BIT(TCPV6))
  198. features &= ~NETIF_F_TSO6;
  199. if (!vif->ip_csum)
  200. features &= ~NETIF_F_IP_CSUM;
  201. if (!vif->ipv6_csum)
  202. features &= ~NETIF_F_IPV6_CSUM;
  203. return features;
  204. }
  205. static const struct xenvif_stat {
  206. char name[ETH_GSTRING_LEN];
  207. u16 offset;
  208. } xenvif_stats[] = {
  209. {
  210. "rx_gso_checksum_fixup",
  211. offsetof(struct xenvif, rx_gso_checksum_fixup)
  212. },
  213. /* If (sent != success + fail), there are probably packets never
  214. * freed up properly!
  215. */
  216. {
  217. "tx_zerocopy_sent",
  218. offsetof(struct xenvif, tx_zerocopy_sent),
  219. },
  220. {
  221. "tx_zerocopy_success",
  222. offsetof(struct xenvif, tx_zerocopy_success),
  223. },
  224. {
  225. "tx_zerocopy_fail",
  226. offsetof(struct xenvif, tx_zerocopy_fail)
  227. },
  228. /* Number of packets exceeding MAX_SKB_FRAG slots. You should use
  229. * a guest with the same MAX_SKB_FRAG
  230. */
  231. {
  232. "tx_frag_overflow",
  233. offsetof(struct xenvif, tx_frag_overflow)
  234. },
  235. };
  236. static int xenvif_get_sset_count(struct net_device *dev, int string_set)
  237. {
  238. switch (string_set) {
  239. case ETH_SS_STATS:
  240. return ARRAY_SIZE(xenvif_stats);
  241. default:
  242. return -EINVAL;
  243. }
  244. }
  245. static void xenvif_get_ethtool_stats(struct net_device *dev,
  246. struct ethtool_stats *stats, u64 * data)
  247. {
  248. void *vif = netdev_priv(dev);
  249. int i;
  250. for (i = 0; i < ARRAY_SIZE(xenvif_stats); i++)
  251. data[i] = *(unsigned long *)(vif + xenvif_stats[i].offset);
  252. }
  253. static void xenvif_get_strings(struct net_device *dev, u32 stringset, u8 * data)
  254. {
  255. int i;
  256. switch (stringset) {
  257. case ETH_SS_STATS:
  258. for (i = 0; i < ARRAY_SIZE(xenvif_stats); i++)
  259. memcpy(data + i * ETH_GSTRING_LEN,
  260. xenvif_stats[i].name, ETH_GSTRING_LEN);
  261. break;
  262. }
  263. }
  264. static const struct ethtool_ops xenvif_ethtool_ops = {
  265. .get_link = ethtool_op_get_link,
  266. .get_sset_count = xenvif_get_sset_count,
  267. .get_ethtool_stats = xenvif_get_ethtool_stats,
  268. .get_strings = xenvif_get_strings,
  269. };
  270. static const struct net_device_ops xenvif_netdev_ops = {
  271. .ndo_start_xmit = xenvif_start_xmit,
  272. .ndo_get_stats = xenvif_get_stats,
  273. .ndo_open = xenvif_open,
  274. .ndo_stop = xenvif_close,
  275. .ndo_change_mtu = xenvif_change_mtu,
  276. .ndo_fix_features = xenvif_fix_features,
  277. .ndo_set_mac_address = eth_mac_addr,
  278. .ndo_validate_addr = eth_validate_addr,
  279. };
  280. struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
  281. unsigned int handle)
  282. {
  283. int err;
  284. struct net_device *dev;
  285. struct xenvif *vif;
  286. char name[IFNAMSIZ] = {};
  287. int i;
  288. snprintf(name, IFNAMSIZ - 1, "vif%u.%u", domid, handle);
  289. dev = alloc_netdev(sizeof(struct xenvif), name, ether_setup);
  290. if (dev == NULL) {
  291. pr_warn("Could not allocate netdev for %s\n", name);
  292. return ERR_PTR(-ENOMEM);
  293. }
  294. SET_NETDEV_DEV(dev, parent);
  295. vif = netdev_priv(dev);
  296. vif->grant_copy_op = vmalloc(sizeof(struct gnttab_copy) *
  297. MAX_GRANT_COPY_OPS);
  298. if (vif->grant_copy_op == NULL) {
  299. pr_warn("Could not allocate grant copy space for %s\n", name);
  300. free_netdev(dev);
  301. return ERR_PTR(-ENOMEM);
  302. }
  303. vif->domid = domid;
  304. vif->handle = handle;
  305. vif->can_sg = 1;
  306. vif->ip_csum = 1;
  307. vif->dev = dev;
  308. vif->credit_bytes = vif->remaining_credit = ~0UL;
  309. vif->credit_usec = 0UL;
  310. init_timer(&vif->credit_timeout);
  311. vif->credit_window_start = get_jiffies_64();
  312. init_timer(&vif->wake_queue);
  313. dev->netdev_ops = &xenvif_netdev_ops;
  314. dev->hw_features = NETIF_F_SG |
  315. NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
  316. NETIF_F_TSO | NETIF_F_TSO6;
  317. dev->features = dev->hw_features | NETIF_F_RXCSUM;
  318. SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops);
  319. dev->tx_queue_len = XENVIF_QUEUE_LENGTH;
  320. skb_queue_head_init(&vif->rx_queue);
  321. skb_queue_head_init(&vif->tx_queue);
  322. vif->pending_cons = 0;
  323. vif->pending_prod = MAX_PENDING_REQS;
  324. for (i = 0; i < MAX_PENDING_REQS; i++)
  325. vif->pending_ring[i] = i;
  326. spin_lock_init(&vif->callback_lock);
  327. spin_lock_init(&vif->response_lock);
  328. /* If ballooning is disabled, this will consume real memory, so you
  329. * better enable it. The long term solution would be to use just a
  330. * bunch of valid page descriptors, without dependency on ballooning
  331. */
  332. err = alloc_xenballooned_pages(MAX_PENDING_REQS,
  333. vif->mmap_pages,
  334. false);
  335. if (err) {
  336. netdev_err(dev, "Could not reserve mmap_pages\n");
  337. return ERR_PTR(-ENOMEM);
  338. }
  339. for (i = 0; i < MAX_PENDING_REQS; i++) {
  340. vif->pending_tx_info[i].callback_struct = (struct ubuf_info)
  341. { .callback = xenvif_zerocopy_callback,
  342. .ctx = NULL,
  343. .desc = i };
  344. vif->grant_tx_handle[i] = NETBACK_INVALID_HANDLE;
  345. }
  346. /*
  347. * Initialise a dummy MAC address. We choose the numerically
  348. * largest non-broadcast address to prevent the address getting
  349. * stolen by an Ethernet bridge for STP purposes.
  350. * (FE:FF:FF:FF:FF:FF)
  351. */
  352. memset(dev->dev_addr, 0xFF, ETH_ALEN);
  353. dev->dev_addr[0] &= ~0x01;
  354. netif_napi_add(dev, &vif->napi, xenvif_poll, XENVIF_NAPI_WEIGHT);
  355. netif_carrier_off(dev);
  356. err = register_netdev(dev);
  357. if (err) {
  358. netdev_warn(dev, "Could not register device: err=%d\n", err);
  359. free_netdev(dev);
  360. return ERR_PTR(err);
  361. }
  362. netdev_dbg(dev, "Successfully created xenvif\n");
  363. __module_get(THIS_MODULE);
  364. return vif;
  365. }
  366. int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
  367. unsigned long rx_ring_ref, unsigned int tx_evtchn,
  368. unsigned int rx_evtchn)
  369. {
  370. struct task_struct *task;
  371. int err = -ENOMEM;
  372. BUG_ON(vif->tx_irq);
  373. BUG_ON(vif->task);
  374. BUG_ON(vif->dealloc_task);
  375. err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
  376. if (err < 0)
  377. goto err;
  378. init_waitqueue_head(&vif->wq);
  379. init_waitqueue_head(&vif->dealloc_wq);
  380. if (tx_evtchn == rx_evtchn) {
  381. /* feature-split-event-channels == 0 */
  382. err = bind_interdomain_evtchn_to_irqhandler(
  383. vif->domid, tx_evtchn, xenvif_interrupt, 0,
  384. vif->dev->name, vif);
  385. if (err < 0)
  386. goto err_unmap;
  387. vif->tx_irq = vif->rx_irq = err;
  388. disable_irq(vif->tx_irq);
  389. } else {
  390. /* feature-split-event-channels == 1 */
  391. snprintf(vif->tx_irq_name, sizeof(vif->tx_irq_name),
  392. "%s-tx", vif->dev->name);
  393. err = bind_interdomain_evtchn_to_irqhandler(
  394. vif->domid, tx_evtchn, xenvif_tx_interrupt, 0,
  395. vif->tx_irq_name, vif);
  396. if (err < 0)
  397. goto err_unmap;
  398. vif->tx_irq = err;
  399. disable_irq(vif->tx_irq);
  400. snprintf(vif->rx_irq_name, sizeof(vif->rx_irq_name),
  401. "%s-rx", vif->dev->name);
  402. err = bind_interdomain_evtchn_to_irqhandler(
  403. vif->domid, rx_evtchn, xenvif_rx_interrupt, 0,
  404. vif->rx_irq_name, vif);
  405. if (err < 0)
  406. goto err_tx_unbind;
  407. vif->rx_irq = err;
  408. disable_irq(vif->rx_irq);
  409. }
  410. task = kthread_create(xenvif_kthread_guest_rx,
  411. (void *)vif, "%s-guest-rx", vif->dev->name);
  412. if (IS_ERR(task)) {
  413. pr_warn("Could not allocate kthread for %s\n", vif->dev->name);
  414. err = PTR_ERR(task);
  415. goto err_rx_unbind;
  416. }
  417. vif->task = task;
  418. task = kthread_create(xenvif_dealloc_kthread,
  419. (void *)vif, "%s-dealloc", vif->dev->name);
  420. if (IS_ERR(task)) {
  421. pr_warn("Could not allocate kthread for %s\n", vif->dev->name);
  422. err = PTR_ERR(task);
  423. goto err_rx_unbind;
  424. }
  425. vif->dealloc_task = task;
  426. rtnl_lock();
  427. if (!vif->can_sg && vif->dev->mtu > ETH_DATA_LEN)
  428. dev_set_mtu(vif->dev, ETH_DATA_LEN);
  429. netdev_update_features(vif->dev);
  430. netif_carrier_on(vif->dev);
  431. if (netif_running(vif->dev))
  432. xenvif_up(vif);
  433. rtnl_unlock();
  434. wake_up_process(vif->task);
  435. wake_up_process(vif->dealloc_task);
  436. return 0;
  437. err_rx_unbind:
  438. unbind_from_irqhandler(vif->rx_irq, vif);
  439. vif->rx_irq = 0;
  440. err_tx_unbind:
  441. unbind_from_irqhandler(vif->tx_irq, vif);
  442. vif->tx_irq = 0;
  443. err_unmap:
  444. xenvif_unmap_frontend_rings(vif);
  445. err:
  446. module_put(THIS_MODULE);
  447. return err;
  448. }
  449. void xenvif_carrier_off(struct xenvif *vif)
  450. {
  451. struct net_device *dev = vif->dev;
  452. rtnl_lock();
  453. netif_carrier_off(dev); /* discard queued packets */
  454. if (netif_running(dev))
  455. xenvif_down(vif);
  456. rtnl_unlock();
  457. }
  458. void xenvif_disconnect(struct xenvif *vif)
  459. {
  460. if (netif_carrier_ok(vif->dev))
  461. xenvif_carrier_off(vif);
  462. if (vif->task) {
  463. del_timer_sync(&vif->wake_queue);
  464. kthread_stop(vif->task);
  465. vif->task = NULL;
  466. }
  467. if (vif->dealloc_task) {
  468. kthread_stop(vif->dealloc_task);
  469. vif->dealloc_task = NULL;
  470. }
  471. if (vif->tx_irq) {
  472. if (vif->tx_irq == vif->rx_irq)
  473. unbind_from_irqhandler(vif->tx_irq, vif);
  474. else {
  475. unbind_from_irqhandler(vif->tx_irq, vif);
  476. unbind_from_irqhandler(vif->rx_irq, vif);
  477. }
  478. vif->tx_irq = 0;
  479. }
  480. xenvif_unmap_frontend_rings(vif);
  481. }
  482. void xenvif_free(struct xenvif *vif)
  483. {
  484. int i, unmap_timeout = 0;
  485. /* Here we want to avoid timeout messages if an skb can be legitimately
  486. * stuck somewhere else. Realistically this could be an another vif's
  487. * internal or QDisc queue. That another vif also has this
  488. * rx_drain_timeout_msecs timeout, but the timer only ditches the
  489. * internal queue. After that, the QDisc queue can put in worst case
  490. * XEN_NETIF_RX_RING_SIZE / MAX_SKB_FRAGS skbs into that another vif's
  491. * internal queue, so we need several rounds of such timeouts until we
  492. * can be sure that no another vif should have skb's from us. We are
  493. * not sending more skb's, so newly stuck packets are not interesting
  494. * for us here.
  495. */
  496. unsigned int worst_case_skb_lifetime = (rx_drain_timeout_msecs/1000) *
  497. DIV_ROUND_UP(XENVIF_QUEUE_LENGTH, (XEN_NETIF_RX_RING_SIZE / MAX_SKB_FRAGS));
  498. for (i = 0; i < MAX_PENDING_REQS; ++i) {
  499. if (vif->grant_tx_handle[i] != NETBACK_INVALID_HANDLE) {
  500. unmap_timeout++;
  501. schedule_timeout(msecs_to_jiffies(1000));
  502. if (unmap_timeout > worst_case_skb_lifetime &&
  503. net_ratelimit())
  504. netdev_err(vif->dev,
  505. "Page still granted! Index: %x\n",
  506. i);
  507. /* If there are still unmapped pages, reset the loop to
  508. * start checking again. We shouldn't exit here until
  509. * dealloc thread and NAPI instance release all the
  510. * pages. If a kernel bug causes the skbs to stall
  511. * somewhere, the interface cannot be brought down
  512. * properly.
  513. */
  514. i = -1;
  515. }
  516. }
  517. free_xenballooned_pages(MAX_PENDING_REQS, vif->mmap_pages);
  518. netif_napi_del(&vif->napi);
  519. unregister_netdev(vif->dev);
  520. vfree(vif->grant_copy_op);
  521. free_netdev(vif->dev);
  522. module_put(THIS_MODULE);
  523. }