aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-11 10:51:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-11 10:51:59 -0400
commit0cb77508252e2d0e00c5ec7e57b4be9b3f7eb24d (patch)
treecb7ed9fbc7f8fdc6e727d60e2627799a7fd7a8cc /Documentation
parentffb6a445e7cdc03d67f8b9fb2f5afaafd8260b4b (diff)
parent9026c4927254f5bea695cc3ef2e255280e6a3011 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Missing cancel of work items in mac80211 MLME, from Ben Greear. 2) Fix DMA mapping handling in iwlwifi by using coherent DMA for command headers, from Johannes Berg. 3) Decrease the amount of pressure on the page allocator by using order 1 pages less in iwlwifi, from Emmanuel Grumbach. 4) Fix mesh PS broadcast OOPS in mac80211, from Marco Porsch. 5) Don't forget to recalculate idle state in mac80211 monitor interface, from Felix Fietkau. 6) Fix varargs in netfilter conntrack handler, from Joe Perches. 7) Need to reset entire chip when command queue fills up in iwlwifi, from Emmanuel Grumbach. 8) The TX antenna value must be valid when calibrations are performed in iwlwifi, fix from Dor Shaish. 9) Don't generate netfilter audit log entries when audit is disabled, from Gao Feng. 10) Deal with DMA unit hang on e1000e during power state transitions, from Bruce Allan. 11) Remove BUILD_BUG_ON check from igb driver, from Alexander Duyck. 12) Fix lockdep warning on i2c handling of igb driver, from Carolyn Wyborny. 13) Fix several TTY handling issues in IRDA ircomm tty driver, from Peter Hurley. 14) Several QFQ packet scheduler fixes from Paolo Valente. 15) When VXLAN encapsulates on transmit, we have to reset the netfilter state. From Zang MingJie. 16) Fix jiffie check in net_rx_action() so that we really cap the processing at 2HZ. From Eric Dumazet. 17) Fix erroneous trigger of IP option space exhaustion, when routers are pre-specified and we are looking to see if we can insert a timestamp, we will have the space. From David Ward. 18) Fix various issues in benet driver wrt waiting for firmware to finish POST after resets or errors. From Gavin Shan and Sathya Perla. 19) Fix TX locking in SFC driver, from Ben Hutchings. 20) Like the VXLAN fix above, when we encap in a TUN device we have to reset the netfilter state. This should fix several strange crashes reported by Dave Jones and others. From Eric Dumazet. 21) Don't forget to clean up MAC address resources when shutting down a port in mlx4 driver, from Yan Burman. 22) Fix divide by zero in vmxnet3 driver, from Bhavesh Davda. 23) Fix device statistic regression in tg3 when the driver is using phylib, from Nithin Sujir. 24) Fix info leak in several netlink handlers, from Mathias Krause. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (79 commits) 6lowpan: Fix endianness issue in is_addr_link_local(). rrunner.c: fix possible memory leak in rr_init_one() dcbnl: fix various netlink info leaks rtnl: fix info leak on RTM_GETLINK request for VF devices bridge: fix mdb info leaks tg3: Update link_up flag for phylib devices ipv6: stop multicast forwarding to process interface scoped addresses bridging: fix rx_handlers return code netlabel: fix build problems when CONFIG_IPV6=n drivers/isdn: checkng length to be sure not memory overflow net/rds: zero last byte for strncpy bnx2x: Fix SFP+ misconfiguration in iSCSI boot scenario bnx2x: Fix intermittent long KR2 link up time macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode. team: unsyc the devices addresses when port is removed bridge: add missing vid to br_mdb_get() Fix: sparse warning in inet_csk_prepare_forced_close afkey: fix a typo MAINTAINERS: Update qlcnic maintainers list netlabel: correctly list all the static label mappings ...
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/networking/tuntap.txt77
1 files changed, 77 insertions, 0 deletions
diff --git a/Documentation/networking/tuntap.txt b/Documentation/networking/tuntap.txt
index c0aab985bad9..949d5dcdd9a3 100644
--- a/Documentation/networking/tuntap.txt
+++ b/Documentation/networking/tuntap.txt
@@ -105,6 +105,83 @@ Copyright (C) 1999-2000 Maxim Krasnyansky <max_mk@yahoo.com>
105 Proto [2 bytes] 105 Proto [2 bytes]
106 Raw protocol(IP, IPv6, etc) frame. 106 Raw protocol(IP, IPv6, etc) frame.
107 107
108 3.3 Multiqueue tuntap interface:
109
110 From version 3.8, Linux supports multiqueue tuntap which can uses multiple
111 file descriptors (queues) to parallelize packets sending or receiving. The
112 device allocation is the same as before, and if user wants to create multiple
113 queues, TUNSETIFF with the same device name must be called many times with
114 IFF_MULTI_QUEUE flag.
115
116 char *dev should be the name of the device, queues is the number of queues to
117 be created, fds is used to store and return the file descriptors (queues)
118 created to the caller. Each file descriptor were served as the interface of a
119 queue which could be accessed by userspace.
120
121 #include <linux/if.h>
122 #include <linux/if_tun.h>
123
124 int tun_alloc_mq(char *dev, int queues, int *fds)
125 {
126 struct ifreq ifr;
127 int fd, err, i;
128
129 if (!dev)
130 return -1;
131
132 memset(&ifr, 0, sizeof(ifr));
133 /* Flags: IFF_TUN - TUN device (no Ethernet headers)
134 * IFF_TAP - TAP device
135 *
136 * IFF_NO_PI - Do not provide packet information
137 * IFF_MULTI_QUEUE - Create a queue of multiqueue device
138 */
139 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_MULTI_QUEUE;
140 strcpy(ifr.ifr_name, dev);
141
142 for (i = 0; i < queues; i++) {
143 if ((fd = open("/dev/net/tun", O_RDWR)) < 0)
144 goto err;
145 err = ioctl(fd, TUNSETIFF, (void *)&ifr);
146 if (err) {
147 close(fd);
148 goto err;
149 }
150 fds[i] = fd;
151 }
152
153 return 0;
154 err:
155 for (--i; i >= 0; i--)
156 close(fds[i]);
157 return err;
158 }
159
160 A new ioctl(TUNSETQUEUE) were introduced to enable or disable a queue. When
161 calling it with IFF_DETACH_QUEUE flag, the queue were disabled. And when
162 calling it with IFF_ATTACH_QUEUE flag, the queue were enabled. The queue were
163 enabled by default after it was created through TUNSETIFF.
164
165 fd is the file descriptor (queue) that we want to enable or disable, when
166 enable is true we enable it, otherwise we disable it
167
168 #include <linux/if.h>
169 #include <linux/if_tun.h>
170
171 int tun_set_queue(int fd, int enable)
172 {
173 struct ifreq ifr;
174
175 memset(&ifr, 0, sizeof(ifr));
176
177 if (enable)
178 ifr.ifr_flags = IFF_ATTACH_QUEUE;
179 else
180 ifr.ifr_flags = IFF_DETACH_QUEUE;
181
182 return ioctl(fd, TUNSETQUEUE, (void *)&ifr);
183 }
184
108Universal TUN/TAP device driver Frequently Asked Question. 185Universal TUN/TAP device driver Frequently Asked Question.
109 186
1101. What platforms are supported by TUN/TAP driver ? 1871. What platforms are supported by TUN/TAP driver ?