1*7e949c46SKenneth D. Merry.\" Copyright (c) 2012 Spectra Logic Corporation 2*7e949c46SKenneth D. Merry.\" All rights reserved. 3*7e949c46SKenneth D. Merry.\" 4*7e949c46SKenneth D. Merry.\" 5*7e949c46SKenneth D. Merry.\" Redistribution and use in source and binary forms, with or without 6*7e949c46SKenneth D. Merry.\" modification, are permitted provided that the following conditions 7*7e949c46SKenneth D. Merry.\" are met: 8*7e949c46SKenneth D. Merry.\" 1. Redistributions of source code must retain the above copyright 9*7e949c46SKenneth D. Merry.\" notice, this list of conditions, and the following disclaimer, 10*7e949c46SKenneth D. Merry.\" without modification. 11*7e949c46SKenneth D. Merry.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 12*7e949c46SKenneth D. Merry.\" substantially similar to the "NO WARRANTY" disclaimer below 13*7e949c46SKenneth D. Merry.\" ("Disclaimer") and any redistribution must be conditioned upon 14*7e949c46SKenneth D. Merry.\" including a substantially similar Disclaimer requirement for further 15*7e949c46SKenneth D. Merry.\" binary redistribution. 16*7e949c46SKenneth D. Merry.\" 17*7e949c46SKenneth D. Merry.\" NO WARRANTY 18*7e949c46SKenneth D. Merry.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19*7e949c46SKenneth D. Merry.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20*7e949c46SKenneth D. Merry.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 21*7e949c46SKenneth D. Merry.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22*7e949c46SKenneth D. Merry.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23*7e949c46SKenneth D. Merry.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24*7e949c46SKenneth D. Merry.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25*7e949c46SKenneth D. Merry.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26*7e949c46SKenneth D. Merry.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 27*7e949c46SKenneth D. Merry.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28*7e949c46SKenneth D. Merry.\" POSSIBILITY OF SUCH DAMAGES. 29*7e949c46SKenneth D. Merry.\" 30*7e949c46SKenneth D. Merry.\" Authors: Alan Somers (Spectra Logic Corporation) 31*7e949c46SKenneth D. Merry.\" 32*7e949c46SKenneth D. Merry.\" $FreeBSD$ 33*7e949c46SKenneth D. Merry.\" 34*7e949c46SKenneth D. Merry 35*7e949c46SKenneth D. Merry.Dd January 6, 2012 36*7e949c46SKenneth D. Merry.Dt XNB 4 37*7e949c46SKenneth D. Merry.Os 38*7e949c46SKenneth D. Merry.Sh NAME 39*7e949c46SKenneth D. Merry.Nm xnb 40*7e949c46SKenneth D. Merry.Nd "Xen Paravirtualized Backend Ethernet Driver" 41*7e949c46SKenneth D. Merry.Sh SYNOPSIS 42*7e949c46SKenneth D. MerryTo compile this driver into the kernel, place the following lines in your 43*7e949c46SKenneth D. Merrykernel configuration file: 44*7e949c46SKenneth D. Merry.Bd -ragged -offset indent 45*7e949c46SKenneth D. Merry.Cd "options XENHVM" 46*7e949c46SKenneth D. Merry.Cd "device xenpci" 47*7e949c46SKenneth D. Merry.Ed 48*7e949c46SKenneth D. Merry.Sh DESCRIPTION 49*7e949c46SKenneth D. MerryThe 50*7e949c46SKenneth D. Merry.Nm 51*7e949c46SKenneth D. Merrydriver provides the back half of a paravirtualized 52*7e949c46SKenneth D. Merry.Xr xen 4 53*7e949c46SKenneth D. Merrynetwork connection. The netback and netfront drivers appear to their 54*7e949c46SKenneth D. Merryrespective operating systems as Ethernet devices linked by a crossover cable. 55*7e949c46SKenneth D. MerryTypically, 56*7e949c46SKenneth D. Merry.Nm 57*7e949c46SKenneth D. Merrywill run on Domain 0 and the netfront driver will run on a guest domain. 58*7e949c46SKenneth D. MerryHowever, it is also possible to run 59*7e949c46SKenneth D. Merry.Nm 60*7e949c46SKenneth D. Merryon a guest domain. It may be bridged or routed to provide the netfront's 61*7e949c46SKenneth D. Merrydomain access to other guest domains or to a physical network. 62*7e949c46SKenneth D. Merry.Pp 63*7e949c46SKenneth D. MerryIn most respects, the 64*7e949c46SKenneth D. Merry.Nm 65*7e949c46SKenneth D. Merrydevice appears to the OS as an other Ethernet device. It can be configured at 66*7e949c46SKenneth D. Merryruntime entirely with 67*7e949c46SKenneth D. Merry.Xr ifconfig 8 68*7e949c46SKenneth D. Merry\&. In particular, it supports MAC changing, arbitrary MTU sizes, checksum 69*7e949c46SKenneth D. Merryoffload for IP, UDP, and TCP for both receive and transmit, and TSO. However, 70*7e949c46SKenneth D. Merrysee 71*7e949c46SKenneth D. Merry.Sx CAVEATS 72*7e949c46SKenneth D. Merrybefore enabling txcsum, rxcsum, or tso. 73*7e949c46SKenneth D. Merry.Sh SYSCTL VARIABLES 74*7e949c46SKenneth D. MerryThe following read-only variables are available via 75*7e949c46SKenneth D. Merry.Xr sysctl 8 : 76*7e949c46SKenneth D. Merry.Bl -tag -width indent 77*7e949c46SKenneth D. Merry.It Va dev.xnb.%d.dump_rings 78*7e949c46SKenneth D. MerryDisplays information about the ring buffers used to pass requests between the 79*7e949c46SKenneth D. Merrynetfront and netback. Mostly useful for debugging, but can also be used to 80*7e949c46SKenneth D. Merryget traffic statistics. 81*7e949c46SKenneth D. Merry.It Va dev.xnb.%d.unit_test_results 82*7e949c46SKenneth D. MerryRuns a builtin suite of unit tests and displays the results. Does not affect 83*7e949c46SKenneth D. Merrythe operation of the driver in any way. Note that the test suite simulates 84*7e949c46SKenneth D. Merryerror conditions; this will result in error messages being printed to the 85*7e949c46SKenneth D. Merrysystem system log. 86*7e949c46SKenneth D. Merry.Sh CAVEATS 87*7e949c46SKenneth D. MerryPackets sent through Xennet pass over shared memory, so the protocol includes 88*7e949c46SKenneth D. Merryno form of link-layer checksum or CRC. Furthermore, Xennet drivers always 89*7e949c46SKenneth D. Merryreport to their hosts that they support receive and transmit checksum 90*7e949c46SKenneth D. Merryoffloading. They "offload" the checksum calculation by simply skipping it. 91*7e949c46SKenneth D. MerryThat works fine for packets that are exchanged between two domains on the same 92*7e949c46SKenneth D. Merrymachine. However, when a Xennet interface is bridged to a physical interface, 93*7e949c46SKenneth D. Merrya correct checksum must be attached to any packets bound for that physical 94*7e949c46SKenneth D. Merryinterface. Currently, FreeBSD lacks any mechanism for an ethernet device to 95*7e949c46SKenneth D. Merryinform the OS that newly received packets are valid even though their checksums 96*7e949c46SKenneth D. Merryare not. So if the netfront driver is configured to offload checksum 97*7e949c46SKenneth D. Merrycalculations, it will pass non-checksumed packets to 98*7e949c46SKenneth D. Merry.Nm 99*7e949c46SKenneth D. Merry, which must then calculate the checksum in software before passing the packet 100*7e949c46SKenneth D. Merryto the OS. 101*7e949c46SKenneth D. Merry.Pp 102*7e949c46SKenneth D. MerryFor this reason, it is recommended that if 103*7e949c46SKenneth D. Merry.Nm 104*7e949c46SKenneth D. Merryis bridged to a physcal interface, then transmit checksum offloading should be 105*7e949c46SKenneth D. Merrydisabled on the netfront. The Xennet protocol does not have any mechanism for 106*7e949c46SKenneth D. Merrythe netback to request the netfront to do this; the operator must do it 107*7e949c46SKenneth D. Merrymanually. 108*7e949c46SKenneth D. Merry.Sh SEE ALSO 109*7e949c46SKenneth D. Merry.Xr arp 4 , 110*7e949c46SKenneth D. Merry.Xr netintro 4 , 111*7e949c46SKenneth D. Merry.Xr ng_ether 4 , 112*7e949c46SKenneth D. Merry.Xr ifconfig 8 , 113*7e949c46SKenneth D. Merry.Xr xen 4 114*7e949c46SKenneth D. Merry.Sh HISTORY 115*7e949c46SKenneth D. MerryThe 116*7e949c46SKenneth D. Merry.Nm 117*7e949c46SKenneth D. Merrydevice driver first appeared in 118*7e949c46SKenneth D. Merry.Fx 10.0 119*7e949c46SKenneth D. Merry. 120*7e949c46SKenneth D. Merry.Sh AUTHORS 121*7e949c46SKenneth D. MerryThe 122*7e949c46SKenneth D. Merry.Nm 123*7e949c46SKenneth D. Merrydriver was written by 124*7e949c46SKenneth D. Merry.An Alan Somers 125*7e949c46SKenneth D. Merry.Aq alans@spectralogic.com 126*7e949c46SKenneth D. Merryand 127*7e949c46SKenneth D. Merry.An John Suykerbuyk 128*7e949c46SKenneth D. Merry.Aq johns@spectralogic.com 129*7e949c46SKenneth D. Merry.Sh BUGS 130*7e949c46SKenneth D. MerryThe 131*7e949c46SKenneth D. Merry.Nm 132*7e949c46SKenneth D. Merrydriver does not properly checksum UDP datagrams that span more than one 133*7e949c46SKenneth D. MerryEthernet frame. Nor does it correctly checksum IPv6 packets. To workaround 134*7e949c46SKenneth D. Merrythat bug, disable transmit checksum offloading on the netfront driver. 135