diff options
author | Alex Shi <alex.shi@linaro.org> | 2014-01-16 09:14:57 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-01-16 09:14:57 +0800 |
commit | c8e95ac690b37fd1a469c685d716e24abae26992 (patch) | |
tree | 62593c6b574ff9cf08cabbcb7d4fc943b5377718 /Documentation | |
parent | 3dad43721441f1cf8ed1a3a975bc939007686589 (diff) | |
parent | 1071ea6e68ead40df739b223e9013d99c23c19ab (diff) |
Merge remote-tracking branch 'stable/linux-3.10.y' 3.10.27 into linux-linaro-lsk
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/networking/packet_mmap.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 23dd80e82b8..0f4376ec885 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt @@ -123,6 +123,16 @@ Transmission process is similar to capture as shown below. [shutdown] close() --------> destruction of the transmission socket and deallocation of all associated resources. +Socket creation and destruction is also straight forward, and is done +the same way as in capturing described in the previous paragraph: + + int fd = socket(PF_PACKET, mode, 0); + +The protocol can optionally be 0 in case we only want to transmit +via this socket, which avoids an expensive call to packet_rcv(). +In this case, you also need to bind(2) the TX_RING with sll_protocol = 0 +set. Otherwise, htons(ETH_P_ALL) or any other protocol, for example. + Binding the socket to your network interface is mandatory (with zero copy) to know the header size of frames used in the circular buffer. |