Skip to content
Snippets Groups Projects
Select Git revision
  • 2d0469814ade60efb5cd8ca9af93c43bc3ba831e
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

test_sysctl.c

Blame
  • macvtap.c 30.77 KiB
    #include <linux/etherdevice.h>
    #include <linux/if_macvlan.h>
    #include <linux/if_vlan.h>
    #include <linux/interrupt.h>
    #include <linux/nsproxy.h>
    #include <linux/compat.h>
    #include <linux/if_tun.h>
    #include <linux/module.h>
    #include <linux/skbuff.h>
    #include <linux/cache.h>
    #include <linux/sched.h>
    #include <linux/types.h>
    #include <linux/slab.h>
    #include <linux/init.h>
    #include <linux/wait.h>
    #include <linux/cdev.h>
    #include <linux/idr.h>
    #include <linux/fs.h>
    
    #include <net/net_namespace.h>
    #include <net/rtnetlink.h>
    #include <net/sock.h>
    #include <linux/virtio_net.h>
    
    /*
     * A macvtap queue is the central object of this driver, it connects
     * an open character device to a macvlan interface. There can be
     * multiple queues on one interface, which map back to queues
     * implemented in hardware on the underlying device.
     *
     * macvtap_proto is used to allocate queues through the sock allocation
     * mechanism.
     *
     */
    struct macvtap_queue {
    	struct sock sk;
    	struct socket sock;
    	struct socket_wq wq;
    	int vnet_hdr_sz;
    	struct macvlan_dev __rcu *vlan;
    	struct file *file;
    	unsigned int flags;
    	u16 queue_index;
    	bool enabled;
    	struct list_head next;
    };
    
    static struct proto macvtap_proto = {
    	.name = "macvtap",
    	.owner = THIS_MODULE,
    	.obj_size = sizeof (struct macvtap_queue),
    };
    
    /*
     * Variables for dealing with macvtaps device numbers.
     */
    static dev_t macvtap_major;
    #define MACVTAP_NUM_DEVS (1U << MINORBITS)
    static DEFINE_MUTEX(minor_lock);
    static DEFINE_IDR(minor_idr);
    
    #define GOODCOPY_LEN 128
    static struct class *macvtap_class;
    static struct cdev macvtap_cdev;
    
    static const struct proto_ops macvtap_socket_ops;
    
    #define TUN_OFFLOADS (NETIF_F_HW_CSUM | NETIF_F_TSO_ECN | NETIF_F_TSO | \
    		      NETIF_F_TSO6 | NETIF_F_UFO)
    #define RX_OFFLOADS (NETIF_F_GRO | NETIF_F_LRO)