mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-23 12:32:53 +07:00
[IB] mthca: Avoid SRQ free WQE list corruption
Fix wqe_to_link() to use a structure field that we know is definitely always unused for receive work requests, so that it really avoids the free list corruption bug that the comment claims it does. Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
7162a3e0db
commit
e5b251a24a
@ -75,15 +75,16 @@ static void *get_wqe(struct mthca_srq *srq, int n)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Return a pointer to the location within a WQE that we're using as a
|
* Return a pointer to the location within a WQE that we're using as a
|
||||||
* link when the WQE is in the free list. We use an offset of 4
|
* link when the WQE is in the free list. We use the imm field
|
||||||
* because in the Tavor case, posting a WQE may overwrite the first
|
* because in the Tavor case, posting a WQE may overwrite the next
|
||||||
* four bytes of the previous WQE. The offset avoids corrupting our
|
* segment of the previous WQE, but a receive WQE will never touch the
|
||||||
* free list if the WQE has already completed and been put on the free
|
* imm field. This avoids corrupting our free list if the previous
|
||||||
* list when we post the next WQE.
|
* WQE has already completed and been put on the free list when we
|
||||||
|
* post the next WQE.
|
||||||
*/
|
*/
|
||||||
static inline int *wqe_to_link(void *wqe)
|
static inline int *wqe_to_link(void *wqe)
|
||||||
{
|
{
|
||||||
return (int *) (wqe + 4);
|
return (int *) (wqe + offsetof(struct mthca_next_seg, imm));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mthca_tavor_init_srq_context(struct mthca_dev *dev,
|
static void mthca_tavor_init_srq_context(struct mthca_dev *dev,
|
||||||
|
Loading…
Reference in New Issue
Block a user