17e949c46SKenneth D. Merry.\" Copyright (c) 2012 Spectra Logic Corporation 27e949c46SKenneth D. Merry.\" All rights reserved. 37e949c46SKenneth D. Merry.\" 47e949c46SKenneth D. Merry.\" Redistribution and use in source and binary forms, with or without 57e949c46SKenneth D. Merry.\" modification, are permitted provided that the following conditions 67e949c46SKenneth D. Merry.\" are met: 77e949c46SKenneth D. Merry.\" 1. Redistributions of source code must retain the above copyright 87e949c46SKenneth D. Merry.\" notice, this list of conditions, and the following disclaimer, 97e949c46SKenneth D. Merry.\" without modification. 107e949c46SKenneth D. Merry.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 117e949c46SKenneth D. Merry.\" substantially similar to the "NO WARRANTY" disclaimer below 127e949c46SKenneth D. Merry.\" ("Disclaimer") and any redistribution must be conditioned upon 137e949c46SKenneth D. Merry.\" including a substantially similar Disclaimer requirement for further 147e949c46SKenneth D. Merry.\" binary redistribution. 157e949c46SKenneth D. Merry.\" 167e949c46SKenneth D. Merry.\" NO WARRANTY 177e949c46SKenneth D. Merry.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187e949c46SKenneth D. Merry.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197e949c46SKenneth D. Merry.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 207e949c46SKenneth D. Merry.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217e949c46SKenneth D. Merry.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 227e949c46SKenneth D. Merry.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 237e949c46SKenneth D. Merry.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 247e949c46SKenneth D. Merry.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 257e949c46SKenneth D. Merry.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 267e949c46SKenneth D. Merry.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 277e949c46SKenneth D. Merry.\" POSSIBILITY OF SUCH DAMAGES. 287e949c46SKenneth D. Merry.\" 297e949c46SKenneth D. Merry.\" Authors: Alan Somers (Spectra Logic Corporation) 307e949c46SKenneth D. Merry.\" 31a618ae93SChristian Brueffer.Dd June 6, 2014 327e949c46SKenneth D. Merry.Dt XNB 4 337e949c46SKenneth D. Merry.Os 347e949c46SKenneth D. Merry.Sh NAME 357e949c46SKenneth D. Merry.Nm xnb 367e949c46SKenneth D. Merry.Nd "Xen Paravirtualized Backend Ethernet Driver" 377e949c46SKenneth D. Merry.Sh SYNOPSIS 387e949c46SKenneth D. MerryTo compile this driver into the kernel, place the following lines in your 397e949c46SKenneth D. Merrykernel configuration file: 407e949c46SKenneth D. Merry.Bd -ragged -offset indent 417e949c46SKenneth D. Merry.Cd "options XENHVM" 427e949c46SKenneth D. Merry.Cd "device xenpci" 437e949c46SKenneth D. Merry.Ed 447e949c46SKenneth D. Merry.Sh DESCRIPTION 457e949c46SKenneth D. MerryThe 467e949c46SKenneth D. Merry.Nm 477e949c46SKenneth D. Merrydriver provides the back half of a paravirtualized 487e949c46SKenneth D. Merry.Xr xen 4 49ab6fe159SKenneth D. Merrynetwork connection. 50ab6fe159SKenneth D. MerryThe netback and netfront drivers appear to their respective operating 51ab6fe159SKenneth D. Merrysystems as Ethernet devices linked by a crossover cable. 527e949c46SKenneth D. MerryTypically, 537e949c46SKenneth D. Merry.Nm 547e949c46SKenneth D. Merrywill run on Domain 0 and the netfront driver will run on a guest domain. 557e949c46SKenneth D. MerryHowever, it is also possible to run 567e949c46SKenneth D. Merry.Nm 57ab6fe159SKenneth D. Merryon a guest domain. 58*5608c768SAlan SomersIt may be bridged or routed to provide the netfront 597e949c46SKenneth D. Merrydomain access to other guest domains or to a physical network. 607e949c46SKenneth D. Merry.Pp 617e949c46SKenneth D. MerryIn most respects, the 627e949c46SKenneth D. Merry.Nm 63*5608c768SAlan Somersdevice appears to the OS as any other Ethernet device. 64ab6fe159SKenneth D. MerryIt can be configured at runtime entirely with 65ab6fe159SKenneth D. Merry.Xr ifconfig 8 . 66ab6fe159SKenneth D. MerryIn particular, it supports MAC changing, arbitrary MTU sizes, checksum 67ab6fe159SKenneth D. Merryoffload for IP, UDP, and TCP for both receive and transmit, and TSO. 68ab6fe159SKenneth D. MerryHowever, see 697e949c46SKenneth D. Merry.Sx CAVEATS 707e949c46SKenneth D. Merrybefore enabling txcsum, rxcsum, or tso. 717e949c46SKenneth D. Merry.Sh SYSCTL VARIABLES 727e949c46SKenneth D. MerryThe following read-only variables are available via 737e949c46SKenneth D. Merry.Xr sysctl 8 : 747e949c46SKenneth D. Merry.Bl -tag -width indent 757e949c46SKenneth D. Merry.It Va dev.xnb.%d.dump_rings 767e949c46SKenneth D. MerryDisplays information about the ring buffers used to pass requests between the 77ab6fe159SKenneth D. Merrynetfront and netback. 78ab6fe159SKenneth D. MerryMostly useful for debugging, but can also be used to 797e949c46SKenneth D. Merryget traffic statistics. 807e949c46SKenneth D. Merry.It Va dev.xnb.%d.unit_test_results 81ab6fe159SKenneth D. MerryRuns a builtin suite of unit tests and displays the results. 82ab6fe159SKenneth D. MerryDoes not affect the operation of the driver in any way. 83ab6fe159SKenneth D. MerryNote that the test suite simulates error conditions; this will result in 8450d922a0SGlen Barbererror messages being printed to the system log. 85539617ecSJoel Dahl.El 8612afe06cSJoel Dahl.Sh SEE ALSO 8712afe06cSJoel Dahl.Xr arp 4 , 8812afe06cSJoel Dahl.Xr netintro 4 , 8912afe06cSJoel Dahl.Xr ng_ether 4 , 9012afe06cSJoel Dahl.Xr xen 4 , 9112afe06cSJoel Dahl.Xr ifconfig 8 9212afe06cSJoel Dahl.Sh HISTORY 9312afe06cSJoel DahlThe 9412afe06cSJoel Dahl.Nm 9512afe06cSJoel Dahldevice driver first appeared in 9612afe06cSJoel Dahl.Fx 10.0 . 9712afe06cSJoel Dahl.Sh AUTHORS 986c899950SBaptiste Daroussin.An -nosplit 9912afe06cSJoel DahlThe 10012afe06cSJoel Dahl.Nm 10112afe06cSJoel Dahldriver was written by 102*5608c768SAlan Somers.An Alan Somers Aq Mt asomers@FreeBSD.org 103*5608c768SAlan Somersand John Suykerbuyk. 1047e949c46SKenneth D. Merry.Sh CAVEATS 1057e949c46SKenneth D. MerryPackets sent through Xennet pass over shared memory, so the protocol includes 106ab6fe159SKenneth D. Merryno form of link-layer checksum or CRC. 107ab6fe159SKenneth D. MerryFurthermore, Xennet drivers always report to their hosts that they support 108ab6fe159SKenneth D. Merryreceive and transmit checksum offloading. 109ab6fe159SKenneth D. MerryThey "offload" the checksum calculation by simply skipping it. 1107e949c46SKenneth D. MerryThat works fine for packets that are exchanged between two domains on the same 111ab6fe159SKenneth D. Merrymachine. 112ab6fe159SKenneth D. MerryHowever, when a Xennet interface is bridged to a physical interface, 1137e949c46SKenneth D. Merrya correct checksum must be attached to any packets bound for that physical 114ab6fe159SKenneth D. Merryinterface. 115a618ae93SChristian BruefferCurrently, 116a618ae93SChristian Brueffer.Fx 117a618ae93SChristian Bruefferlacks any mechanism for an Ethernet device to 1187e949c46SKenneth D. Merryinform the OS that newly received packets are valid even though their checksums 119ab6fe159SKenneth D. Merryare not. 120ab6fe159SKenneth D. MerrySo if the netfront driver is configured to offload checksum calculations, 121ab6fe159SKenneth D. Merryit will pass non-checksumed packets to 122ab6fe159SKenneth D. Merry.Nm , 123ab6fe159SKenneth D. Merrywhich must then calculate the checksum in software before passing the packet 1247e949c46SKenneth D. Merryto the OS. 1257e949c46SKenneth D. Merry.Pp 1267e949c46SKenneth D. MerryFor this reason, it is recommended that if 1277e949c46SKenneth D. Merry.Nm 12850d922a0SGlen Barberis bridged to a physical interface, then transmit checksum offloading should be 129ab6fe159SKenneth D. Merrydisabled on the netfront. 130ab6fe159SKenneth D. MerryThe Xennet protocol does not have any mechanism for the netback to request 131ab6fe159SKenneth D. Merrythe netfront to do this; the operator must do it manually. 1327e949c46SKenneth D. Merry.Sh BUGS 1337e949c46SKenneth D. MerryThe 1347e949c46SKenneth D. Merry.Nm 1357e949c46SKenneth D. Merrydriver does not properly checksum UDP datagrams that span more than one 136ab6fe159SKenneth D. MerryEthernet frame. 137ab6fe159SKenneth D. MerryNor does it correctly checksum IPv6 packets. 138ab6fe159SKenneth D. MerryTo workaround that bug, disable transmit checksum offloading on the 139ab6fe159SKenneth D. Merrynetfront driver. 140