FreeBSD kernel /amd64 XEN device code
|
Unit tests for the Xen netback driver. More...
#include <sys/cdefs.h>
Go to the source code of this file.
Data Structures | |
struct | test_fixture |
Macros | |
#define | SNCATF(buffer, buflen, ...) |
#define | STRINGIFY(x) #x |
#define | TOSTRING(x) STRINGIFY(x) |
#define | XNB_ASSERT(cond) |
#define | TOTAL_TESTS (53) |
#define | TOTAL_BUFLEN (400 * TOTAL_TESTS + 2) |
Typedefs | |
typedef void | testcase_t(char *buffer, size_t buflen) |
typedef int | setup_t(void) |
typedef void | teardown_t(void) |
typedef struct test_fixture | test_fixture_t |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | xnb_get1pkt (struct xnb_pkt *pkt, size_t size, uint16_t flags) |
static int | xnb_unit_test_runner (test_fixture_t const tests[], int ntests, char *buffer, size_t buflen) |
static int __unused | null_setup (void) |
static void __unused | null_teardown (void) |
static void | safe_m_freem (struct mbuf **ppMbuf) |
static int | xnb_unit_test_main (SYSCTL_HANDLER_ARGS) |
static void | xnb_ring2pkt_emptyring (char *buffer, size_t buflen) |
static void | xnb_ring2pkt_1req (char *buffer, size_t buflen) |
static void | xnb_ring2pkt_2req (char *buffer, size_t buflen) |
static void | xnb_ring2pkt_3req (char *buffer, size_t buflen) |
static void | xnb_ring2pkt_extra (char *buffer, size_t buflen) |
static void | xnb_ring2pkt_partial (char *buffer, size_t buflen) |
static void | xnb_ring2pkt_wraps (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_emptypkt (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_1req (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_extra (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_long (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_invalid (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_error (char *buffer, size_t buflen) |
static void | xnb_txpkt2rsp_wraps (char *buffer, size_t buflen) |
static void | xnb_pkt2mbufc_empty (char *buffer, size_t buflen) |
static void | xnb_pkt2mbufc_short (char *buffer, size_t buflen) |
static void | xnb_pkt2mbufc_csum (char *buffer, size_t buflen) |
static void | xnb_pkt2mbufc_1cluster (char *buffer, size_t buflen) |
static void | xnb_pkt2mbufc_largecluster (char *buffer, size_t buflen) |
static void | xnb_pkt2mbufc_2cluster (char *buffer, size_t buflen) |
static void | xnb_txpkt2gnttab_empty (char *buffer, size_t buflen) |
static void | xnb_txpkt2gnttab_short (char *buffer, size_t buflen) |
static void | xnb_txpkt2gnttab_2req (char *buffer, size_t buflen) |
static void | xnb_txpkt2gnttab_2cluster (char *buffer, size_t buflen) |
static void | xnb_update_mbufc_short (char *buffer, size_t buflen) |
static void | xnb_update_mbufc_2req (char *buffer, size_t buflen) |
static void | xnb_update_mbufc_2cluster (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_empty (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_short (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_1cluster (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_2short (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_long (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_extra (char *buffer, size_t buflen) |
static void | xnb_mbufc2pkt_nospace (char *buffer, size_t buflen) |
static void | xnb_rxpkt2gnttab_empty (char *buffer, size_t buflen) |
static void | xnb_rxpkt2gnttab_short (char *buffer, size_t buflen) |
static void | xnb_rxpkt2gnttab_2req (char *buffer, size_t buflen) |
static void | xnb_rxpkt2rsp_empty (char *buffer, size_t buflen) |
static void | xnb_rxpkt2rsp_short (char *buffer, size_t buflen) |
static void | xnb_rxpkt2rsp_extra (char *buffer, size_t buflen) |
static void | xnb_rxpkt2rsp_2slots (char *buffer, size_t buflen) |
static void | xnb_rxpkt2rsp_2short (char *buffer, size_t buflen) |
static void | xnb_rxpkt2rsp_copyerror (char *buffer, size_t buflen) |
static void | xnb_sscanf_hhu (char *buffer, size_t buflen) |
static void | xnb_sscanf_hhd (char *buffer, size_t buflen) |
static void | xnb_sscanf_lld (char *buffer, size_t buflen) |
static void | xnb_sscanf_llu (char *buffer, size_t buflen) |
static void | xnb_sscanf_hhn (char *buffer, size_t buflen) |
Unit tests for the Xen netback driver.
Due to the driver's use of static functions, these tests cannot be compiled standalone; they must be #include'd from the driver's .c file.
Definition in file netback_unit_tests.c.
#define SNCATF | ( | buffer, | |
buflen, | |||
... | |||
) |
Helper macro used to snprintf to a buffer and update the buffer pointer
Definition at line 50 of file netback_unit_tests.c.
#define STRINGIFY | ( | x | ) | #x |
Definition at line 58 of file netback_unit_tests.c.
#define TOSTRING | ( | x | ) | STRINGIFY(x) |
Definition at line 59 of file netback_unit_tests.c.
#define TOTAL_BUFLEN (400 * TOTAL_TESTS + 2) |
Max memory available for returning results. 400 chars/test should give enough space for a five line error message for every test
Definition at line 255 of file netback_unit_tests.c.
#define TOTAL_TESTS (53) |
Number of unit tests. Must match the length of the tests array below
Definition at line 250 of file netback_unit_tests.c.
#define XNB_ASSERT | ( | cond | ) |
Writes an error message to buffer if cond is false Note the implied parameters buffer and buflen
Definition at line 66 of file netback_unit_tests.c.
typedef int setup_t(void) |
Signature used by setup functions
Definition at line 89 of file netback_unit_tests.c.
typedef void teardown_t(void) |
Definition at line 91 of file netback_unit_tests.c.
typedef struct test_fixture test_fixture_t |
Definition at line 105 of file netback_unit_tests.c.
typedef void testcase_t(char *buffer, size_t buflen) |
The signature used by all testcases. If the test writes anything to buffer, then it will be considered a failure
buffer | Return storage for error messages |
buflen | The space available in the buffer |
Definition at line 83 of file netback_unit_tests.c.
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 112 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 115 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
inlinestatic |
Definition at line 193 of file netback_unit_tests.c.
Referenced by xnb_mbufc2pkt_1cluster(), xnb_mbufc2pkt_2short(), xnb_mbufc2pkt_empty(), xnb_mbufc2pkt_extra(), xnb_mbufc2pkt_long(), xnb_mbufc2pkt_nospace(), xnb_mbufc2pkt_short(), xnb_pkt2mbufc_1cluster(), xnb_pkt2mbufc_2cluster(), xnb_pkt2mbufc_csum(), xnb_pkt2mbufc_empty(), xnb_pkt2mbufc_largecluster(), xnb_pkt2mbufc_short(), xnb_rxpkt2gnttab_empty(), xnb_rxpkt2gnttab_short(), xnb_rxpkt2rsp_2short(), xnb_rxpkt2rsp_2slots(), xnb_rxpkt2rsp_copyerror(), xnb_rxpkt2rsp_empty(), xnb_rxpkt2rsp_extra(), xnb_rxpkt2rsp_short(), xnb_txpkt2gnttab_2req(), xnb_txpkt2gnttab_empty(), xnb_txpkt2gnttab_short(), xnb_update_mbufc_2cluster(), xnb_update_mbufc_2req(), and xnb_update_mbufc_short().
|
static |
Helper function used to setup pkt2mbufc tests
size | size in bytes of the single request to push to the ring | |
flags | optional flags to put in the netif request | |
[out] | pkt | the returned packet object |
Definition at line 967 of file netback_unit_tests.c.
References xnb_ring2pkt(), and xnb_unit_pvt.
Referenced by xnb_pkt2mbufc_1cluster(), xnb_pkt2mbufc_2cluster(), xnb_pkt2mbufc_csum(), xnb_pkt2mbufc_largecluster(), and xnb_pkt2mbufc_short().
|
static |
xnb_mbufc2pkt on a single mbuf with an mbuf cluster
Definition at line 1462 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::flags, xnb_pkt::list_len, safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_mbufc2pkt on a two-mbuf chain with short data regions
Definition at line 1488 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::cdr, xnb_pkt::list_len, safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_mbufc2pkt on an empty mbufc
Definition at line 1416 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_mbufc2pkt on a mbuf chain with >1 mbuf cluster and extra info
Definition at line 1568 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::cdr, xnb_pkt::extra, xnb_pkt::flags, safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_mbufc2pkt on a mbuf chain with >1 mbuf cluster
Definition at line 1530 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::cdr, xnb_pkt::flags, safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_mbufc2pkt with insufficient space in the ring
Definition at line 1609 of file netback_unit_tests.c.
References safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_mbufc2pkt on a short mbufc
Definition at line 1436 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::flags, xnb_pkt::list_len, safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), and xnb_pkt_is_valid().
|
static |
xnb_pkt2mbufc on packet that can fit in one cluster
Definition at line 1044 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_get1pkt(), xnb_pkt2mbufc(), and xnb_unit_pvt.
|
static |
xnb_pkt2mbufc on packet that cannot fit in one clusters
Definition at line 1078 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_get1pkt(), xnb_pkt2mbufc(), and xnb_unit_pvt.
|
static |
xnb_pkt2mbufc on short packet whose checksum was validated by the netfron
Definition at line 1023 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_get1pkt(), xnb_pkt2mbufc(), and xnb_unit_pvt.
|
static |
xnb_pkt2mbufc on an empty packet
Definition at line 987 of file netback_unit_tests.c.
References xnb_pkt::list_len, safe_m_freem(), xnb_pkt::size, xnb_pkt2mbufc(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
xnb_pkt2mbufc on packet that cannot fit in one regular cluster
Definition at line 1061 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_get1pkt(), xnb_pkt2mbufc(), and xnb_unit_pvt.
|
static |
xnb_pkt2mbufc on short packet that can fit in an mbuf internal buffer
Definition at line 1006 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_get1pkt(), xnb_pkt2mbufc(), and xnb_unit_pvt.
|
static |
Verify that xnb_ring2pkt can convert a single request packet correctly
Definition at line 406 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::flags, xnb_pkt::list_len, xnb_pkt::size, XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
Verify that xnb_ring2pkt can convert a two request packet correctly. This tests handling of the MORE_DATA flag and cdr
Definition at line 437 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::cdr, xnb_pkt::flags, xnb_pkt::list_len, xnb_pkt::size, XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
Verify that xnb_ring2pkt can convert a three request packet correctly
Definition at line 474 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::cdr, xnb_pkt::flags, xnb_pkt::list_len, xnb_pkt::size, XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
Verify that xnb_ring2pkt will not consume any requests from an empty ring
Definition at line 392 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
Verify that xnb_ring2pkt can read extra inf
Definition at line 518 of file netback_unit_tests.c.
References xnb_pkt::car, xnb_pkt::car_size, xnb_pkt::cdr, xnb_pkt::extra, xnb_pkt::flags, xnb_pkt::list_len, xnb_pkt::size, XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
Verify that xnb_ring2pkt will consume no requests if the entire packet is not yet in the ring
Definition at line 571 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
Verity that xnb_ring2pkt can read a packet whose requests wrap around the end of the ring
Definition at line 596 of file netback_unit_tests.c.
References xnb_pkt::cdr, xnb_pkt::list_len, XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2gnttab on a packet with two different mbufs in a single chai
Definition at line 1703 of file netback_unit_tests.c.
References xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2gnttab on an empty packet. Should return empty gnttab
Definition at line 1642 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2gnttab on a short packet without extra data
Definition at line 1662 of file netback_unit_tests.c.
References safe_m_freem(), xnb_pkt::size, virt_to_mfn, virt_to_offset, XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2rsp on a grant table with two sub-page entries
Definition at line 1958 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2rsp on a packet with more than a pages's worth of data. It should generate two response slot
Definition at line 1892 of file netback_unit_tests.c.
References safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2rsp on a long packet with a hypervisor gnttab_copy error Note: this test will result in an error message being printed to the console such as: xnb(xnb_rxpkt2rsp:1720): Got error -1 for hypervisor gnttab_copy status
Definition at line 2017 of file netback_unit_tests.c.
References safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2rsp on an empty packet. Shouldn't make any response
Definition at line 1747 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2rsp with extra data
Definition at line 1823 of file netback_unit_tests.c.
References safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_rxpkt2rsp on a short packet with no extras
Definition at line 1778 of file netback_unit_tests.c.
References safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_mbufc2pkt(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), and xnb_unit_pvt.
|
static |
|
static |
sscanf on unsigned short short n's
Definition at line 2513 of file netback_unit_tests.c.
References XNB_ASSERT.
|
static |
sscanf on unsigned chars
Definition at line 2439 of file netback_unit_tests.c.
References XNB_ASSERT.
|
static |
sscanf on signed long longs
Definition at line 2475 of file netback_unit_tests.c.
References XNB_ASSERT.
|
static |
sscanf on unsigned long longs
Definition at line 2494 of file netback_unit_tests.c.
References XNB_ASSERT.
|
static |
xnb_txpkt2gnttab on a single request that spans two mbuf clusters
Definition at line 1209 of file netback_unit_tests.c.
References virt_to_offset, XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_txpkt2gnttab on a packet with two requests, that can fit into a single mbuf cluster
Definition at line 1164 of file netback_unit_tests.c.
References safe_m_freem(), virt_to_offset, XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_txpkt2gnttab on an empty packet. Should return empty gnttab
Definition at line 1101 of file netback_unit_tests.c.
References xnb_pkt::list_len, safe_m_freem(), xnb_pkt::size, XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_txpkt2gnttab on a short packet, that can fit in one mbuf internal buffer and has one request
Definition at line 1123 of file netback_unit_tests.c.
References safe_m_freem(), virt_to_mfn, virt_to_offset, XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), and xnb_unit_pvt.
|
static |
xnb_txpkt2rsp responding to one request
Definition at line 671 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_txpkt2rsp should do nothing for an empty packet
Definition at line 649 of file netback_unit_tests.c.
References xnb_pkt::list_len, XNB_ASSERT, xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_txpkt2rsp responding to one request which caused an error
Definition at line 869 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_txpkt2rsp responding to 1 data request and 1 extra info
Definition at line 703 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_txpkt2rsp responding to an invalid packet. Note: this test will result in an error message being printed to the console such as: xnb(xnb_ring2pkt:1306): Unknown extra info type 255. Discarding packet
Definition at line 823 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_pkt_is_valid(), xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_pkg2rsp responding to 3 data requests and 1 extra info
Definition at line 748 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
xnb_txpkt2rsp's responses wrap around the end of the ring
Definition at line 901 of file netback_unit_tests.c.
References XNB_ASSERT, xnb_ring2pkt(), xnb_txpkt2rsp(), and xnb_unit_pvt.
|
static |
Called from userspace by a sysctl. Runs all internal unit tests, and returns the results to userspace as a string
oidp | unused |
arg1 | pointer to an xnb_softc for a specific xnb device |
arg2 | unused |
req | sysctl access structure |
results is static so that the data will persist after this function returns. The sysctl code expects us to return a constant string.
Definition at line 268 of file netback_unit_tests.c.
References null_setup(), null_teardown(), setup_pvt_data, teardown_pvt_data, TOTAL_BUFLEN, TOTAL_TESTS, xnb_mbufc2pkt_1cluster, xnb_mbufc2pkt_2short, xnb_mbufc2pkt_empty, xnb_mbufc2pkt_extra, xnb_mbufc2pkt_long, xnb_mbufc2pkt_nospace, xnb_mbufc2pkt_short, xnb_pkt2mbufc_1cluster, xnb_pkt2mbufc_2cluster, xnb_pkt2mbufc_csum, xnb_pkt2mbufc_empty, xnb_pkt2mbufc_largecluster, xnb_pkt2mbufc_short, xnb_ring2pkt_1req, xnb_ring2pkt_2req, xnb_ring2pkt_3req, xnb_ring2pkt_emptyring, xnb_ring2pkt_extra, xnb_ring2pkt_partial, xnb_ring2pkt_wraps, xnb_rxpkt2gnttab_2req, xnb_rxpkt2gnttab_empty, xnb_rxpkt2gnttab_short, xnb_rxpkt2rsp_2short, xnb_rxpkt2rsp_2slots, xnb_rxpkt2rsp_copyerror, xnb_rxpkt2rsp_empty, xnb_rxpkt2rsp_extra, xnb_rxpkt2rsp_short, xnb_sscanf_hhd, xnb_sscanf_hhn, xnb_sscanf_hhu, xnb_sscanf_lld, xnb_sscanf_llu, xnb_txpkt2gnttab_2cluster, xnb_txpkt2gnttab_2req, xnb_txpkt2gnttab_empty, xnb_txpkt2gnttab_short, xnb_txpkt2rsp_1req, xnb_txpkt2rsp_emptypkt, xnb_txpkt2rsp_error, xnb_txpkt2rsp_extra, xnb_txpkt2rsp_invalid, xnb_txpkt2rsp_long, xnb_txpkt2rsp_wraps, xnb_unit_test_runner(), xnb_update_mbufc_2cluster, xnb_update_mbufc_2req, and xnb_update_mbufc_short.
|
static |
The unit test runner. It will run every supplied test and return an output message as a string
tests | An array of tests. Every test will be attempted. |
ntests | The length of tests |
buffer | Return storage for the result string |
buflen | The length of buffer |
Definition at line 210 of file netback_unit_tests.c.
References test_fixture::setup, SNCATF, test_fixture::teardown, and test_fixture::test.
Referenced by xnb_unit_test_main().
|
static |
xnb_update_mbufc on a single request that spans two mbuf clusters
Definition at line 1366 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), xnb_unit_pvt, and xnb_update_mbufc().
|
static |
xnb_update_mbufc on a packet with two requests, that can fit into a single mbuf cluster
Definition at line 1320 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), xnb_unit_pvt, and xnb_update_mbufc().
|
static |
xnb_update_mbufc on a short packet that only has one gnttab entry
Definition at line 1283 of file netback_unit_tests.c.
References safe_m_freem(), XNB_ASSERT, xnb_pkt2mbufc(), xnb_ring2pkt(), xnb_txpkt2gnttab(), xnb_unit_pvt, and xnb_update_mbufc().
gnttab_copy_table gnttab |
Definition at line 183 of file netback_unit_tests.c.
Referenced by xnb_recv(), xnb_rxpkt2gnttab(), xnb_rxpkt2rsp(), xnb_send(), xnb_txpkt2gnttab(), and xnb_update_mbufc().
struct ifnet* ifp |
Definition at line 188 of file netback_unit_tests.c.
Referenced by create_netdev(), xn_assemble_tx_request(), xn_configure_features(), xn_ifinit_locked(), xn_ioctl(), xn_qflush(), xn_rxeof(), xn_stop(), xn_txeof(), xn_txq_mq_start(), xn_txq_mq_start_locked(), xn_txq_start(), xnb_ifinit_locked(), xnb_intr(), xnb_ioctl(), xnb_pkt2mbufc(), xnb_start(), xnb_start_locked(), and xnb_stop().
netif_rx_back_ring_t rxb |
Definition at line 184 of file netback_unit_tests.c.
Referenced by xnb_dump_rings(), xnb_rxpkt2gnttab(), and xnb_start_locked().
netif_rx_front_ring_t rxf |
Definition at line 185 of file netback_unit_tests.c.
netif_rx_sring_t* rxs |
Definition at line 189 of file netback_unit_tests.c.
Referenced by setup_rxqs().
|
static |
Definition at line 117 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 118 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
netif_tx_back_ring_t txb |
Definition at line 186 of file netback_unit_tests.c.
Referenced by xnb_dump_rings(), xnb_intr(), xnb_recv(), and xnb_txpkt2gnttab().
netif_tx_front_ring_t txf |
Definition at line 187 of file netback_unit_tests.c.
netif_tx_sring_t* txs |
Definition at line 190 of file netback_unit_tests.c.
Referenced by setup_txqs().
|
static |
Definition at line 148 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 149 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 146 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 151 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 150 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 152 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 147 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 136 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 138 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 135 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 133 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 137 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 134 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 120 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 121 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 122 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 119 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 123 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 124 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 125 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 155 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 153 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 154 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 159 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 160 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 161 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 156 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 158 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 157 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 165 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 166 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 164 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 163 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 162 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 142 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 141 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 139 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 140 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 127 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 126 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 131 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 128 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 130 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 129 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 132 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
struct { ... } xnb_unit_pvt |
Private data used by unit tests
Referenced by xnb_get1pkt(), xnb_pkt2mbufc_1cluster(), xnb_pkt2mbufc_2cluster(), xnb_pkt2mbufc_csum(), xnb_pkt2mbufc_empty(), xnb_pkt2mbufc_largecluster(), xnb_pkt2mbufc_short(), xnb_ring2pkt_1req(), xnb_ring2pkt_2req(), xnb_ring2pkt_3req(), xnb_ring2pkt_emptyring(), xnb_ring2pkt_extra(), xnb_ring2pkt_partial(), xnb_ring2pkt_wraps(), xnb_rxpkt2gnttab_2req(), xnb_rxpkt2gnttab_empty(), xnb_rxpkt2gnttab_short(), xnb_rxpkt2rsp_2short(), xnb_rxpkt2rsp_2slots(), xnb_rxpkt2rsp_copyerror(), xnb_rxpkt2rsp_empty(), xnb_rxpkt2rsp_extra(), xnb_rxpkt2rsp_short(), xnb_txpkt2gnttab_2cluster(), xnb_txpkt2gnttab_2req(), xnb_txpkt2gnttab_empty(), xnb_txpkt2gnttab_short(), xnb_txpkt2rsp_1req(), xnb_txpkt2rsp_emptypkt(), xnb_txpkt2rsp_error(), xnb_txpkt2rsp_extra(), xnb_txpkt2rsp_invalid(), xnb_txpkt2rsp_long(), xnb_txpkt2rsp_wraps(), xnb_update_mbufc_2cluster(), xnb_update_mbufc_2req(), and xnb_update_mbufc_short().
|
static |
Definition at line 145 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 144 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().
|
static |
Definition at line 143 of file netback_unit_tests.c.
Referenced by xnb_unit_test_main().