FreeBSD kernel /amd64 XEN device code
|
Data Fields | |
struct taskqueue * | io_taskqueue |
struct task | io_task |
xbb_type | device_type |
device_t | dev |
xbb_dispatch_t | dispatch_io |
int | active_request_count |
struct xbb_xen_req_list | request_free_stailq |
struct xbb_xen_req * | requests |
struct xbb_xen_reqlist_list | reqlist_free_stailq |
struct xbb_xen_reqlist_list | reqlist_pending_stailq |
struct xbb_xen_reqlist * | request_lists |
vm_offset_t | kva |
uint64_t | gnt_base_addr |
int | kva_size |
int | reqlist_kva_size |
int | reqlist_kva_pages |
bitstr_t * | kva_free |
domid_t | otherend_id |
Cached value of the front-end's domain id. More... | |
int | abi |
The blkif protocol abi in effect. More... | |
u_int | max_requests |
The maximum number of requests and request lists allowed to be in flight at a time. More... | |
u_int | max_request_segments |
The maximum number of segments (1 page per segment) that can be mapped by a request. More... | |
u_int | max_reqlist_segments |
Maximum number of segments per request list. More... | |
u_int | max_request_size |
u_int | max_reqlist_size |
xbb_flag_t | flags |
struct xbb_ring_config | ring_config |
blkif_back_rings_t | rings |
xen_intr_handle_t | xen_intr_handle |
char * | dev_mode |
Backend access mode flags (e.g. write, or read-only). More... | |
char * | dev_type |
Backend device type (e.g. "disk", "cdrom", "floppy"). More... | |
char * | dev_name |
Backend device/file identifier. More... | |
struct vnode * | vn |
union xbb_backend_data | backend |
u_int | sector_size |
u_int | sector_size_shift |
off_t | media_size |
uint64_t | media_num_sectors |
media_size expressed in terms of the backend native sector size. More... | |
struct xbb_sg | xbb_sgs [XBB_MAX_SEGMENTS_PER_REQLIST] |
Array of memoized scatter gather data computed during the conversion of blkif ring requests to internal xbb_xen_req structures. More... | |
struct gnttab_map_grant_ref | maps [XBB_MAX_SEGMENTS_PER_REQLIST] |
struct mtx | lock |
struct resource * | pseudo_phys_res |
int | pseudo_phys_res_id |
struct devstat * | xbb_stats |
struct devstat * | xbb_stats_in |
int | disable_flush |
int | flush_interval |
int | flush_count |
int | no_coalesce_reqs |
uint64_t | reqs_received |
uint64_t | reqs_completed |
uint64_t | reqs_queued_for_completion |
uint64_t | reqs_completed_with_error |
uint64_t | forced_dispatch |
uint64_t | normal_dispatch |
uint64_t | total_dispatch |
uint64_t | kva_shortages |
uint64_t | request_shortages |
struct xs_watch | hotplug_watch |
bool | hotplug_done |
int xbb_softc::abi |
The blkif protocol abi in effect.
There are situations where the back and front ends can have a different, native abi (e.g. intel x86_64 and 32bit x86 domains on the same machine). The back-end always accommodates the front-end's native abi. That value is pulled from the XenStore and recorded here.
Definition at line 625 of file blkback.c.
Referenced by xbb_collect_frontend_info(), xbb_connect_ring(), xbb_get_resources(), xbb_queue_response(), and xbb_run_queue().
int xbb_softc::active_request_count |
The number of requests outstanding on the backend device/file.
Definition at line 569 of file blkback.c.
Referenced by xbb_disconnect(), xbb_get_req(), xbb_release_req(), and xbb_release_reqs().
union xbb_backend_data xbb_softc::backend |
Definition at line 707 of file blkback.c.
Referenced by xbb_close_backend(), xbb_dispatch_dev(), xbb_dispatch_file(), xbb_open_dev(), and xbb_open_file().
device_t xbb_softc::dev |
NewBus device corresponding to this instance.
Definition at line 563 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_alloc_request_lists(), xbb_alloc_requests(), xbb_attach(), xbb_attach_cb(), xbb_attach_disk(), xbb_attach_failed(), xbb_bio_done(), xbb_collect_frontend_info(), xbb_connect(), xbb_connect_ring(), xbb_detach(), xbb_dispatch_dev(), xbb_dispatch_file(), xbb_dispatch_io(), xbb_free_communication_mem(), xbb_frontend_changed(), xbb_open_backend(), xbb_open_dev(), xbb_open_file(), xbb_publish_backend_info(), xbb_setup_sysctl(), xbb_shutdown(), and xbb_suspend().
char* xbb_softc::dev_mode |
Backend access mode flags (e.g. write, or read-only).
This value is passed to us by the front-end via the XenStore.
Definition at line 682 of file blkback.c.
Referenced by xbb_attach_cb(), xbb_attach_disk(), and xbb_detach().
char* xbb_softc::dev_name |
Backend device/file identifier.
This value is passed to us by the front-end via the XenStore. We expect this to be a POSIX path indicating the file or device to open.
Definition at line 699 of file blkback.c.
Referenced by xbb_attach_cb(), xbb_attach_disk(), xbb_bio_done(), xbb_close_backend(), xbb_detach(), xbb_dispatch_io(), xbb_open_backend(), xbb_open_dev(), and xbb_open_file().
char* xbb_softc::dev_type |
Backend device type (e.g. "disk", "cdrom", "floppy").
This value is passed to us by the front-end via the XenStore. Currently unused.
Definition at line 690 of file blkback.c.
Referenced by xbb_attach_cb(), and xbb_detach().
xbb_type xbb_softc::device_type |
Device type for this instance.
Definition at line 560 of file blkback.c.
Referenced by xbb_close_backend(), xbb_open_backend(), xbb_open_dev(), and xbb_open_file().
int xbb_softc::disable_flush |
Disable sending flush to the backend
Definition at line 768 of file blkback.c.
Referenced by xbb_dispatch_io(), and xbb_setup_sysctl().
xbb_dispatch_t xbb_softc::dispatch_io |
Backend specific dispatch routine for this instance.
Definition at line 566 of file blkback.c.
Referenced by xbb_dispatch_io(), xbb_open_dev(), and xbb_open_file().
xbb_flag_t xbb_softc::flags |
Various configuration and state bit flags.
Definition at line 666 of file blkback.c.
Referenced by xbb_attach_disk(), xbb_close_backend(), xbb_connect(), xbb_connect_ring(), xbb_disconnect(), xbb_dispatch_io(), xbb_get_kva(), xbb_get_resources(), xbb_open_backend(), xbb_publish_backend_info(), xbb_release_reqlist(), and xbb_shutdown().
int xbb_softc::flush_count |
Count of flush requests in the interval
Definition at line 774 of file blkback.c.
Referenced by xbb_dispatch_io().
int xbb_softc::flush_interval |
Send a real flush for every N flush requests
Definition at line 771 of file blkback.c.
Referenced by xbb_dispatch_io(), and xbb_setup_sysctl().
uint64_t xbb_softc::forced_dispatch |
How many forced dispatches (i.e. without coalescing) have happened
Definition at line 792 of file blkback.c.
Referenced by xbb_run_queue(), and xbb_setup_sysctl().
uint64_t xbb_softc::gnt_base_addr |
Pseudo-physical address corresponding to kva.
Definition at line 593 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_connect_ring(), xbb_free_communication_mem(), and xbb_get_gntaddr().
bool xbb_softc::hotplug_done |
Got the needed data from hotplug scripts?
Definition at line 810 of file blkback.c.
Referenced by xbb_attach(), xbb_attach_cb(), xbb_attach_disk(), and xbb_connect().
struct xs_watch xbb_softc::hotplug_watch |
Watch to wait for hotplug script execution
Definition at line 807 of file blkback.c.
Referenced by xbb_attach(), and xbb_shutdown().
struct task xbb_softc::io_task |
Single "run the request queue" task enqueued on io_taskqueue.
Definition at line 557 of file blkback.c.
Referenced by xbb_attach(), xbb_complete_reqlist(), xbb_disconnect(), xbb_filter(), and xbb_release_reqlist().
struct taskqueue* xbb_softc::io_taskqueue |
Task-queue used to process I/O requests.
Definition at line 551 of file blkback.c.
Referenced by xbb_attach_disk(), xbb_complete_reqlist(), xbb_detach(), xbb_disconnect(), xbb_filter(), and xbb_release_reqlist().
vm_offset_t xbb_softc::kva |
Global pool of kva used for mapping remote domain ring and I/O transaction data.
Definition at line 590 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_connect_ring(), xbb_free_communication_mem(), xbb_free_kva(), xbb_get_gntaddr(), and xbb_get_kva().
bitstr_t* xbb_softc::kva_free |
Bitmap of free KVA pages
Definition at line 605 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_free_communication_mem(), xbb_free_kva(), and xbb_get_kva().
uint64_t xbb_softc::kva_shortages |
How many times we have run out of KVA
Definition at line 801 of file blkback.c.
Referenced by xbb_get_kva(), and xbb_setup_sysctl().
int xbb_softc::kva_size |
The size of the global kva pool.
Definition at line 596 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), and xbb_connect_ring().
struct mtx xbb_softc::lock |
Mutex protecting per-instance data.
Definition at line 743 of file blkback.c.
Referenced by xbb_attach(), xbb_attach_failed(), xbb_complete_reqlist(), xbb_detach(), xbb_disconnect(), xbb_free_kva(), xbb_frontend_changed(), xbb_get_kva(), xbb_get_req(), xbb_get_reqlist(), xbb_get_resources(), xbb_push_responses(), xbb_queue_response(), xbb_release_req(), xbb_release_reqlist(), xbb_release_reqs(), and xbb_shutdown().
struct gnttab_map_grant_ref xbb_softc::maps[XBB_MAX_SEGMENTS_PER_REQLIST] |
Temporary grant table map used in xbb_dispatch_io(). When XBB_MAX_SEGMENTS_PER_REQLIST gets large, keeping this on the stack could cause a stack overflow.
Definition at line 740 of file blkback.c.
Referenced by xbb_dispatch_io().
u_int xbb_softc::max_reqlist_segments |
Maximum number of segments per request list.
This value is derived from and will generally be larger than max_request_segments.
Definition at line 649 of file blkback.c.
Referenced by xbb_alloc_request_lists(), xbb_connect(), and xbb_run_queue().
u_int xbb_softc::max_reqlist_size |
The maximum size of any request list. This is derived directly from max_reqlist_segments.
Definition at line 663 of file blkback.c.
Referenced by xbb_alloc_request_lists(), and xbb_connect().
u_int xbb_softc::max_request_segments |
The maximum number of segments (1 page per segment) that can be mapped by a request.
This value is negotiated via the XenStore.
Definition at line 641 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_collect_frontend_info(), xbb_connect(), xbb_dispatch_io(), and xbb_setup_sysctl().
u_int xbb_softc::max_request_size |
The maximum size of any request to this back-end device.
This value is negotiated via the XenStore.
Definition at line 657 of file blkback.c.
Referenced by xbb_collect_frontend_info(), and xbb_setup_sysctl().
u_int xbb_softc::max_requests |
The maximum number of requests and request lists allowed to be in flight at a time.
This value is negotiated via the XenStore.
Definition at line 633 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_alloc_request_lists(), xbb_alloc_requests(), xbb_collect_frontend_info(), xbb_connect(), and xbb_setup_sysctl().
uint64_t xbb_softc::media_num_sectors |
media_size expressed in terms of the backend native sector size.
(e.g. xbb->media_size >> xbb->sector_size_shift).
Definition at line 724 of file blkback.c.
Referenced by xbb_dispatch_io(), xbb_open_backend(), and xbb_publish_backend_info().
off_t xbb_softc::media_size |
Size in bytes of the backend device or file.
Definition at line 716 of file blkback.c.
Referenced by xbb_open_backend(), xbb_open_dev(), and xbb_open_file().
int xbb_softc::no_coalesce_reqs |
Don't coalesce requests if this is set
Definition at line 777 of file blkback.c.
Referenced by xbb_run_queue(), and xbb_setup_sysctl().
uint64_t xbb_softc::normal_dispatch |
How many normal dispatches have happened
Definition at line 795 of file blkback.c.
Referenced by xbb_run_queue(), and xbb_setup_sysctl().
domid_t xbb_softc::otherend_id |
Cached value of the front-end's domain id.
This value is used at once for each mapped page in a transaction. We cache it to avoid incuring the cost of an ivar access every time this is needed.
Definition at line 614 of file blkback.c.
Referenced by xbb_attach(), xbb_connect_ring(), xbb_dispatch_dev(), and xbb_dispatch_io().
struct resource* xbb_softc::pseudo_phys_res |
Resource representing allocated physical address space associated with our per-instance kva region.
Definition at line 749 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), and xbb_free_communication_mem().
int xbb_softc::pseudo_phys_res_id |
Resource id for allocated physical address space.
Definition at line 752 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), and xbb_free_communication_mem().
struct xbb_xen_reqlist_list xbb_softc::reqlist_free_stailq |
Free pool of request list structures.
Definition at line 578 of file blkback.c.
Referenced by xbb_alloc_request_lists(), xbb_get_reqlist(), and xbb_release_reqlist().
int xbb_softc::reqlist_kva_pages |
The number of pages of KVA used for request lists
Definition at line 602 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), and xbb_get_kva().
int xbb_softc::reqlist_kva_size |
The size of the KVA area used for request lists.
Definition at line 599 of file blkback.c.
Referenced by xbb_alloc_communication_mem().
struct xbb_xen_reqlist_list xbb_softc::reqlist_pending_stailq |
List of pending request lists awaiting execution.
Definition at line 581 of file blkback.c.
Referenced by xbb_alloc_request_lists(), xbb_get_resources(), and xbb_run_queue().
uint64_t xbb_softc::reqs_completed |
Number of requests we have completed
Definition at line 783 of file blkback.c.
Referenced by xbb_push_responses(), and xbb_setup_sysctl().
uint64_t xbb_softc::reqs_completed_with_error |
Number of requests we completed with an error status
Definition at line 789 of file blkback.c.
Referenced by xbb_queue_response(), and xbb_setup_sysctl().
uint64_t xbb_softc::reqs_queued_for_completion |
Number of requests we queued but not pushed
Definition at line 786 of file blkback.c.
Referenced by xbb_push_responses(), xbb_queue_response(), and xbb_setup_sysctl().
uint64_t xbb_softc::reqs_received |
Number of requests we have received
Definition at line 780 of file blkback.c.
Referenced by xbb_run_queue(), and xbb_setup_sysctl().
struct xbb_xen_req_list xbb_softc::request_free_stailq |
Free pool of request tracking structures.
Definition at line 572 of file blkback.c.
Referenced by xbb_alloc_requests(), xbb_get_req(), xbb_release_req(), and xbb_release_reqs().
struct xbb_xen_reqlist* xbb_softc::request_lists |
Array, sized at connection time, of request list structures.
Definition at line 584 of file blkback.c.
Referenced by xbb_alloc_request_lists(), and xbb_disconnect().
uint64_t xbb_softc::request_shortages |
How many times we have run out of request structures
Definition at line 804 of file blkback.c.
Referenced by xbb_get_resources(), and xbb_setup_sysctl().
struct xbb_xen_req* xbb_softc::requests |
Array, sized at connection time, of request tracking structures.
Definition at line 575 of file blkback.c.
Referenced by xbb_alloc_requests(), and xbb_disconnect().
struct xbb_ring_config xbb_softc::ring_config |
Ring mapping and interrupt configuration data.
Definition at line 669 of file blkback.c.
Referenced by xbb_alloc_communication_mem(), xbb_collect_frontend_info(), xbb_connect_ring(), xbb_disconnect(), xbb_dispatch_io(), xbb_get_kva(), and xbb_setup_sysctl().
blkif_back_rings_t xbb_softc::rings |
Runtime, cross-abi safe, structures for ring access.
Definition at line 672 of file blkback.c.
Referenced by xbb_connect_ring(), xbb_push_responses(), xbb_queue_response(), and xbb_run_queue().
u_int xbb_softc::sector_size |
The native sector size of the backend.
Definition at line 710 of file blkback.c.
Referenced by xbb_attach_disk(), xbb_dispatch_dev(), xbb_dispatch_io(), xbb_open_backend(), xbb_open_dev(), xbb_open_file(), and xbb_publish_backend_info().
u_int xbb_softc::sector_size_shift |
log2 of sector_size.
Definition at line 713 of file blkback.c.
Referenced by xbb_dispatch_dev(), xbb_dispatch_file(), xbb_dispatch_io(), and xbb_open_backend().
uint64_t xbb_softc::total_dispatch |
How many total dispatches have happened
Definition at line 798 of file blkback.c.
Referenced by xbb_run_queue(), and xbb_setup_sysctl().
struct vnode* xbb_softc::vn |
Vnode corresponding to the backend device node or file we are acessing.
Definition at line 705 of file blkback.c.
Referenced by xbb_close_backend(), xbb_dispatch_file(), xbb_open_backend(), xbb_open_dev(), and xbb_open_file().
struct xbb_sg xbb_softc::xbb_sgs[XBB_MAX_SEGMENTS_PER_REQLIST] |
Array of memoized scatter gather data computed during the conversion of blkif ring requests to internal xbb_xen_req structures.
Ring processing is serialized so we only need one of these.
Definition at line 733 of file blkback.c.
Referenced by xbb_dispatch_dev(), xbb_dispatch_file(), and xbb_dispatch_io().
struct devstat* xbb_softc::xbb_stats |
I/O statistics from BlockBack dispatch down. These are coalesced requests, and we start them right before execution.
Definition at line 758 of file blkback.c.
Referenced by xbb_attach_disk(), xbb_complete_reqlist(), xbb_detach(), and xbb_dispatch_io().
struct devstat* xbb_softc::xbb_stats_in |
I/O statistics coming into BlockBack. These are the requests as we get them from BlockFront. They are started as soon as we receive a request, and completed when the I/O is complete.
Definition at line 765 of file blkback.c.
Referenced by xbb_attach_disk(), xbb_complete_reqlist(), xbb_detach(), and xbb_get_resources().
xen_intr_handle_t xbb_softc::xen_intr_handle |
IRQ mapping for the communication ring event channel.
Definition at line 675 of file blkback.c.
Referenced by xbb_complete_reqlist(), xbb_connect_ring(), and xbb_disconnect().