From 7f685c218aab7dcffad6119b6e3741a0b71a2e97 Mon Sep 17 00:00:00 2001 From: ken Date: Thu, 26 Jan 2012 16:35:09 +0000 Subject: Xen netback driver rewrite. share/man/man4/Makefile, share/man/man4/xnb.4, sys/dev/xen/netback/netback.c, sys/dev/xen/netback/netback_unit_tests.c: Rewrote the netback driver for xen to attach properly via newbus and work properly in both HVM and PVM mode (only HVM is tested). Works with the in-tree FreeBSD netfront driver or the Windows netfront driver from SuSE. Has not been extensively tested with a Linux netfront driver. Does not implement LRO, TSO, or polling. Includes unit tests that may be run through sysctl after compiling with XNB_DEBUG defined. sys/dev/xen/blkback/blkback.c, sys/xen/interface/io/netif.h: Comment elaboration. sys/kern/uipc_mbuf.c: Fix page fault in kernel mode when calling m_print() on a null mbuf. Since m_print() is only used for debugging, there are no performance concerns for extra error checking code. sys/kern/subr_scanf.c: Add the "hh" and "ll" width specifiers from C99 to scanf(). A few callers were already using "ll" even though scanf() was handling it as "l". Submitted by: Alan Somers Submitted by: John Suykerbuyk Sponsored by: Spectra Logic MFC after: 1 week Reviewed by: ken --- sys/xen/interface/io/netif.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/xen/interface') diff --git a/sys/xen/interface/io/netif.h b/sys/xen/interface/io/netif.h index fbb5c27..261b7d9 100644 --- a/sys/xen/interface/io/netif.h +++ b/sys/xen/interface/io/netif.h @@ -42,7 +42,7 @@ * This is the 'wire' format for packets: * Request 1: netif_tx_request -- NETTXF_* (any flags) * [Request 2: netif_tx_extra] (only if request 1 has NETTXF_extra_info) - * [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_MORE) + * [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_FLAG_MORE) * Request 4: netif_tx_request -- NETTXF_more_data * Request 5: netif_tx_request -- NETTXF_more_data * ... @@ -70,7 +70,9 @@ struct netif_tx_request { uint16_t offset; /* Offset within buffer page */ uint16_t flags; /* NETTXF_* */ uint16_t id; /* Echoed in response message. */ - uint16_t size; /* Packet size in bytes. */ + uint16_t size; /* For the first request in a packet, the packet + size in bytes. For subsequent requests, the + size of that request's associated data in bytes*/ }; typedef struct netif_tx_request netif_tx_request_t; @@ -175,7 +177,7 @@ struct netif_rx_response { uint16_t id; uint16_t offset; /* Offset in page of start of received packet */ uint16_t flags; /* NETRXF_* */ - int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */ + int16_t status; /* -ve: NETIF_RSP_* ; +ve: Rx'ed response size. */ }; typedef struct netif_rx_response netif_rx_response_t; -- cgit v1.1