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.\" 317e949c46SKenneth D. Merry.\" $FreeBSD$ 327e949c46SKenneth D. Merry.\" 337e949c46SKenneth D. Merry.Dd January 6, 2012 347e949c46SKenneth D. Merry.Dt XNB 4 357e949c46SKenneth D. Merry.Os 367e949c46SKenneth D. Merry.Sh NAME 377e949c46SKenneth D. Merry.Nm xnb 387e949c46SKenneth D. Merry.Nd "Xen Paravirtualized Backend Ethernet Driver" 397e949c46SKenneth D. Merry.Sh SYNOPSIS 407e949c46SKenneth D. MerryTo compile this driver into the kernel, place the following lines in your 417e949c46SKenneth D. Merrykernel configuration file: 427e949c46SKenneth D. Merry.Bd -ragged -offset indent 437e949c46SKenneth D. Merry.Cd "options XENHVM" 447e949c46SKenneth D. Merry.Cd "device xenpci" 457e949c46SKenneth D. Merry.Ed 467e949c46SKenneth D. Merry.Sh DESCRIPTION 477e949c46SKenneth D. MerryThe 487e949c46SKenneth D. Merry.Nm 497e949c46SKenneth D. Merrydriver provides the back half of a paravirtualized 507e949c46SKenneth D. Merry.Xr xen 4 51ab6fe159SKenneth D. Merrynetwork connection. 52ab6fe159SKenneth D. MerryThe netback and netfront drivers appear to their respective operating 53ab6fe159SKenneth D. Merrysystems as Ethernet devices linked by a crossover cable. 547e949c46SKenneth D. MerryTypically, 557e949c46SKenneth D. Merry.Nm 567e949c46SKenneth D. Merrywill run on Domain 0 and the netfront driver will run on a guest domain. 577e949c46SKenneth D. MerryHowever, it is also possible to run 587e949c46SKenneth D. Merry.Nm 59ab6fe159SKenneth D. Merryon a guest domain. 60ab6fe159SKenneth D. MerryIt may be bridged or routed to provide the netfront's 617e949c46SKenneth D. Merrydomain access to other guest domains or to a physical network. 627e949c46SKenneth D. Merry.Pp 637e949c46SKenneth D. MerryIn most respects, the 647e949c46SKenneth D. Merry.Nm 65ab6fe159SKenneth D. Merrydevice appears to the OS as an other Ethernet device. 66ab6fe159SKenneth D. MerryIt can be configured at runtime entirely with 67ab6fe159SKenneth D. Merry.Xr ifconfig 8 . 68ab6fe159SKenneth D. MerryIn particular, it supports MAC changing, arbitrary MTU sizes, checksum 69ab6fe159SKenneth D. Merryoffload for IP, UDP, and TCP for both receive and transmit, and TSO. 70ab6fe159SKenneth D. MerryHowever, see 717e949c46SKenneth D. Merry.Sx CAVEATS 727e949c46SKenneth D. Merrybefore enabling txcsum, rxcsum, or tso. 737e949c46SKenneth D. Merry.Sh SYSCTL VARIABLES 747e949c46SKenneth D. MerryThe following read-only variables are available via 757e949c46SKenneth D. Merry.Xr sysctl 8 : 767e949c46SKenneth D. Merry.Bl -tag -width indent 777e949c46SKenneth D. Merry.It Va dev.xnb.%d.dump_rings 787e949c46SKenneth D. MerryDisplays information about the ring buffers used to pass requests between the 79ab6fe159SKenneth D. Merrynetfront and netback. 80ab6fe159SKenneth D. MerryMostly useful for debugging, but can also be used to 817e949c46SKenneth D. Merryget traffic statistics. 827e949c46SKenneth D. Merry.It Va dev.xnb.%d.unit_test_results 83ab6fe159SKenneth D. MerryRuns a builtin suite of unit tests and displays the results. 84ab6fe159SKenneth D. MerryDoes not affect the operation of the driver in any way. 85ab6fe159SKenneth D. MerryNote that the test suite simulates error conditions; this will result in 86ab6fe159SKenneth D. Merryerror messages being printed to the system system log. 87*12afe06cSJoel Dahl.Sh SEE ALSO 88*12afe06cSJoel Dahl.Xr arp 4 , 89*12afe06cSJoel Dahl.Xr netintro 4 , 90*12afe06cSJoel Dahl.Xr ng_ether 4 , 91*12afe06cSJoel Dahl.Xr xen 4 , 92*12afe06cSJoel Dahl.Xr ifconfig 8 93*12afe06cSJoel Dahl.Sh HISTORY 94*12afe06cSJoel DahlThe 95*12afe06cSJoel Dahl.Nm 96*12afe06cSJoel Dahldevice driver first appeared in 97*12afe06cSJoel Dahl.Fx 10.0 . 98*12afe06cSJoel Dahl.Sh AUTHORS 99*12afe06cSJoel DahlThe 100*12afe06cSJoel Dahl.Nm 101*12afe06cSJoel Dahldriver was written by 102*12afe06cSJoel Dahl.An Alan Somers 103*12afe06cSJoel Dahl.Aq alans@spectralogic.com 104*12afe06cSJoel Dahland 105*12afe06cSJoel Dahl.An John Suykerbuyk 106*12afe06cSJoel Dahl.Aq johns@spectralogic.com 1077e949c46SKenneth D. Merry.Sh CAVEATS 1087e949c46SKenneth D. MerryPackets sent through Xennet pass over shared memory, so the protocol includes 109ab6fe159SKenneth D. Merryno form of link-layer checksum or CRC. 110ab6fe159SKenneth D. MerryFurthermore, Xennet drivers always report to their hosts that they support 111ab6fe159SKenneth D. Merryreceive and transmit checksum offloading. 112ab6fe159SKenneth D. MerryThey "offload" the checksum calculation by simply skipping it. 1137e949c46SKenneth D. MerryThat works fine for packets that are exchanged between two domains on the same 114ab6fe159SKenneth D. Merrymachine. 115ab6fe159SKenneth D. MerryHowever, when a Xennet interface is bridged to a physical interface, 1167e949c46SKenneth D. Merrya correct checksum must be attached to any packets bound for that physical 117ab6fe159SKenneth D. Merryinterface. 118ab6fe159SKenneth D. MerryCurrently, FreeBSD lacks any mechanism for an ethernet device to 1197e949c46SKenneth D. Merryinform the OS that newly received packets are valid even though their checksums 120ab6fe159SKenneth D. Merryare not. 121ab6fe159SKenneth D. MerrySo if the netfront driver is configured to offload checksum calculations, 122ab6fe159SKenneth D. Merryit will pass non-checksumed packets to 123ab6fe159SKenneth D. Merry.Nm , 124ab6fe159SKenneth D. Merrywhich must then calculate the checksum in software before passing the packet 1257e949c46SKenneth D. Merryto the OS. 1267e949c46SKenneth D. Merry.Pp 1277e949c46SKenneth D. MerryFor this reason, it is recommended that if 1287e949c46SKenneth D. Merry.Nm 1297e949c46SKenneth D. Merryis bridged to a physcal interface, then transmit checksum offloading should be 130ab6fe159SKenneth D. Merrydisabled on the netfront. 131ab6fe159SKenneth D. MerryThe Xennet protocol does not have any mechanism for the netback to request 132ab6fe159SKenneth D. Merrythe netfront to do this; the operator must do it manually. 1337e949c46SKenneth D. Merry.Sh BUGS 1347e949c46SKenneth D. MerryThe 1357e949c46SKenneth D. Merry.Nm 1367e949c46SKenneth D. Merrydriver does not properly checksum UDP datagrams that span more than one 137ab6fe159SKenneth D. MerryEthernet frame. 138ab6fe159SKenneth D. MerryNor does it correctly checksum IPv6 packets. 139ab6fe159SKenneth D. MerryTo workaround that bug, disable transmit checksum offloading on the 140ab6fe159SKenneth D. Merrynetfront driver. 141