aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/ip-sysctl.txt26
-rw-r--r--Documentation/networking/packet_mmap.txt18
2 files changed, 43 insertions, 1 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 7373115407e4..c97932c88ea3 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -26,12 +26,36 @@ ip_no_pmtu_disc - INTEGER
26 discarded. Outgoing frames are handled the same as in mode 1, 26 discarded. Outgoing frames are handled the same as in mode 1,
27 implicitly setting IP_PMTUDISC_DONT on every created socket. 27 implicitly setting IP_PMTUDISC_DONT on every created socket.
28 28
29 Possible values: 0-2 29 Mode 3 is a hardend pmtu discover mode. The kernel will only
30 accept fragmentation-needed errors if the underlying protocol
31 can verify them besides a plain socket lookup. Current
32 protocols for which pmtu events will be honored are TCP, SCTP
33 and DCCP as they verify e.g. the sequence number or the
34 association. This mode should not be enabled globally but is
35 only intended to secure e.g. name servers in namespaces where
36 TCP path mtu must still work but path MTU information of other
37 protocols should be discarded. If enabled globally this mode
38 could break other protocols.
39
40 Possible values: 0-3
30 Default: FALSE 41 Default: FALSE
31 42
32min_pmtu - INTEGER 43min_pmtu - INTEGER
33 default 552 - minimum discovered Path MTU 44 default 552 - minimum discovered Path MTU
34 45
46ip_forward_use_pmtu - BOOLEAN
47 By default we don't trust protocol path MTUs while forwarding
48 because they could be easily forged and can lead to unwanted
49 fragmentation by the router.
50 You only need to enable this if you have user-space software
51 which tries to discover path mtus by itself and depends on the
52 kernel honoring this information. This is normally not the
53 case.
54 Default: 0 (disabled)
55 Possible values:
56 0 - disabled
57 1 - enabled
58
35route/max_size - INTEGER 59route/max_size - INTEGER
36 Maximum number of routes allowed in the kernel. Increase 60 Maximum number of routes allowed in the kernel. Increase
37 this when using large numbers of interfaces and/or routes. 61 this when using large numbers of interfaces and/or routes.
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index 723bf3d33a6e..91ffe1d9e8ca 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -98,6 +98,11 @@ by the kernel.
98The destruction of the socket and all associated resources 98The destruction of the socket and all associated resources
99is done by a simple call to close(fd). 99is done by a simple call to close(fd).
100 100
101Similarly as without PACKET_MMAP, it is possible to use one socket
102for capture and transmission. This can be done by mapping the
103allocated RX and TX buffer ring with a single mmap() call.
104See "Mapping and use of the circular buffer (ring)".
105
101Next I will describe PACKET_MMAP settings and its constraints, 106Next I will describe PACKET_MMAP settings and its constraints,
102also the mapping of the circular buffer in the user process and 107also the mapping of the circular buffer in the user process and
103the use of this buffer. 108the use of this buffer.
@@ -414,6 +419,19 @@ tp_block_size/tp_frame_size frames there will be a gap between
414the frames. This is because a frame cannot be spawn across two 419the frames. This is because a frame cannot be spawn across two
415blocks. 420blocks.
416 421
422To use one socket for capture and transmission, the mapping of both the
423RX and TX buffer ring has to be done with one call to mmap:
424
425 ...
426 setsockopt(fd, SOL_PACKET, PACKET_RX_RING, &foo, sizeof(foo));
427 setsockopt(fd, SOL_PACKET, PACKET_TX_RING, &bar, sizeof(bar));
428 ...
429 rx_ring = mmap(0, size * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
430 tx_ring = rx_ring + size;
431
432RX must be the first as the kernel maps the TX ring memory right
433after the RX one.
434
417At the beginning of each frame there is an status field (see 435At the beginning of each frame there is an status field (see
418struct tpacket_hdr). If this field is 0 means that the frame is ready 436struct tpacket_hdr). If this field is 0 means that the frame is ready
419to be used for the kernel, If not, there is a frame the user can read 437to be used for the kernel, If not, there is a frame the user can read