1 /* A simple network driver using virtio.
3 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include <linux/netdevice.h>
21 #include <linux/etherdevice.h>
22 #include <linux/ethtool.h>
23 #include <linux/module.h>
24 #include <linux/virtio.h>
25 #include <linux/virtio_net.h>
26 #include <linux/scatterlist.h>
28 static int napi_weight = 128;
29 module_param(napi_weight, int, 0444);
31 static int csum = 1, gso = 1;
32 module_param(csum, bool, 0444);
33 module_param(gso, bool, 0444);
35 /* FIXME: MTU in config. */
36 #define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN)
37 #define GOOD_COPY_LEN 128
41 struct virtio_device *vdev;
42 struct virtqueue *rvq, *svq;
43 struct net_device *dev;
44 struct napi_struct napi;
46 /* The skb we couldn't send because buffers were full. */
47 struct sk_buff *last_xmit_skb;
49 /* If we need to free in a timer, this is it. */
50 struct timer_list xmit_free_timer;
52 /* Number of input buffers, and max we've ever had. */
53 unsigned int num, max;
55 /* For cleaning up after transmission. */
56 struct tasklet_struct tasklet;
59 /* I like... big packets and I cannot lie! */
62 /* Host will merge rx buffers for big packets (shake it! shake it!) */
63 bool mergeable_rx_bufs;
65 /* Receive & send queues. */
66 struct sk_buff_head recv;
67 struct sk_buff_head send;
69 /* Chain pages by the private ptr. */
73 static inline void *skb_vnet_hdr(struct sk_buff *skb)
75 return (struct virtio_net_hdr *)skb->cb;
78 static void give_a_page(struct virtnet_info *vi, struct page *page)
80 page->private = (unsigned long)vi->pages;
84 static void trim_pages(struct virtnet_info *vi, struct sk_buff *skb)
88 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
89 give_a_page(vi, skb_shinfo(skb)->frags[i].page);
90 skb_shinfo(skb)->nr_frags = 0;
94 static struct page *get_a_page(struct virtnet_info *vi, gfp_t gfp_mask)
96 struct page *p = vi->pages;
99 vi->pages = (struct page *)p->private;
101 p = alloc_page(gfp_mask);
105 static void skb_xmit_done(struct virtqueue *svq)
107 struct virtnet_info *vi = svq->vdev->priv;
109 /* Suppress further interrupts. */
110 svq->vq_ops->disable_cb(svq);
112 /* We were probably waiting for more output buffers. */
113 netif_wake_queue(vi->dev);
115 /* Make sure we re-xmit last_xmit_skb: if there are no more packets
116 * queued, start_xmit won't be called. */
117 tasklet_schedule(&vi->tasklet);
120 static void receive_skb(struct net_device *dev, struct sk_buff *skb,
123 struct virtnet_info *vi = netdev_priv(dev);
124 struct virtio_net_hdr *hdr = skb_vnet_hdr(skb);
128 if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) {
129 pr_debug("%s: short packet %i\n", dev->name, len);
130 dev->stats.rx_length_errors++;
134 if (vi->mergeable_rx_bufs) {
135 struct virtio_net_hdr_mrg_rxbuf *mhdr = skb_vnet_hdr(skb);
137 char *p = page_address(skb_shinfo(skb)->frags[0].page);
141 len -= sizeof(struct virtio_net_hdr_mrg_rxbuf);
143 memcpy(hdr, p, sizeof(*mhdr));
147 if (copy > skb_tailroom(skb))
148 copy = skb_tailroom(skb);
150 memcpy(skb_put(skb, copy), p, copy);
155 give_a_page(vi, skb_shinfo(skb)->frags[0].page);
156 skb_shinfo(skb)->nr_frags--;
158 skb_shinfo(skb)->frags[0].page_offset +=
159 sizeof(*mhdr) + copy;
160 skb_shinfo(skb)->frags[0].size = len;
161 skb->data_len += len;
165 while (--mhdr->num_buffers) {
166 struct sk_buff *nskb;
168 i = skb_shinfo(skb)->nr_frags;
169 if (i >= MAX_SKB_FRAGS) {
170 pr_debug("%s: packet too long %d\n", dev->name,
172 dev->stats.rx_length_errors++;
176 nskb = vi->rvq->vq_ops->get_buf(vi->rvq, &len);
178 pr_debug("%s: rx error: %d buffers missing\n",
179 dev->name, mhdr->num_buffers);
180 dev->stats.rx_length_errors++;
184 __skb_unlink(nskb, &vi->recv);
187 skb_shinfo(skb)->frags[i] = skb_shinfo(nskb)->frags[0];
188 skb_shinfo(nskb)->nr_frags = 0;
194 skb_shinfo(skb)->frags[i].size = len;
195 skb_shinfo(skb)->nr_frags++;
196 skb->data_len += len;
200 len -= sizeof(struct virtio_net_hdr);
202 if (len <= MAX_PACKET_LEN)
205 err = pskb_trim(skb, len);
207 pr_debug("%s: pskb_trim failed %i %d\n", dev->name,
209 dev->stats.rx_dropped++;
214 skb->truesize += skb->data_len;
215 dev->stats.rx_bytes += skb->len;
216 dev->stats.rx_packets++;
218 if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
219 pr_debug("Needs csum!\n");
220 if (!skb_partial_csum_set(skb,hdr->csum_start,hdr->csum_offset))
224 skb->protocol = eth_type_trans(skb, dev);
225 pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
226 ntohs(skb->protocol), skb->len, skb->pkt_type);
228 if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
230 switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
231 case VIRTIO_NET_HDR_GSO_TCPV4:
232 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
234 case VIRTIO_NET_HDR_GSO_UDP:
235 skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
237 case VIRTIO_NET_HDR_GSO_TCPV6:
238 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
242 printk(KERN_WARNING "%s: bad gso type %u.\n",
243 dev->name, hdr->gso_type);
247 if (hdr->gso_type & VIRTIO_NET_HDR_GSO_ECN)
248 skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
250 skb_shinfo(skb)->gso_size = hdr->gso_size;
251 if (skb_shinfo(skb)->gso_size == 0) {
253 printk(KERN_WARNING "%s: zero gso size.\n",
258 /* Header must be checked, and gso_segs computed. */
259 skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY;
260 skb_shinfo(skb)->gso_segs = 0;
263 netif_receive_skb(skb);
267 dev->stats.rx_frame_errors++;
272 static void try_fill_recv_maxbufs(struct virtnet_info *vi)
275 struct scatterlist sg[2+MAX_SKB_FRAGS];
278 sg_init_table(sg, 2+MAX_SKB_FRAGS);
280 struct virtio_net_hdr *hdr;
282 skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN);
286 skb_put(skb, MAX_PACKET_LEN);
288 hdr = skb_vnet_hdr(skb);
289 sg_init_one(sg, hdr, sizeof(*hdr));
291 if (vi->big_packets) {
292 for (i = 0; i < MAX_SKB_FRAGS; i++) {
293 skb_frag_t *f = &skb_shinfo(skb)->frags[i];
294 f->page = get_a_page(vi, GFP_ATOMIC);
301 skb->data_len += PAGE_SIZE;
302 skb->len += PAGE_SIZE;
304 skb_shinfo(skb)->nr_frags++;
308 num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
309 skb_queue_head(&vi->recv, skb);
311 err = vi->rvq->vq_ops->add_buf(vi->rvq, sg, 0, num, skb);
313 skb_unlink(skb, &vi->recv);
320 if (unlikely(vi->num > vi->max))
322 vi->rvq->vq_ops->kick(vi->rvq);
325 static void try_fill_recv(struct virtnet_info *vi)
328 struct scatterlist sg[1];
331 if (!vi->mergeable_rx_bufs) {
332 try_fill_recv_maxbufs(vi);
339 skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN);
343 skb_reserve(skb, NET_IP_ALIGN);
345 f = &skb_shinfo(skb)->frags[0];
346 f->page = get_a_page(vi, GFP_ATOMIC);
355 skb_shinfo(skb)->nr_frags++;
357 sg_init_one(sg, page_address(f->page), PAGE_SIZE);
358 skb_queue_head(&vi->recv, skb);
360 err = vi->rvq->vq_ops->add_buf(vi->rvq, sg, 0, 1, skb);
362 skb_unlink(skb, &vi->recv);
368 if (unlikely(vi->num > vi->max))
370 vi->rvq->vq_ops->kick(vi->rvq);
373 static void skb_recv_done(struct virtqueue *rvq)
375 struct virtnet_info *vi = rvq->vdev->priv;
376 /* Schedule NAPI, Suppress further interrupts if successful. */
377 if (netif_rx_schedule_prep(vi->dev, &vi->napi)) {
378 rvq->vq_ops->disable_cb(rvq);
379 __netif_rx_schedule(vi->dev, &vi->napi);
383 static int virtnet_poll(struct napi_struct *napi, int budget)
385 struct virtnet_info *vi = container_of(napi, struct virtnet_info, napi);
386 struct sk_buff *skb = NULL;
387 unsigned int len, received = 0;
390 while (received < budget &&
391 (skb = vi->rvq->vq_ops->get_buf(vi->rvq, &len)) != NULL) {
392 __skb_unlink(skb, &vi->recv);
393 receive_skb(vi->dev, skb, len);
398 /* FIXME: If we oom and completely run out of inbufs, we need
399 * to start a timer trying to fill more. */
400 if (vi->num < vi->max / 2)
403 /* Out of packets? */
404 if (received < budget) {
405 netif_rx_complete(vi->dev, napi);
406 if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq))
407 && napi_schedule_prep(napi)) {
408 vi->rvq->vq_ops->disable_cb(vi->rvq);
409 __netif_rx_schedule(vi->dev, napi);
417 static void free_old_xmit_skbs(struct virtnet_info *vi)
422 while ((skb = vi->svq->vq_ops->get_buf(vi->svq, &len)) != NULL) {
423 pr_debug("Sent skb %p\n", skb);
424 __skb_unlink(skb, &vi->send);
425 vi->dev->stats.tx_bytes += skb->len;
426 vi->dev->stats.tx_packets++;
431 /* If the virtio transport doesn't always notify us when all in-flight packets
432 * are consumed, we fall back to using this function on a timer to free them. */
433 static void xmit_free(unsigned long data)
435 struct virtnet_info *vi = (void *)data;
437 netif_tx_lock(vi->dev);
439 free_old_xmit_skbs(vi);
441 if (!skb_queue_empty(&vi->send))
442 mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
444 netif_tx_unlock(vi->dev);
447 static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
450 struct scatterlist sg[2+MAX_SKB_FRAGS];
451 struct virtio_net_hdr_mrg_rxbuf *mhdr = skb_vnet_hdr(skb);
452 struct virtio_net_hdr *hdr = skb_vnet_hdr(skb);
453 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
455 sg_init_table(sg, 2+MAX_SKB_FRAGS);
457 pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest);
459 if (skb->ip_summed == CHECKSUM_PARTIAL) {
460 hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
461 hdr->csum_start = skb->csum_start - skb_headroom(skb);
462 hdr->csum_offset = skb->csum_offset;
465 hdr->csum_offset = hdr->csum_start = 0;
468 if (skb_is_gso(skb)) {
469 hdr->hdr_len = skb_transport_header(skb) - skb->data;
470 hdr->gso_size = skb_shinfo(skb)->gso_size;
471 if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4)
472 hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
473 else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
474 hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
475 else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP)
476 hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP;
479 if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN)
480 hdr->gso_type |= VIRTIO_NET_HDR_GSO_ECN;
482 hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
483 hdr->gso_size = hdr->hdr_len = 0;
486 mhdr->num_buffers = 0;
488 /* Encode metadata header at front. */
489 if (vi->mergeable_rx_bufs)
490 sg_init_one(sg, mhdr, sizeof(*mhdr));
492 sg_init_one(sg, hdr, sizeof(*hdr));
494 num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
496 err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
497 if (!err && !vi->free_in_tasklet)
498 mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
503 static void xmit_tasklet(unsigned long data)
505 struct virtnet_info *vi = (void *)data;
507 netif_tx_lock_bh(vi->dev);
508 if (vi->last_xmit_skb && xmit_skb(vi, vi->last_xmit_skb) == 0) {
509 vi->svq->vq_ops->kick(vi->svq);
510 vi->last_xmit_skb = NULL;
512 if (vi->free_in_tasklet)
513 free_old_xmit_skbs(vi);
514 netif_tx_unlock_bh(vi->dev);
517 static int start_xmit(struct sk_buff *skb, struct net_device *dev)
519 struct virtnet_info *vi = netdev_priv(dev);
522 /* Free up any pending old buffers before queueing new ones. */
523 free_old_xmit_skbs(vi);
525 /* If we has a buffer left over from last time, send it now. */
526 if (unlikely(vi->last_xmit_skb) &&
527 xmit_skb(vi, vi->last_xmit_skb) != 0)
530 vi->last_xmit_skb = NULL;
532 /* Put new one in send queue and do transmit */
534 __skb_queue_head(&vi->send, skb);
535 if (xmit_skb(vi, skb) != 0) {
536 vi->last_xmit_skb = skb;
542 vi->svq->vq_ops->kick(vi->svq);
546 pr_debug("%s: virtio not prepared to send\n", dev->name);
547 netif_stop_queue(dev);
549 /* Activate callback for using skbs: if this returns false it
550 * means some were used in the meantime. */
551 if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
552 vi->svq->vq_ops->disable_cb(vi->svq);
553 netif_start_queue(dev);
557 /* Drop this skb: we only queue one. */
558 vi->dev->stats.tx_dropped++;
564 #ifdef CONFIG_NET_POLL_CONTROLLER
565 static void virtnet_netpoll(struct net_device *dev)
567 struct virtnet_info *vi = netdev_priv(dev);
569 napi_schedule(&vi->napi);
573 static int virtnet_open(struct net_device *dev)
575 struct virtnet_info *vi = netdev_priv(dev);
577 napi_enable(&vi->napi);
579 /* If all buffers were filled by other side before we napi_enabled, we
580 * won't get another interrupt, so process any outstanding packets
581 * now. virtnet_poll wants re-enable the queue, so we disable here.
582 * We synchronize against interrupts via NAPI_STATE_SCHED */
583 if (netif_rx_schedule_prep(dev, &vi->napi)) {
584 vi->rvq->vq_ops->disable_cb(vi->rvq);
585 __netif_rx_schedule(dev, &vi->napi);
590 static int virtnet_close(struct net_device *dev)
592 struct virtnet_info *vi = netdev_priv(dev);
594 napi_disable(&vi->napi);
599 static int virtnet_set_tx_csum(struct net_device *dev, u32 data)
601 struct virtnet_info *vi = netdev_priv(dev);
602 struct virtio_device *vdev = vi->vdev;
604 if (data && !virtio_has_feature(vdev, VIRTIO_NET_F_CSUM))
607 return ethtool_op_set_tx_hw_csum(dev, data);
610 static struct ethtool_ops virtnet_ethtool_ops = {
611 .set_tx_csum = virtnet_set_tx_csum,
612 .set_sg = ethtool_op_set_sg,
613 .set_tso = ethtool_op_set_tso,
616 static int virtnet_probe(struct virtio_device *vdev)
619 struct net_device *dev;
620 struct virtnet_info *vi;
622 /* Allocate ourselves a network device with room for our info */
623 dev = alloc_etherdev(sizeof(struct virtnet_info));
627 /* Set up network device as normal. */
628 dev->open = virtnet_open;
629 dev->stop = virtnet_close;
630 dev->hard_start_xmit = start_xmit;
631 dev->features = NETIF_F_HIGHDMA;
632 #ifdef CONFIG_NET_POLL_CONTROLLER
633 dev->poll_controller = virtnet_netpoll;
635 SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
636 SET_NETDEV_DEV(dev, &vdev->dev);
638 /* Do we support "hardware" checksums? */
639 if (csum && virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) {
640 /* This opens up the world of extra features. */
641 dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
642 if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) {
643 dev->features |= NETIF_F_TSO | NETIF_F_UFO
644 | NETIF_F_TSO_ECN | NETIF_F_TSO6;
646 /* Individual feature bits: what can host handle? */
647 if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO4))
648 dev->features |= NETIF_F_TSO;
649 if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO6))
650 dev->features |= NETIF_F_TSO6;
651 if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN))
652 dev->features |= NETIF_F_TSO_ECN;
653 if (gso && virtio_has_feature(vdev, VIRTIO_NET_F_HOST_UFO))
654 dev->features |= NETIF_F_UFO;
657 /* Configuration may specify what MAC to use. Otherwise random. */
658 if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) {
659 vdev->config->get(vdev,
660 offsetof(struct virtio_net_config, mac),
661 dev->dev_addr, dev->addr_len);
663 random_ether_addr(dev->dev_addr);
665 /* Set up our device-specific information */
666 vi = netdev_priv(dev);
667 netif_napi_add(dev, &vi->napi, virtnet_poll, napi_weight);
673 /* If they give us a callback when all buffers are done, we don't need
675 vi->free_in_tasklet = virtio_has_feature(vdev,VIRTIO_F_NOTIFY_ON_EMPTY);
677 /* If we can receive ANY GSO packets, we must allocate large ones. */
678 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4)
679 || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6)
680 || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN))
681 vi->big_packets = true;
683 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
684 vi->mergeable_rx_bufs = true;
686 /* We expect two virtqueues, receive then send. */
687 vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done);
688 if (IS_ERR(vi->rvq)) {
689 err = PTR_ERR(vi->rvq);
693 vi->svq = vdev->config->find_vq(vdev, 1, skb_xmit_done);
694 if (IS_ERR(vi->svq)) {
695 err = PTR_ERR(vi->svq);
699 /* Initialize our empty receive and send queues. */
700 skb_queue_head_init(&vi->recv);
701 skb_queue_head_init(&vi->send);
703 tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi);
705 if (!vi->free_in_tasklet)
706 setup_timer(&vi->xmit_free_timer, xmit_free, (unsigned long)vi);
708 err = register_netdev(dev);
710 pr_debug("virtio_net: registering device failed\n");
714 /* Last of all, set up some receive buffers. */
717 /* If we didn't even get one input buffer, we're useless. */
723 pr_debug("virtnet: registered device %s\n", dev->name);
727 unregister_netdev(dev);
729 vdev->config->del_vq(vi->svq);
731 vdev->config->del_vq(vi->rvq);
737 static void virtnet_remove(struct virtio_device *vdev)
739 struct virtnet_info *vi = vdev->priv;
742 /* Stop all the virtqueues. */
743 vdev->config->reset(vdev);
745 if (!vi->free_in_tasklet)
746 del_timer_sync(&vi->xmit_free_timer);
748 /* Free our skbs in send and recv queues, if any. */
749 while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
753 __skb_queue_purge(&vi->send);
755 BUG_ON(vi->num != 0);
757 vdev->config->del_vq(vi->svq);
758 vdev->config->del_vq(vi->rvq);
759 unregister_netdev(vi->dev);
762 __free_pages(get_a_page(vi, GFP_KERNEL), 0);
764 free_netdev(vi->dev);
767 static struct virtio_device_id id_table[] = {
768 { VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID },
772 static unsigned int features[] = {
773 VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM,
774 VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC,
775 VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6,
776 VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6,
777 VIRTIO_NET_F_GUEST_ECN, /* We don't yet handle UFO input. */
778 VIRTIO_NET_F_MRG_RXBUF,
779 VIRTIO_F_NOTIFY_ON_EMPTY,
782 static struct virtio_driver virtio_net = {
783 .feature_table = features,
784 .feature_table_size = ARRAY_SIZE(features),
785 .driver.name = KBUILD_MODNAME,
786 .driver.owner = THIS_MODULE,
787 .id_table = id_table,
788 .probe = virtnet_probe,
789 .remove = __devexit_p(virtnet_remove),
792 static int __init init(void)
794 return register_virtio_driver(&virtio_net);
797 static void __exit fini(void)
799 unregister_virtio_driver(&virtio_net);
804 MODULE_DEVICE_TABLE(virtio, id_table);
805 MODULE_DESCRIPTION("Virtio network driver");
806 MODULE_LICENSE("GPL");