packet.7: Minor fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2014-01-05 10:44:33 +13:00
parent dbb4f7516b
commit c412686c05
1 changed files with 14 additions and 15 deletions

View File

@ -32,11 +32,10 @@ The
.I socket_type
is either
.B SOCK_RAW
for raw packets including the link level header or
for raw packets including the link-level header or
.B SOCK_DGRAM
for cooked packets with the link level header removed.
The link level
header information is available in a common format in a
for cooked packets with the link-level header removed.
The link-level header information is available in a common format in a
.IR sockaddr_ll .
.I protocol
is the IEEE 802.3 protocol number in network order.
@ -194,7 +193,7 @@ adds a binding and
.B PACKET_DROP_MEMBERSHIP
drops it.
They both expect a
.B packet_mreq
.I packet_mreq
structure as argument:
.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 first packet socket to join a group implicitly creates it.
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).
Packet sockets can leave a fanout group only by closing the socket.
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.
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
over network layer address and optional transport layer port fields.
The load balance mode
over network-layer address and optional transport-layer port fields.
The load-balance mode
.BR PACKET_FANOUT_LB
implements a round-robin algorithm.
.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
becomes backlogged.
.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.
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
rolls over to the next available one.
.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
return it with status set to
.BR TP_STATUS_WRONG_FORMAT .
.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
metadata structure and alignment padding.
This integer option reserves additional headroom.
@ -343,7 +342,7 @@ then
is the same.
If it is of type
.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
through the
.I tp_status
@ -369,8 +368,8 @@ Retrieve packet socket statistics in the form of a structure
.in +4n
.nf
struct tpacket_stats {
unsigned int tp_packets; /* total packet count */
unsigned int tp_drops; /* dropped packet count */
unsigned int tp_packets; /* Total packet count */
unsigned int tp_drops; /* Dropped packet count */
};
.fi
.in
@ -379,7 +378,7 @@ Receiving statistics resets the internal counters.
The statistics structure differs when using a ring of variant
.BR TPACKET_V3 .
.TP
.BR PACKET_TIMESTAMP " (with PACKET_RX_RING)"
.BR PACKET_TIMESTAMP " (with " PACKET_RX_RING )
.\" commit 614f60fa9d73a9e8fdff3df83381907fea7c5649
The packet receive ring always stores a timestamp in the metadata header.
By default, this is a software generated timestamp generated when the