summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/pci_emul.h
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-01-30 04:30:36 +0000
committerneel <neel@FreeBSD.org>2013-01-30 04:30:36 +0000
commit6b8dd85cc6a6fb909199883b05cc590385133db1 (patch)
treed2b32ff5d9a64e8c2daa5f143b50a5cfcfd8d795 /usr.sbin/bhyve/pci_emul.h
parent1ae7af0ed87a074e560452e9f87dc50964a20275 (diff)
downloadFreeBSD-src-6b8dd85cc6a6fb909199883b05cc590385133db1.zip
FreeBSD-src-6b8dd85cc6a6fb909199883b05cc590385133db1.tar.gz
Add support for MSI-X interrupts in the virtio network device and make that
the default. The current behavior of advertising a single MSI vector can be requested by setting the environment variable "BHYVE_USE_MSI" to "true". The use of MSI is not compliant with the virtio specification and will be eventually phased out. Submitted by: Gopakumar T Obtained from: NetApp
Diffstat (limited to 'usr.sbin/bhyve/pci_emul.h')
-rw-r--r--usr.sbin/bhyve/pci_emul.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h
index f007bdf..5338aec 100644
--- a/usr.sbin/bhyve/pci_emul.h
+++ b/usr.sbin/bhyve/pci_emul.h
@@ -96,6 +96,8 @@ struct msix_table_entry {
* for the size that should be emulated.
*/
#define MSIX_TABLE_ENTRY_SIZE 16
+#define MAX_MSIX_TABLE_ENTRIES 2048
+#define PBA_TABLE_ENTRY_SIZE 8
struct pci_devinst {
struct pci_devemu *pi_d;
@@ -120,6 +122,8 @@ struct pci_devinst {
size_t table_offset;
int table_count;
size_t pba_offset;
+ size_t pba_size;
+ int function_mask;
struct msix_table_entry *table; /* allocated at runtime */
} pi_msix;
@@ -168,6 +172,10 @@ int pci_msix_enabled(struct pci_devinst *pi);
int pci_msi_msgnum(struct pci_devinst *pi);
void pci_parse_slot(char *opt, int legacy);
void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr);
+int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum);
+int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size,
+ uint64_t value);
+uint64_t pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size);
static __inline void
pci_set_cfgdata8(struct pci_devinst *pi, int offset, uint8_t val)
OpenPOWER on IntegriCloud