Skip to content

Commit

Permalink
Get rid of redundant 'table_size' field in struct pi_msix. If needed …
Browse files Browse the repository at this point in the history
…it can

always be calculated from the number of entries in the MSI-X table.

Obtained from:	NetApp
  • Loading branch information
neel authored and neel committed Jan 21, 2013
1 parent 7a0ff69 commit b3baed2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion usr.sbin/bhyve/pci_emul.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ struct pci_devinst {
int table_bar;
int pba_bar;
size_t table_offset;
size_t table_size;
int table_count;
size_t pba_offset;
struct msix_table_entry table[MAX_MSIX_TABLE_SIZE];
Expand Down
3 changes: 1 addition & 2 deletions usr.sbin/bhyve/pci_passthru.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,10 @@ init_msix_table(struct vmctx *ctx, struct passthru_softc *sc, uint64_t base)
* XXX for now, assume that the table is not in the middle
*/
table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE;
pi->pi_msix.table_size = table_size;
idx = pi->pi_msix.table_bar;

/* Round up to page size */
table_size = (table_size + 0x1000) & ~0xFFF;
table_size = roundup2(table_size, 4096);
if (pi->pi_msix.table_offset == 0) {
/* Map everything after the MSI-X table */
start = pi->pi_bar[idx].addr + table_size;
Expand Down

0 comments on commit b3baed2

Please sign in to comment.