mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
v6.2 merge window 2nd pull request
Fix two build warnings on 32 bit platforms -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRRRCHOFoQz/8F5bUaFwuHvBreFYQUCY50UewAKCRCFwuHvBreF YazuAQCHY/yOiziPBqNvI9jSb/MVGh1oaZQZRTkt5fOvLSGt8gD/Rv30/h6EcKfG S5A6eQ3qrVzEhp7P8mST2Q/MkGmQ+AQ= =Qw7m -----END PGP SIGNATURE----- Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Fix two build warnings on 32 bit platforms It seems the linux-next CI and 0-day bot are not testing enough 32 bit configurations, as soon as you merged the rdma pull request there were two instant reports of warnings on these sytems that I would have thought should have been covered by time in linux-next Anyhow, here are the fixes so people don't hit problems with -Werror" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/siw: Fix pointer cast warning RDMA/rxe: Fix compile warnings on 32-bit
This commit is contained in:
commit
ed56954cf5
@ -785,53 +785,61 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static enum resp_states atomic_write_reply(struct rxe_qp *qp,
|
||||
struct rxe_pkt_info *pkt)
|
||||
#ifdef CONFIG_64BIT
|
||||
static enum resp_states do_atomic_write(struct rxe_qp *qp,
|
||||
struct rxe_pkt_info *pkt)
|
||||
{
|
||||
u64 src, *dst;
|
||||
struct resp_res *res = qp->resp.res;
|
||||
struct rxe_mr *mr = qp->resp.mr;
|
||||
int payload = payload_size(pkt);
|
||||
u64 src, *dst;
|
||||
|
||||
if (mr->state != RXE_MR_STATE_VALID)
|
||||
return RESPST_ERR_RKEY_VIOLATION;
|
||||
|
||||
memcpy(&src, payload_addr(pkt), payload);
|
||||
|
||||
dst = iova_to_vaddr(mr, qp->resp.va + qp->resp.offset, payload);
|
||||
/* check vaddr is 8 bytes aligned. */
|
||||
if (!dst || (uintptr_t)dst & 7)
|
||||
return RESPST_ERR_MISALIGNED_ATOMIC;
|
||||
|
||||
/* Do atomic write after all prior operations have completed */
|
||||
smp_store_release(dst, src);
|
||||
|
||||
/* decrease resp.resid to zero */
|
||||
qp->resp.resid -= sizeof(payload);
|
||||
|
||||
qp->resp.msn++;
|
||||
|
||||
/* next expected psn, read handles this separately */
|
||||
qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
|
||||
qp->resp.ack_psn = qp->resp.psn;
|
||||
|
||||
qp->resp.opcode = pkt->opcode;
|
||||
qp->resp.status = IB_WC_SUCCESS;
|
||||
return RESPST_ACKNOWLEDGE;
|
||||
}
|
||||
#else
|
||||
static enum resp_states do_atomic_write(struct rxe_qp *qp,
|
||||
struct rxe_pkt_info *pkt)
|
||||
{
|
||||
return RESPST_ERR_UNSUPPORTED_OPCODE;
|
||||
}
|
||||
#endif /* CONFIG_64BIT */
|
||||
|
||||
static enum resp_states atomic_write_reply(struct rxe_qp *qp,
|
||||
struct rxe_pkt_info *pkt)
|
||||
{
|
||||
struct resp_res *res = qp->resp.res;
|
||||
|
||||
if (!res) {
|
||||
res = rxe_prepare_res(qp, pkt, RXE_ATOMIC_WRITE_MASK);
|
||||
qp->resp.res = res;
|
||||
}
|
||||
|
||||
if (!res->replay) {
|
||||
#ifdef CONFIG_64BIT
|
||||
if (mr->state != RXE_MR_STATE_VALID)
|
||||
return RESPST_ERR_RKEY_VIOLATION;
|
||||
|
||||
memcpy(&src, payload_addr(pkt), payload);
|
||||
|
||||
dst = iova_to_vaddr(mr, qp->resp.va + qp->resp.offset, payload);
|
||||
/* check vaddr is 8 bytes aligned. */
|
||||
if (!dst || (uintptr_t)dst & 7)
|
||||
return RESPST_ERR_MISALIGNED_ATOMIC;
|
||||
|
||||
/* Do atomic write after all prior operations have completed */
|
||||
smp_store_release(dst, src);
|
||||
|
||||
/* decrease resp.resid to zero */
|
||||
qp->resp.resid -= sizeof(payload);
|
||||
|
||||
qp->resp.msn++;
|
||||
|
||||
/* next expected psn, read handles this separately */
|
||||
qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
|
||||
qp->resp.ack_psn = qp->resp.psn;
|
||||
|
||||
qp->resp.opcode = pkt->opcode;
|
||||
qp->resp.status = IB_WC_SUCCESS;
|
||||
|
||||
if (res->replay)
|
||||
return RESPST_ACKNOWLEDGE;
|
||||
#else
|
||||
return RESPST_ERR_UNSUPPORTED_OPCODE;
|
||||
#endif /* CONFIG_64BIT */
|
||||
}
|
||||
|
||||
return RESPST_ACKNOWLEDGE;
|
||||
return do_atomic_write(qp, pkt);
|
||||
}
|
||||
|
||||
static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp,
|
||||
|
@ -29,7 +29,7 @@ static struct page *siw_get_pblpage(struct siw_mem *mem, u64 addr, int *idx)
|
||||
dma_addr_t paddr = siw_pbl_get_buffer(pbl, offset, NULL, idx);
|
||||
|
||||
if (paddr)
|
||||
return virt_to_page((void *)paddr);
|
||||
return virt_to_page((void *)(uintptr_t)paddr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user