Skip to content

Commit ed56954

Browse files
committed
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
2 parents 6830d50 + 5244ca8 commit ed56954

File tree

2 files changed

+41
-33
lines changed

2 files changed

+41
-33
lines changed

drivers/infiniband/sw/rxe/rxe_resp.c

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -785,53 +785,61 @@ static enum resp_states atomic_reply(struct rxe_qp *qp,
785785
return ret;
786786
}
787787

788-
static enum resp_states atomic_write_reply(struct rxe_qp *qp,
789-
struct rxe_pkt_info *pkt)
788+
#ifdef CONFIG_64BIT
789+
static enum resp_states do_atomic_write(struct rxe_qp *qp,
790+
struct rxe_pkt_info *pkt)
790791
{
791-
u64 src, *dst;
792-
struct resp_res *res = qp->resp.res;
793792
struct rxe_mr *mr = qp->resp.mr;
794793
int payload = payload_size(pkt);
794+
u64 src, *dst;
795795

796-
if (!res) {
797-
res = rxe_prepare_res(qp, pkt, RXE_ATOMIC_WRITE_MASK);
798-
qp->resp.res = res;
799-
}
800-
801-
if (!res->replay) {
802-
#ifdef CONFIG_64BIT
803-
if (mr->state != RXE_MR_STATE_VALID)
804-
return RESPST_ERR_RKEY_VIOLATION;
805-
806-
memcpy(&src, payload_addr(pkt), payload);
796+
if (mr->state != RXE_MR_STATE_VALID)
797+
return RESPST_ERR_RKEY_VIOLATION;
807798

808-
dst = iova_to_vaddr(mr, qp->resp.va + qp->resp.offset, payload);
809-
/* check vaddr is 8 bytes aligned. */
810-
if (!dst || (uintptr_t)dst & 7)
811-
return RESPST_ERR_MISALIGNED_ATOMIC;
799+
memcpy(&src, payload_addr(pkt), payload);
812800

813-
/* Do atomic write after all prior operations have completed */
814-
smp_store_release(dst, src);
801+
dst = iova_to_vaddr(mr, qp->resp.va + qp->resp.offset, payload);
802+
/* check vaddr is 8 bytes aligned. */
803+
if (!dst || (uintptr_t)dst & 7)
804+
return RESPST_ERR_MISALIGNED_ATOMIC;
815805

816-
/* decrease resp.resid to zero */
817-
qp->resp.resid -= sizeof(payload);
806+
/* Do atomic write after all prior operations have completed */
807+
smp_store_release(dst, src);
818808

819-
qp->resp.msn++;
809+
/* decrease resp.resid to zero */
810+
qp->resp.resid -= sizeof(payload);
820811

821-
/* next expected psn, read handles this separately */
822-
qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
823-
qp->resp.ack_psn = qp->resp.psn;
812+
qp->resp.msn++;
824813

825-
qp->resp.opcode = pkt->opcode;
826-
qp->resp.status = IB_WC_SUCCESS;
814+
/* next expected psn, read handles this separately */
815+
qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
816+
qp->resp.ack_psn = qp->resp.psn;
827817

828-
return RESPST_ACKNOWLEDGE;
818+
qp->resp.opcode = pkt->opcode;
819+
qp->resp.status = IB_WC_SUCCESS;
820+
return RESPST_ACKNOWLEDGE;
821+
}
829822
#else
830-
return RESPST_ERR_UNSUPPORTED_OPCODE;
823+
static enum resp_states do_atomic_write(struct rxe_qp *qp,
824+
struct rxe_pkt_info *pkt)
825+
{
826+
return RESPST_ERR_UNSUPPORTED_OPCODE;
827+
}
831828
#endif /* CONFIG_64BIT */
829+
830+
static enum resp_states atomic_write_reply(struct rxe_qp *qp,
831+
struct rxe_pkt_info *pkt)
832+
{
833+
struct resp_res *res = qp->resp.res;
834+
835+
if (!res) {
836+
res = rxe_prepare_res(qp, pkt, RXE_ATOMIC_WRITE_MASK);
837+
qp->resp.res = res;
832838
}
833839

834-
return RESPST_ACKNOWLEDGE;
840+
if (res->replay)
841+
return RESPST_ACKNOWLEDGE;
842+
return do_atomic_write(qp, pkt);
835843
}
836844

837845
static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp,

drivers/infiniband/sw/siw/siw_qp_tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static struct page *siw_get_pblpage(struct siw_mem *mem, u64 addr, int *idx)
2929
dma_addr_t paddr = siw_pbl_get_buffer(pbl, offset, NULL, idx);
3030

3131
if (paddr)
32-
return virt_to_page((void *)paddr);
32+
return virt_to_page((void *)(uintptr_t)paddr);
3333

3434
return NULL;
3535
}

0 commit comments

Comments
 (0)