Lines Matching +full:4 +full:- +full:ring
1 .\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa
25 .\" This document is derived in part from the enet man page (enet.4)
45 .Bl -tag -width XXXX
51 implementing a very fast and modular in-kernel software switch/dataplane;
56 .Xr bpf 4
72 35-40 Mpps on 40 Gbit/s NICs (limited by the hardware);
79 which uses unmodified device drivers and is 3-5 times faster than
80 .Xr bpf 4
98 supports both non-blocking I/O through
138 There is one ring for each transmit/receive queue of a
140 An additional ring pair connects to the host stack.
145 the rings, and possibly implement zero-copy forwarding
186 .Bl -tag -width XXXX
195 Both SSS and PPP have the form [0-9a-zA-Z_]+ , the string
208 Non-blocking I/O is done with special
218 OS-generated packets for that NIC end up into a
220 ring, and another ring is used to send packets into the OS network stack.
233 .Bl -tag -width XXX
235 .Bd -literal
253 NICs also have an extra tx/rx ring pair connected to the host stack.
274 netmap ring).
280 .It Dv struct netmap_ring (one per ring )
281 .Bd -literal
284 const uint32_t num_slots; /* slots in each ring */
303 .Bd -literal
334 .Dl char *buf = NETMAP_BUF(ring, buffer_index);
340 The ring size
361 .Dl nm_ring_next(ring, index)
362 returns the next index modulo the ring size.
373 during the execution of a netmap-related system call.
375 .Va tail\ . . . head-1 ,
381 .Va head\ . . . tail-1
396 .Va head-1
400 Below is an example of the evolution of a TX ring:
401 .Bd -literal
424 will block if there is no space in the ring, i.e.,
425 .Dl ring->cur == ring->tail
431 A transmit ring with pending transmissions has
432 .Dl ring->head != ring->tail + 1 (modulo the ring size).
434 .Va int nm_tx_pending(ring)
440 .Va head\& . . . tail-1
454 .Va head-1
459 Below is an example of the evolution of an RX ring:
460 .Bd -literal
480 Normally, packets should be stored in the netmap-allocated buffers
485 .Bl -tag -width XXX
492 zero-copy forwarding, see
493 .Sx ZERO-COPY FORWARDING .
503 When a ring is in 'transparent' mode,
511 indicates that the packet's payload is in a user-supplied buffer
515 This is only supported on the transmit ring of
544 for non-blocking I/O.
548 .Bd -literal
558 uint16_t nr_ringid; /* (i/o) ring(s) we care about */
571 .Xr netintro 4 .
572 .Bl -tag -width XXXX
579 .Bl -tag -width XX
595 Both ring number and sizes may be configured at runtime
596 using interface-specific functions (e.g.,
651 .Bl -tag -width XXXXX
653 (default) all hardware ring pairs
658 .It NR_REG_ONE_NIC "netmap:foo-i"
659 only the i-th hardware ring pair, where the number is in
671 will only have a single ring pair with index 0,
680 call pushes out any pending packets on the transmit ring, even if
682 The feature can be disabled by or-ing
692 are called with a write event (POLLOUT/wfdset) or a full ring.
716 Both block if no slots are available in the ring
717 .Va ( ring->cur == ring->tail ) .
760 API, to ease porting of libpcap-based applications to
768 .Bl -tag -width XXXXX
773 .Bl -tag -width XX
802 (uses the ring number and sizes from arg).
809 pushes a packet to a ring, returns the size
826 .Xr cxgbe 4 ,
827 .Xr em 4 ,
828 .Xr iflib 4
829 .Pq providing Xr igb 4 and Xr em 4 ,
830 .Xr ix 4 ,
831 .Xr ixl 4 ,
832 .Xr re 4 ,
833 .Xr vtnet 4 .
852 from the emulated adapter onto the host RX ring, the sniffer will intercept
871 .Bl -tag -width indent
883 Ring size used for emulated netmap mode
895 Disables the update of the timestamp in the netmap ring
918 .It Va dev.netmap.priv_ring_num: 4
940 Allow ptnet devices to use virtio-net headers
943 .Xr numa 4
948 domains, this will prevent zero-copy forwarding optimizations and thus may hurt
989 .Xr pkt-gen 8
993 .Dl pkt-gen -i ix0 -f tx -l 60
995 .Dl pkt-gen -i ix0 -f rx
1000 .Xr pkt-gen 8
1004 .Xr bridge 4
1010 .Dl bridge -i netmap:ix0 -i netmap:ix1
1012 .Dl bridge -i netmap:ix0
1016 .Bd -literal -compact
1022 struct netmap_ring *ring;
1033 ring = NETMAP_TXRING(nifp, 0);
1037 poll(&fds, 1, -1);
1038 while (!nm_ring_empty(ring)) {
1039 i = ring->cur;
1040 buf = NETMAP_BUF(ring, ring->slot[i].buf_index);
1042 ring->slot[i].len = ... packet length ...
1043 ring->head = ring->cur = nm_ring_next(ring, i);
1051 .Bd -literal -compact
1066 poll(&fds, 1, -1);
1073 .Ss ZERO-COPY FORWARDING
1077 The buffer from the transmit ring is used
1078 to replenish the receive ring:
1080 .Bd -literal -compact
1084 src = &src_ring->slot[rxr->cur];
1085 dst = &dst_ring->slot[txr->cur];
1086 tmp = dst->buf_idx;
1087 dst->buf_idx = src->buf_idx;
1088 dst->len = src->len;
1089 dst->flags = NS_BUF_CHANGED;
1090 src->buf_idx = tmp;
1091 src->flags = NS_BUF_CHANGED;
1092 rxr->head = rxr->cur = nm_ring_next(rxr, rxr->cur);
1093 txr->head = txr->cur = nm_ring_next(txr, txr->cur);
1097 The host stack is for all practical purposes just a regular ring pair,
1102 mode end up into the RX ring, whereas all packets queued to the
1103 TX ring are send up to the host stack.
1109 .Dl pkt-gen -i vale1:a -f rx # receiver
1110 .Dl pkt-gen -i vale1:b -f tx # sender
1113 .Dl pkt-gen -i vale2:x{3 -f rx # receiver on the master side
1114 .Dl pkt-gen -i vale2:x}3 -f tx # sender on the slave side
1118 .Dl valectl -h vale2:em0
1124 .Xr vale 4 ,
1128 .Xr pkt-gen 8 ,
1134 Communications of the ACM, 55 (3), pp.45-51, March 2012
1147 .An -nosplit
1189 device-specific sysctl variables.