mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Convert the offset into the bar that contains the MSI-X table to an offset
into the MSI-X table before using it to calculate the table index. In the common case where the MSI-X table is located at the begining of the BAR these two offsets are identical and thus the code was working by accident. This change will fix the case where the MSI-X table is located in the middle or at the end of the BAR that contains it. Obtained from: NetApp
This commit is contained in:
parent
5fd81be1fc
commit
4b5e84f615
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248171
@ -279,6 +279,7 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size)
|
||||
int index;
|
||||
|
||||
pi = sc->psc_pi;
|
||||
offset -= pi->pi_msix.table_offset;
|
||||
|
||||
index = offset / MSIX_TABLE_ENTRY_SIZE;
|
||||
if (index >= pi->pi_msix.table_count)
|
||||
@ -323,6 +324,8 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc,
|
||||
int error, index;
|
||||
|
||||
pi = sc->psc_pi;
|
||||
offset -= pi->pi_msix.table_offset;
|
||||
|
||||
index = offset / MSIX_TABLE_ENTRY_SIZE;
|
||||
if (index >= pi->pi_msix.table_count)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user