11a7d3c05SVincenzo Maffione.\" Copyright (c) 2016 Luigi Rizzo, Universita` di Pisa 21a7d3c05SVincenzo Maffione.\" 31a7d3c05SVincenzo Maffione.\" Redistribution and use in source and binary forms, with or without 41a7d3c05SVincenzo Maffione.\" modification, are permitted provided that the following conditions 51a7d3c05SVincenzo Maffione.\" are met: 61a7d3c05SVincenzo Maffione.\" 1. Redistributions of source code must retain the above copyright 71a7d3c05SVincenzo Maffione.\" notice, this list of conditions and the following disclaimer. 81a7d3c05SVincenzo Maffione.\" 2. Redistributions in binary form must reproduce the above copyright 91a7d3c05SVincenzo Maffione.\" notice, this list of conditions and the following disclaimer in the 101a7d3c05SVincenzo Maffione.\" documentation and/or other materials provided with the distribution. 111a7d3c05SVincenzo Maffione.\" 121a7d3c05SVincenzo Maffione.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 131a7d3c05SVincenzo Maffione.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 141a7d3c05SVincenzo Maffione.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 151a7d3c05SVincenzo Maffione.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 161a7d3c05SVincenzo Maffione.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 171a7d3c05SVincenzo Maffione.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 181a7d3c05SVincenzo Maffione.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 191a7d3c05SVincenzo Maffione.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 201a7d3c05SVincenzo Maffione.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 211a7d3c05SVincenzo Maffione.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 221a7d3c05SVincenzo Maffione.\" SUCH DAMAGE. 231a7d3c05SVincenzo Maffione.\" 24792d05c2SVincenzo Maffione.Dd November 21, 2020 251a7d3c05SVincenzo Maffione.Dt BRIDGE 8 261a7d3c05SVincenzo Maffione.Os 271a7d3c05SVincenzo Maffione.Sh NAME 281a7d3c05SVincenzo Maffione.Nm bridge 291a7d3c05SVincenzo Maffione.Nd netmap client to bridge two netmap ports 301a7d3c05SVincenzo Maffione.Sh SYNOPSIS 311a7d3c05SVincenzo Maffione.Bk -words 321a7d3c05SVincenzo Maffione.Bl -tag -width "bridge" 331a7d3c05SVincenzo Maffione.It Nm 341a7d3c05SVincenzo Maffione.Op Fl i Ar port 351a7d3c05SVincenzo Maffione.Op Fl b Ar batch size 361a7d3c05SVincenzo Maffione.Op Fl w Ar wait-link 371a7d3c05SVincenzo Maffione.Op Fl v 381a7d3c05SVincenzo Maffione.Op Fl c 391a7d3c05SVincenzo Maffione.El 401a7d3c05SVincenzo Maffione.Ek 411a7d3c05SVincenzo Maffione.Sh DESCRIPTION 421a7d3c05SVincenzo Maffione.Nm 431a7d3c05SVincenzo Maffioneis a simple netmap application that bridges packets between two netmap ports. 441a7d3c05SVincenzo MaffioneIf the two netmap ports use the same netmap memory region 451a7d3c05SVincenzo Maffione.Nm 461a7d3c05SVincenzo Maffioneforwards packets without copying the packets payload (zero-copy mode), unless 471a7d3c05SVincenzo Maffioneexplicitly prevented by the 481a7d3c05SVincenzo Maffione.Fl c 491a7d3c05SVincenzo Maffioneflag. 50792d05c2SVincenzo Maffione.Pp 51792d05c2SVincenzo MaffioneWhen bridging two physical ports, it is necessary that both NICS are in 52792d05c2SVincenzo Maffionepromiscuous mode, otherwise unicast traffic directed to other hosts will 53792d05c2SVincenzo Maffionebe dropped by the hardware, and bridging will not work. 54792d05c2SVincenzo Maffione.Pp 55792d05c2SVincenzo MaffioneWhen bridging the hardware rings of a physical port with the corresponding 56792d05c2SVincenzo Maffionehost rings, it is necessary to turn off the offloads, because netmap does 57792d05c2SVincenzo Maffionenot prepare the NIC rings with offload information. 58792d05c2SVincenzo MaffioneExample: 59*f234252dSVincenzo Maffione.Bd -literal -offset indent 60792d05c2SVincenzo Maffioneifconfig em0 -rxcsum -txcsum -tso4 -tso6 -lro 61792d05c2SVincenzo Maffione.Ed 62792d05c2SVincenzo Maffione.Pp 63792d05c2SVincenzo MaffioneAvailable options: 641a7d3c05SVincenzo Maffione.Bl -tag -width Ds 651a7d3c05SVincenzo Maffione.It Fl i Ar port 661a7d3c05SVincenzo MaffioneName of the netmap port. 671a7d3c05SVincenzo MaffioneIt can be supplied up to two times to identify the ports that must be bridged. 681a7d3c05SVincenzo MaffioneAny netmap port type (physical interface, VALE switch, pipe, monitor port...) 691a7d3c05SVincenzo Maffionecan be used. 701a7d3c05SVincenzo MaffioneIf the option is supplied only once, then it must be for a physical interface and, in that case, 711a7d3c05SVincenzo Maffione.Nm 721a7d3c05SVincenzo Maffionewill bridge the port and the host stack. 731a7d3c05SVincenzo Maffione.It Fl b Ar batch-size 741a7d3c05SVincenzo MaffioneMaximum number of packets to send in one operation. 751a7d3c05SVincenzo Maffione.It Fl w Ar wait-link 761a7d3c05SVincenzo Maffioneindicates the number of seconds to wait before transmitting. 771a7d3c05SVincenzo MaffioneIt defaults to 2, and may be useful when talking to physical 781a7d3c05SVincenzo Maffioneports to let link negotiation complete before starting transmission. 791a7d3c05SVincenzo Maffione.It Fl v 801a7d3c05SVincenzo MaffioneEnable verbose mode 811a7d3c05SVincenzo Maffione.It Fl c 821a7d3c05SVincenzo MaffioneDisable zero-copy mode. 831a7d3c05SVincenzo Maffione.El 841a7d3c05SVincenzo Maffione.Sh SEE ALSO 851a7d3c05SVincenzo Maffione.Xr netmap 4 , 86792d05c2SVincenzo Maffione.Xr lb 8 , 87792d05c2SVincenzo Maffione.Xr pkt-gen 8 881a7d3c05SVincenzo Maffione.Sh AUTHORS 891a7d3c05SVincenzo Maffione.An -nosplit 901a7d3c05SVincenzo Maffione.Nm 911a7d3c05SVincenzo Maffionehas been written by 921a7d3c05SVincenzo Maffione.An Luigi Rizzo 931a7d3c05SVincenzo Maffioneand 941a7d3c05SVincenzo Maffione.An Matteo Landi 951a7d3c05SVincenzo Maffioneat the Universita` di Pisa, Italy. 96