FreeBSD kernel /amd64 XEN device code
xbb_softc Struct Reference
Collaboration diagram for xbb_softc:

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_reqrequests
 
struct xbb_xen_reqlist_list reqlist_free_stailq
 
struct xbb_xen_reqlist_list reqlist_pending_stailq
 
struct xbb_xen_reqlistrequest_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
 

Detailed Description

Per-instance configuration data.

Definition at line 547 of file blkback.c.

Field Documentation

◆ abi

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().

◆ active_request_count

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().

◆ backend

union xbb_backend_data xbb_softc::backend

◆ dev

◆ dev_mode

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().

◆ dev_name

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().

◆ dev_type

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().

◆ device_type

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().

◆ disable_flush

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().

◆ dispatch_io

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().

◆ flags

◆ flush_count

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().

◆ flush_interval

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().

◆ forced_dispatch

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().

◆ gnt_base_addr

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().

◆ hotplug_done

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().

◆ hotplug_watch

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().

◆ io_task

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().

◆ io_taskqueue

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().

◆ kva

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().

◆ kva_free

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().

◆ kva_shortages

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().

◆ kva_size

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().

◆ lock

◆ maps

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().

◆ max_reqlist_segments

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().

◆ max_reqlist_size

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().

◆ max_request_segments

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().

◆ max_request_size

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().

◆ max_requests

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().

◆ media_num_sectors

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().

◆ media_size

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().

◆ no_coalesce_reqs

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().

◆ normal_dispatch

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().

◆ otherend_id

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().

◆ pseudo_phys_res

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().

◆ pseudo_phys_res_id

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().

◆ reqlist_free_stailq

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().

◆ reqlist_kva_pages

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().

◆ reqlist_kva_size

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().

◆ reqlist_pending_stailq

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().

◆ reqs_completed

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().

◆ reqs_completed_with_error

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().

◆ reqs_queued_for_completion

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().

◆ reqs_received

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().

◆ request_free_stailq

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().

◆ request_lists

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().

◆ request_shortages

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().

◆ requests

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().

◆ ring_config

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().

◆ rings

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().

◆ sector_size

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().

◆ sector_size_shift

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().

◆ total_dispatch

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().

◆ vn

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().

◆ xbb_sgs

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().

◆ xbb_stats

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().

◆ xbb_stats_in

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

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().


The documentation for this struct was generated from the following file: