search for: setup_tun_net

Displaying 20 results from an estimated 20 matches for "setup_tun_net".

2007 May 08
1
[PATCH] lguest: two net bugfixes
...net/lguest_net.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff -r 999a9058a151 Documentation/lguest/lguest.c --- a/Documentation/lguest/lguest.c Tue May 08 19:49:33 2007 +1000 +++ b/Documentation/lguest/lguest.c Tue May 08 21:04:51 2007 +1000 @@ -860,6 +860,10 @@ static void setup_tun_net(const char *ar /* We are peer 0, ie. first slot. */ configure_device(ipfd, ifr.ifr_name, ip, dev->mem); + + /* Set "promisc" bit: we want every single packet. */ + *((u8 *)dev->mem) |= 0x1; + close(ipfd); verbose("device %p: tun net %u.%u.%u.%u\n", diff -r 999a...
2007 May 08
1
[PATCH] lguest: two net bugfixes
...net/lguest_net.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff -r 999a9058a151 Documentation/lguest/lguest.c --- a/Documentation/lguest/lguest.c Tue May 08 19:49:33 2007 +1000 +++ b/Documentation/lguest/lguest.c Tue May 08 21:04:51 2007 +1000 @@ -860,6 +860,10 @@ static void setup_tun_net(const char *ar /* We are peer 0, ie. first slot. */ configure_device(ipfd, ifr.ifr_name, ip, dev->mem); + + /* Set "promisc" bit: we want every single packet. */ + *((u8 *)dev->mem) |= 0x1; + close(ipfd); verbose("device %p: tun net %u.%u.%u.%u\n", diff -r 999a...
2007 Jul 20
2
[PATCH] Remove -static from Documentation/lguest/Makefile
...e, features, num_pages); + dev->desc = new_dev_desc(devices->descs, type, features, num_pages); dev->mem = (void *)(dev->desc->pfn * getpagesize()); dev->handle_input = handle_input; dev->watch_key = (unsigned long)dev->mem + watch_off; @@ -866,30 +869,6 @@ static void setup_tun_net(const char *ar verbose("attached to bridge: %s\n", br_name); } -/* Now we know how much memory we have, we copy in device descriptors */ -static void map_device_descriptors(struct device_list *devs, unsigned long mem) -{ - struct device *i; - unsigned int num; - struct lguest_device...
2007 Jul 20
2
[PATCH] Remove -static from Documentation/lguest/Makefile
...e, features, num_pages); + dev->desc = new_dev_desc(devices->descs, type, features, num_pages); dev->mem = (void *)(dev->desc->pfn * getpagesize()); dev->handle_input = handle_input; dev->watch_key = (unsigned long)dev->mem + watch_off; @@ -866,30 +869,6 @@ static void setup_tun_net(const char *ar verbose("attached to bridge: %s\n", br_name); } -/* Now we know how much memory we have, we copy in device descriptors */ -static void map_device_descriptors(struct device_list *devs, unsigned long mem) -{ - struct device *i; - unsigned int num; - struct lguest_device...
2007 Nov 10
2
[PATCH] Change virtio_pci to use a shared memory area for config
This patch changes virtio_pci to use a shared memory area for virtio config info instead of using the PCI configuration space. This is closer semantically to what the virtio API exposes and is it a lot easier to implement on both ends. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index eb9a8e0..7e6e453 100644
2007 Nov 10
2
[PATCH] Change virtio_pci to use a shared memory area for config
This patch changes virtio_pci to use a shared memory area for virtio config info instead of using the PCI configuration space. This is closer semantically to what the virtio API exposes and is it a lot easier to implement on both ends. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index eb9a8e0..7e6e453 100644
2008 May 30
2
[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is
2008 May 30
2
[PATCH 1/3] virtio: VIRTIO_F_NOTIFY_ON_EMPTY to force callback on empty
virtio allows drivers to suppress callbacks (ie. interrupts) for efficiency (no locking, it's just an optimization). There's a similar mechanism for the host to suppress notifications coming from the guest: in that case, we ignore the suppression if the ring is completely full. It turns out that life is simpler if the host similarly ignores callback suppression when the ring is
2008 Jun 25
3
[PATCH 1/4] tun: Interface to query tun/tap features.
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
2008 Jun 25
3
[PATCH 1/4] tun: Interface to query tun/tap features.
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
2007 May 04
1
[PATCH 1/3] Documentation and example updates
...c unsigned long unpack_bzimage(int void *img = (void *)0x100000; f = gzdopen(fd, "rb"); - if (gzdirect(f)) - errx(1, "did not find correct gzip header"); while ((ret = gzread(f, img + len, 65536)) > 0) len += ret; if (ret < 0) @@ -820,6 +821,7 @@ static void setup_tun_net(const char *ar strcpy(ifr.ifr_name, "tap%d"); if (ioctl(netfd, TUNSETIFF, &ifr) != 0) err(1, "configuring /dev/net/tun"); + ioctl(netfd, TUNSETNOCSUM, 1); /* You will be peer 1: we should create enough jitter to randomize */ dev = new_device(devices, LGUEST_DEVI...
2007 May 04
1
[PATCH 1/3] Documentation and example updates
...c unsigned long unpack_bzimage(int void *img = (void *)0x100000; f = gzdopen(fd, "rb"); - if (gzdirect(f)) - errx(1, "did not find correct gzip header"); while ((ret = gzread(f, img + len, 65536)) > 0) len += ret; if (ret < 0) @@ -820,6 +821,7 @@ static void setup_tun_net(const char *ar strcpy(ifr.ifr_name, "tap%d"); if (ioctl(netfd, TUNSETIFF, &ifr) != 0) err(1, "configuring /dev/net/tun"); + ioctl(netfd, TUNSETNOCSUM, 1); /* You will be peer 1: we should create enough jitter to randomize */ dev = new_device(devices, LGUEST_DEVI...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...\n", if_name, br_name); + case ELOOP: + errx(1, "device %s is a bridge device itself; " + "can't enslave a bridge device to a bridge device.\n", + if_name); + default: + err(1, "can't add %s to bridge %s\n", if_name, br_name); + } +} + + +static void setup_tun_net(const char *arg, + struct lguest_device_desc *descs, + struct devices *devices) +{ + struct device *dev; + struct ifreq ifr; + int netfd, ipfd; + u32 ipaddr; + const char *br_name = NULL; + + netfd = open("/dev/net/tun", O_RDWR); + if (netfd < 0) + err(1, "opening /dev/ne...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...\n", if_name, br_name); + case ELOOP: + errx(1, "device %s is a bridge device itself; " + "can't enslave a bridge device to a bridge device.\n", + if_name); + default: + err(1, "can't add %s to bridge %s\n", if_name, br_name); + } +} + + +static void setup_tun_net(const char *arg, + struct lguest_device_desc *descs, + struct devices *devices) +{ + struct device *dev; + struct ifreq ifr; + int netfd, ipfd; + u32 ipaddr; + const char *br_name = NULL; + + netfd = open("/dev/net/tun", O_RDWR); + if (netfd < 0) + err(1, "opening /dev/ne...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...fr.ifr_flags = IFF_UP; + if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) + err(1, "Bringing interface %s up", devname); + + if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0) + err(1, "getting hw address for %s", devname); + + memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6); +} + +static void setup_tun_net(const char *arg, struct device_list *devices) +{ + struct device *dev; + struct ifreq ifr; + int netfd, ipfd; + u32 ip; + const char *br_name = NULL; + + netfd = open_or_die("/dev/net/tun", O_RDWR); + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_flags = IFF_TAP | IFF_NO_PI; + strcpy(ifr.if...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...fr.ifr_flags = IFF_UP; + if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) + err(1, "Bringing interface %s up", devname); + + if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0) + err(1, "getting hw address for %s", devname); + + memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6); +} + +static void setup_tun_net(const char *arg, struct device_list *devices) +{ + struct device *dev; + struct ifreq ifr; + int netfd, ipfd; + u32 ip; + const char *br_name = NULL; + + netfd = open_or_die("/dev/net/tun", O_RDWR); + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_flags = IFF_TAP | IFF_NO_PI; + strcpy(ifr.if...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...der. The first network device on the command line + * is eth0, the first block device /dev/vda, etc. */ + if (devices.lastdev) + devices.lastdev->next = dev; + else + devices.dev = dev; + devices.lastdev = dev; + return dev; } @@ -1220,7 +1250,7 @@ static void setup_tun_net(const char *arg) int netfd, ipfd; u32 ip; const char *br_name = NULL; - u8 hwaddr[6]; + struct virtio_net_config conf; /* We open the /dev/net/tun device and tell it we want a tap device. A * tap device is like a tun device, only somehow different. To tell @@ -12...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...der. The first network device on the command line + * is eth0, the first block device /dev/vda, etc. */ + if (devices.lastdev) + devices.lastdev->next = dev; + else + devices.dev = dev; + devices.lastdev = dev; + return dev; } @@ -1220,7 +1250,7 @@ static void setup_tun_net(const char *arg) int netfd, ipfd; u32 ip; const char *br_name = NULL; - u8 hwaddr[6]; + struct virtio_net_config conf; /* We open the /dev/net/tun device and tell it we want a tap device. A * tap device is like a tun device, only somehow different. To tell @@ -12...
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all, These are the patches I'm planning to submit for 2.6.24. Comments gratefully accepted. Along with the usual cleanups and improvements are Jes' de-i386-ification patches, and a new "virtio" mechanism designed to be shared with KVM (and hopefully other hypervisors). Cheers, Rusty. Documentation/lguest/Makefile | 30 Documentation/lguest/lguest.c