netback.c (282634) | netback.c (286372) |
---|---|
1/*- 2 * Copyright (c) 2009-2011 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * POSSIBILITY OF SUCH DAMAGES. 29 * 30 * Authors: Justin T. Gibbs (Spectra Logic Corporation) 31 * Alan Somers (Spectra Logic Corporation) 32 * John Suykerbuyk (Spectra Logic Corporation) 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2011 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 * POSSIBILITY OF SUCH DAMAGES. 29 * 30 * Authors: Justin T. Gibbs (Spectra Logic Corporation) 31 * Alan Somers (Spectra Logic Corporation) 32 * John Suykerbuyk (Spectra Logic Corporation) 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/dev/xen/netback/netback.c 282634 2015-05-08 14:48:40Z royger $"); | 36__FBSDID("$FreeBSD: head/sys/dev/xen/netback/netback.c 286372 2015-08-06 17:07:21Z jhb $"); |
37 38/** 39 * \file netback.c 40 * 41 * \brief Device driver supporting the vending of network access 42 * from this FreeBSD domain to other domains. 43 */ 44#include "opt_inet.h" --- 37 unchanged lines hidden (view full) --- 82#include <machine/_inttypes.h> 83 84#include <xen/xen-os.h> 85#include <xen/hypervisor.h> 86#include <xen/xen_intr.h> 87#include <xen/interface/io/netif.h> 88#include <xen/xenbus/xenbusvar.h> 89 | 37 38/** 39 * \file netback.c 40 * 41 * \brief Device driver supporting the vending of network access 42 * from this FreeBSD domain to other domains. 43 */ 44#include "opt_inet.h" --- 37 unchanged lines hidden (view full) --- 82#include <machine/_inttypes.h> 83 84#include <xen/xen-os.h> 85#include <xen/hypervisor.h> 86#include <xen/xen_intr.h> 87#include <xen/interface/io/netif.h> 88#include <xen/xenbus/xenbusvar.h> 89 |
90#include <machine/xen/xenvar.h> 91 | |
92/*--------------------------- Compile-time Tunables --------------------------*/ 93 94/*---------------------------------- Macros ----------------------------------*/ 95/** 96 * Custom malloc type for all driver allocations. 97 */ 98static MALLOC_DEFINE(M_XENNETBACK, "xnb", "Xen Net Back Driver Data"); 99 --- 27 unchanged lines hidden (view full) --- 127 */ 128#define RING_HAS_UNCONSUMED_REQUESTS_2(_r, cons) ({ \ 129 unsigned int req = (_r)->sring->req_prod - cons; \ 130 unsigned int rsp = RING_SIZE(_r) - \ 131 (cons - (_r)->rsp_prod_pvt); \ 132 req < rsp ? req : rsp; \ 133}) 134 | 90/*--------------------------- Compile-time Tunables --------------------------*/ 91 92/*---------------------------------- Macros ----------------------------------*/ 93/** 94 * Custom malloc type for all driver allocations. 95 */ 96static MALLOC_DEFINE(M_XENNETBACK, "xnb", "Xen Net Back Driver Data"); 97 --- 27 unchanged lines hidden (view full) --- 125 */ 126#define RING_HAS_UNCONSUMED_REQUESTS_2(_r, cons) ({ \ 127 unsigned int req = (_r)->sring->req_prod - cons; \ 128 unsigned int rsp = RING_SIZE(_r) - \ 129 (cons - (_r)->rsp_prod_pvt); \ 130 req < rsp ? req : rsp; \ 131}) 132 |
135#define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) | 133#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) |
136#define virt_to_offset(x) ((x) & (PAGE_SIZE - 1)) 137 138/** 139 * Predefined array type of grant table copy descriptors. Used to pass around 140 * statically allocated memory structures. 141 */ 142typedef struct gnttab_copy gnttab_copy_table[GNTTAB_LEN]; 143 --- 2377 unchanged lines hidden --- | 134#define virt_to_offset(x) ((x) & (PAGE_SIZE - 1)) 135 136/** 137 * Predefined array type of grant table copy descriptors. Used to pass around 138 * statically allocated memory structures. 139 */ 140typedef struct gnttab_copy gnttab_copy_table[GNTTAB_LEN]; 141 --- 2377 unchanged lines hidden --- |