mirror of https://github.com/mkerrisk/man-pages
packet.7: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
dbb4f7516b
commit
c412686c05
|
@ -32,11 +32,10 @@ The
|
||||||
.I socket_type
|
.I socket_type
|
||||||
is either
|
is either
|
||||||
.B SOCK_RAW
|
.B SOCK_RAW
|
||||||
for raw packets including the link level header or
|
for raw packets including the link-level header or
|
||||||
.B SOCK_DGRAM
|
.B SOCK_DGRAM
|
||||||
for cooked packets with the link level header removed.
|
for cooked packets with the link-level header removed.
|
||||||
The link level
|
The link-level header information is available in a common format in a
|
||||||
header information is available in a common format in a
|
|
||||||
.IR sockaddr_ll .
|
.IR sockaddr_ll .
|
||||||
.I protocol
|
.I protocol
|
||||||
is the IEEE 802.3 protocol number in network order.
|
is the IEEE 802.3 protocol number in network order.
|
||||||
|
@ -194,7 +193,7 @@ adds a binding and
|
||||||
.B PACKET_DROP_MEMBERSHIP
|
.B PACKET_DROP_MEMBERSHIP
|
||||||
drops it.
|
drops it.
|
||||||
They both expect a
|
They both expect a
|
||||||
.B packet_mreq
|
.I packet_mreq
|
||||||
structure as argument:
|
structure as argument:
|
||||||
|
|
||||||
.in +4n
|
.in +4n
|
||||||
|
@ -274,7 +273,7 @@ A socket selects a group by encoding the ID in the first 16 bits of
|
||||||
the integer option value.
|
the integer option value.
|
||||||
The first packet socket to join a group implicitly creates it.
|
The first packet socket to join a group implicitly creates it.
|
||||||
To successfully join an existing group, subsequent packet sockets
|
To successfully join an existing group, subsequent packet sockets
|
||||||
must have the same protocol, device settings and fanout mode and
|
must have the same protocol, device settings, fanout mode and
|
||||||
flags (see below).
|
flags (see below).
|
||||||
Packet sockets can leave a fanout group only by closing the socket.
|
Packet sockets can leave a fanout group only by closing the socket.
|
||||||
The group is deleted when the last socket is closed.
|
The group is deleted when the last socket is closed.
|
||||||
|
@ -286,8 +285,8 @@ sends packets from the same flow to the same socket to maintain
|
||||||
per-flow ordering.
|
per-flow ordering.
|
||||||
For each packet, it chooses a socket by taking the packet flow hash
|
For each packet, it chooses a socket by taking the packet flow hash
|
||||||
modulo the number of sockets in the group, where a flow hash is a hash
|
modulo the number of sockets in the group, where a flow hash is a hash
|
||||||
over network layer address and optional transport layer port fields.
|
over network-layer address and optional transport-layer port fields.
|
||||||
The load balance mode
|
The load-balance mode
|
||||||
.BR PACKET_FANOUT_LB
|
.BR PACKET_FANOUT_LB
|
||||||
implements a round-robin algorithm.
|
implements a round-robin algorithm.
|
||||||
.BR PACKET_FANOUT_CPU
|
.BR PACKET_FANOUT_CPU
|
||||||
|
@ -296,7 +295,7 @@ selects the socket based on the CPU that the packet arrived on.
|
||||||
processes all data on a single socket, moves to the next when one
|
processes all data on a single socket, moves to the next when one
|
||||||
becomes backlogged.
|
becomes backlogged.
|
||||||
.BR PACKET_FANOUT_RND
|
.BR PACKET_FANOUT_RND
|
||||||
selects the socket using a pseudo random number generator.
|
selects the socket using a pseudo-random number generator.
|
||||||
|
|
||||||
Fanout modes can take additional options.
|
Fanout modes can take additional options.
|
||||||
IP fragmentation causes packets from the same flow to have different
|
IP fragmentation causes packets from the same flow to have different
|
||||||
|
@ -313,12 +312,12 @@ enables the roll over mechanism as a backup strategy: if the
|
||||||
original fanout algorithm selects a backlogged socket, the packet
|
original fanout algorithm selects a backlogged socket, the packet
|
||||||
rolls over to the next available one.
|
rolls over to the next available one.
|
||||||
.TP
|
.TP
|
||||||
.BR PACKET_LOSS " (with PACKET_TX_RING)"
|
.BR PACKET_LOSS " (with " PACKET_TX_RING )
|
||||||
If set, do not silently drop a packet on transmission error, but
|
If set, do not silently drop a packet on transmission error, but
|
||||||
return it with status set to
|
return it with status set to
|
||||||
.BR TP_STATUS_WRONG_FORMAT .
|
.BR TP_STATUS_WRONG_FORMAT .
|
||||||
.TP
|
.TP
|
||||||
.BR PACKET_RESERVE " (with PACKET_RX_RING)"
|
.BR PACKET_RESERVE " (with " PACKET_RX_RING )
|
||||||
By default, a packet receive ring writes packets immediately following the
|
By default, a packet receive ring writes packets immediately following the
|
||||||
metadata structure and alignment padding.
|
metadata structure and alignment padding.
|
||||||
This integer option reserves additional headroom.
|
This integer option reserves additional headroom.
|
||||||
|
@ -343,7 +342,7 @@ then
|
||||||
is the same.
|
is the same.
|
||||||
If it is of type
|
If it is of type
|
||||||
.BR SOCK_RAW ,
|
.BR SOCK_RAW ,
|
||||||
then that field stores the offset to the link layer frame.
|
then that field stores the offset to the link-layer frame.
|
||||||
Packet socket and application communicate the head and tail of the ring
|
Packet socket and application communicate the head and tail of the ring
|
||||||
through the
|
through the
|
||||||
.I tp_status
|
.I tp_status
|
||||||
|
@ -369,8 +368,8 @@ Retrieve packet socket statistics in the form of a structure
|
||||||
.in +4n
|
.in +4n
|
||||||
.nf
|
.nf
|
||||||
struct tpacket_stats {
|
struct tpacket_stats {
|
||||||
unsigned int tp_packets; /* total packet count */
|
unsigned int tp_packets; /* Total packet count */
|
||||||
unsigned int tp_drops; /* dropped packet count */
|
unsigned int tp_drops; /* Dropped packet count */
|
||||||
};
|
};
|
||||||
.fi
|
.fi
|
||||||
.in
|
.in
|
||||||
|
@ -379,7 +378,7 @@ Receiving statistics resets the internal counters.
|
||||||
The statistics structure differs when using a ring of variant
|
The statistics structure differs when using a ring of variant
|
||||||
.BR TPACKET_V3 .
|
.BR TPACKET_V3 .
|
||||||
.TP
|
.TP
|
||||||
.BR PACKET_TIMESTAMP " (with PACKET_RX_RING)"
|
.BR PACKET_TIMESTAMP " (with " PACKET_RX_RING )
|
||||||
.\" commit 614f60fa9d73a9e8fdff3df83381907fea7c5649
|
.\" commit 614f60fa9d73a9e8fdff3df83381907fea7c5649
|
||||||
The packet receive ring always stores a timestamp in the metadata header.
|
The packet receive ring always stores a timestamp in the metadata header.
|
||||||
By default, this is a software generated timestamp generated when the
|
By default, this is a software generated timestamp generated when the
|
||||||
|
|
Loading…
Reference in New Issue