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