summaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorDavid S. Miller2013-12-10 02:20:14 +0100
committerDavid S. Miller2013-12-10 02:20:14 +0100
commit34f9f437104b86f6ddfa2770e2cd852846385dc3 (patch)
tree6c78386b3db9dd47fd2b79efb4dcf8c1472de99e /Documentation/networking
parentpkt_sched: give visibility to mq slave qdiscs (diff)
parentpacket: fix send path when running with proto == 0 (diff)
downloadkernel-qcow2-linux-34f9f437104b86f6ddfa2770e2cd852846385dc3.tar.gz
kernel-qcow2-linux-34f9f437104b86f6ddfa2770e2cd852846385dc3.tar.xz
kernel-qcow2-linux-34f9f437104b86f6ddfa2770e2cd852846385dc3.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge 'net' into 'net-next' to get the AF_PACKET bug fix that Daniel's direct transmit changes depend upon. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/packet_mmap.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index c01223628a87..8e48e3b14227 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.