]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/tools/netmap/lb.8
libarchive: merge security fix from vendor branch
[FreeBSD/FreeBSD.git] / tools / tools / netmap / lb.8
1 .\" Copyright (c) 2017 Corelight, Inc. and Universita` di Pisa
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .Dd October 26, 2019
26 .Dt LB 8
27 .Os
28 .Sh NAME
29 .Nm lb
30 .Nd netmap-based load balancer
31 .Sh SYNOPSIS
32 .Bk -words
33 .Bl -tag -width "lb"
34 .It Nm
35 .Op Fl i Ar port
36 .Op Fl p Ar pipe-group
37 .Op Fl B Ar extra-buffers
38 .Op Fl b Ar batch-size
39 .Op Fl w Ar wait-link
40 .El
41 .Ek
42 .Sh DESCRIPTION
43 .Nm
44 reads packets from an input netmap port and sends them to a number of netmap pipes,
45 trying to balance the packets received by each pipe.
46 Packets belonging to the
47 same connection will always be sent to the same pipe.
48 .Pp
49 Command line options are listed below.
50 .Bl -tag -width Ds
51 .It Fl i Ar port
52 Name of a netmap port.
53 It must be supplied exactly once to identify
54 the input port.
55 Any netmap port type (e.g., physical interface, VALE switch, pipe,
56 monitor port) can be used.
57 .It Fl p Ar name Ns Cm \&: Ns Ar number | number
58 Add a new pipe group of the given number of pipes.
59 The pipe group will receive all the packets read from the input port, balanced
60 among the available pipes.
61 The receiving ends of the pipes
62 will be called
63 .Dq Ar name Ns Em }0
64 to
65 .Dq Ar name No Ns Em } Ns Aq Ar number No - 1 .
66 The name is optional and defaults to
67 the name of the input port (stripped down of any netmap operator).
68 If the name is omitted, also the colon can be omitted.
69 .Pp
70 This option can be supplied multiple times to define a sequence of pipe groups,
71 each group receiving all the packets in turn.
72 .Pp
73 If no
74 .Fl p
75 option is given, a single group of two pipes with default name is assumed.
76 .Pp
77 It is allowed to use the same name for several groups.
78 The pipe numbering in each
79 group will start from were the previous identically-named group had left.
80 .It Fl B Ar extra-buffers
81 Try to reserve the given number of extra buffers.
82 Extra buffers are shared among
83 all pipes in all groups and work as an extension of the pipe rings.
84 If a pipe ring is full for whatever reason,
85 .Nm
86 tries to use extra buffers before dropping any packets directed to that pipe.
87 .Pp
88 If all extra buffers are busy, some are stolen from the pipe with the longest
89 backlog.
90 This gives preference to newer packets over old ones, and prevents a
91 stalled pipe to deplete the pool of extra buffers.
92 .It Fl b Ar batch-size
93 Maximum number of packets processed between two read operations from the input port.
94 Higher values of batch-size improve performance by amortizing read operations,
95 but increase the risk of filling up the port internal queues.
96 .It Fl w Ar wait-link
97 indicates the number of seconds to wait before transmitting.
98 It defaults to 2, and may be useful when talking to physical
99 ports to let link negotiation complete before starting transmission.
100 .El
101 .Sh LIMITATIONS
102 The group chaining assumes that the applications on the receiving end of the
103 pipes are read-only: they must not modify the buffers or the pipe ring slots
104 in any way.
105 .Pp
106 The group naming is currently implemented by creating a persistent VALE port
107 with the given name.
108 If
109 .Nm
110 does not exit cleanly the ports will not be removed.
111 Please use
112 .Xr valectl 8
113 to remove any stale persistent VALE port.
114 .Sh SEE ALSO
115 .Xr netmap 4 ,
116 .Xr bridge 8 ,
117 .Xr pkt-gen 8
118 .Pp
119 .Pa http://info.iet.unipi.it/~luigi/netmap/
120 .Sh AUTHORS
121 .An -nosplit
122 .Nm
123 has been written by
124 .An Seth Hall
125 at Corelight, USA.
126 The facilities related to extra buffers and pipe groups have been added by
127 .An Giuseppe Lettieri
128 at University of Pisa, Italy, under contract by Corelight, USA.