mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
54a485e9ec
The lookaside count is improperly initialized to the size of the
Receive Queue with the additional +1. In the traces below, the
RQ size is 384, so the count was set to 385.
The lookaside count is then rarely refreshed. Note the high and
incorrect count in the trace below:
rvt_get_rwqe: [hfi1_0] wqe ffffc900078e9008 wr_id 55c7206d75a0 qpn c
qpt 2 pid 3018 num_sge 1 head 1 tail 0, count 385
rvt_get_rwqe: (hfi1_rc_rcv+0x4eb/0x1480 [hfi1] <- rvt_get_rwqe) ret=0x1
The head,tail indicate there is only one RWQE posted although the count
says 385 and we correctly return the element 0.
The next call to rvt_get_rwqe with the decremented count:
rvt_get_rwqe: [hfi1_0] wqe ffffc900078e9058 wr_id 0 qpn c
qpt 2 pid 3018 num_sge 0 head 1 tail 1, count 384
rvt_get_rwqe: (hfi1_rc_rcv+0x4eb/0x1480 [hfi1] <- rvt_get_rwqe) ret=0x1
Note that the RQ is empty (head == tail) yet we return the RWQE at tail 1,
which is not valid because of the bogus high count.
Best case, the RWQE has never been posted and the rc logic sees an RWQE
that is too small (all zeros) and puts the QP into an error state.
In the worst case, a server slow at posting receive buffers might fool
rvt_get_rwqe() into fetching an old RWQE and corrupt memory.
Fix by deleting the faulty initialization code and creating an
inline to fetch the posted count and convert all callers to use
new inline.
Fixes:
|
||
---|---|---|
.. | ||
ib_addr.h | ||
ib_cache.h | ||
ib_cm.h | ||
ib_hdrs.h | ||
ib_mad.h | ||
ib_marshall.h | ||
ib_pack.h | ||
ib_pma.h | ||
ib_sa.h | ||
ib_smi.h | ||
ib_umem_odp.h | ||
ib_umem.h | ||
ib_verbs.h | ||
ib.h | ||
iba.h | ||
ibta_vol1_c12.h | ||
iw_cm.h | ||
iw_portmap.h | ||
lag.h | ||
mr_pool.h | ||
opa_addr.h | ||
opa_port_info.h | ||
opa_smi.h | ||
opa_vnic.h | ||
rdma_cm_ib.h | ||
rdma_cm.h | ||
rdma_counter.h | ||
rdma_netlink.h | ||
rdma_vt.h | ||
rdmavt_cq.h | ||
rdmavt_mr.h | ||
rdmavt_qp.h | ||
restrack.h | ||
rw.h | ||
signature.h | ||
tid_rdma_defs.h | ||
uverbs_ioctl.h | ||
uverbs_named_ioctl.h | ||
uverbs_std_types.h | ||
uverbs_types.h |