1. 11 7月, 2008 1 次提交
  2. 03 7月, 2008 3 次提交
    • R
      tun: Allow GSO using virtio_net_hdr · f43798c2
      Rusty Russell 提交于
      Add a IFF_VNET_HDR flag.  This uses the same ABI as virtio_net
      (ie. prepending struct virtio_net_hdr to packets) to indicate GSO and
      checksum information.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NMax Krasnyansky <maxk@qualcomm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f43798c2
    • R
      tun: TUNSETFEATURES to set gso features. · 5228ddc9
      Rusty Russell 提交于
      ethtool is useful for setting (some) device fields, but it's
      root-only.  Finer feature control is available through a tun-specific
      ioctl.
      
      (Includes Mark McLoughlin <markmc@redhat.com>'s fix to hold rtnl sem).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NMax Krasnyansky <maxk@qualcomm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5228ddc9
    • R
      tun: Interface to query tun/tap features. · 07240fd0
      Rusty Russell 提交于
      The problem with introducing checksum offload and gso to tun is they
      need to set dev->features to enable GSO and/or checksumming, which is
      supposed to be done before register_netdevice(), ie. as part of
      TUNSETIFF.
      
      Unfortunately, TUNSETIFF has always just ignored flags it doesn't
      understand, so there's no good way of detecting whether the kernel
      supports new IFF_ flags.
      
      This patch implements a TUNGETFEATURES ioctl which returns all the valid IFF
      flags.  It could be extended later to include other features.
      
      Here's an example program which uses it:
      
      #include <linux/if_tun.h>
      #include <sys/types.h>
      #include <sys/ioctl.h>
      #include <sys/stat.h>
      #include <fcntl.h>
      #include <err.h>
      #include <stdio.h>
      
      static struct {
      	unsigned int flag;
      	const char *name;
      } known_flags[] = {
      	{ IFF_TUN, "TUN" },
      	{ IFF_TAP, "TAP" },
      	{ IFF_NO_PI, "NO_PI" },
      	{ IFF_ONE_QUEUE, "ONE_QUEUE" },
      };
      
      int main()
      {
      	unsigned int features, i;
      
      	int netfd = open("/dev/net/tun", O_RDWR);
      	if (netfd < 0)
      		err(1, "Opening /dev/net/tun");
      
      	if (ioctl(netfd, TUNGETFEATURES, &features) != 0) {
      		printf("Kernel does not support TUNGETFEATURES, guessing\n");
      		features = (IFF_TUN|IFF_TAP|IFF_NO_PI|IFF_ONE_QUEUE);
      	}
      	printf("Available features are: ");
      	for (i = 0; i < sizeof(known_flags)/sizeof(known_flags[0]); i++) {
      		if (features & known_flags[i].flag) {
      			features &= ~known_flags[i].flag;
      			printf("%s ", known_flags[i].name);
      		}
      	}
      	if (features)
      		printf("(UNKNOWN %#x)", features);
      	printf("\n");
      	return 0;
      }
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NMax Krasnyansky <maxk@qualcomm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07240fd0
  3. 18 6月, 2008 1 次提交
  4. 24 4月, 2008 2 次提交
  5. 16 4月, 2008 3 次提交
    • P
      [TUN]: Allow to register tun devices in namespace. · fc54c658
      Pavel Emelyanov 提交于
      This is basically means that a net is set for a new device, but
      actually also involves two more steps:
      
      1. mark the tun device as "local", i.e. do not allow for it to
         move across namespaces.
      
      This is done so, since tun device is most often associated to some
      file (and thus to some process) and moving the device alone is not
      valid while keeping the file and the process outside. The need in 
      ability to move a detached persistent device is to be investigated 
      later.
      
      2. get the tun device's net when tun becomes attached and put one
         when it becomes detached.
      
      This is needed to handle the case when a task owning the tun dies,
      but a files lives for some more time - in this case we must not
      allow for net to be freed, since its exit hook will spoil that file's
      private data by unregistering the tun from under tun_chr_close.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc54c658
    • P
      [TUN]: Make the tun_dev_list per-net. · d647a591
      Pavel Emelyanov 提交于
      Remove the static tun_dev_list and replace its occurrences in
      driver with per-net one.
      
      It is used in two places - in tun_set_iff and tun_cleanup. In 
      the first case it's legal to use current net_ns. In the cleanup
      call - move the loop, that unregisters all devices in net exit
      hook.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d647a591
    • P
      [TUN]: Introduce the tun_net structure and init/exit net ops. · 79d17604
      Pavel Emelyanov 提交于
      This is the first step in making tuntap devices work in net 
      namespaces. The structure mentioned is pointed by generic
      net pointer with tun_net_id id, and tun driver fills one on 
      its load. It will contain only the tun devices list.
      
      So declare this structure and introduce net init and exit hooks.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79d17604
  6. 13 4月, 2008 2 次提交
  7. 01 3月, 2008 1 次提交
  8. 05 2月, 2008 1 次提交
  9. 29 1月, 2008 2 次提交
  10. 27 12月, 2007 1 次提交
  11. 11 10月, 2007 5 次提交
  12. 11 7月, 2007 1 次提交
  13. 26 4月, 2007 4 次提交
  14. 13 2月, 2007 1 次提交
  15. 02 10月, 2006 1 次提交
  16. 01 10月, 2006 1 次提交
  17. 14 9月, 2006 2 次提交
  18. 01 7月, 2006 1 次提交
  19. 27 6月, 2006 1 次提交
  20. 23 6月, 2006 1 次提交
  21. 12 3月, 2006 1 次提交
  22. 02 9月, 2005 1 次提交
  23. 09 7月, 2005 1 次提交
  24. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4