All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Xiao/杨 晓" <yangx.jy@fujitsu.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"leon@kernel.org" <leon@kernel.org>,
	"rpearsonhpe@gmail.com" <rpearsonhpe@gmail.com>,
	"zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
	"lizhijian@fujitsu.com" <lizhijian@fujitsu.com>,
	Ira Weiny <ira.weiny@intel.com>
Subject: Re: [RESEND PATCH v5 1/2] RDMA/rxe: Support RDMA Atomic Write operation
Date: Mon, 26 Sep 2022 14:55:50 +0800	[thread overview]
Message-ID: <f34a180c-1d24-7780-7472-3f054fa35f59@fujitsu.com> (raw)
In-Reply-To: <Yy4xrlC2lt156nsV@nvidia.com>

On 2022/9/24 6:22, Jason Gunthorpe wrote:
> On Fri, Jul 08, 2022 at 04:02:36AM +0000, yangx.jy@fujitsu.com wrote:
>> +static enum resp_states atomic_write_reply(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);
>> +
>> +	if (!res) {
>> +		res = rxe_prepare_res(qp, pkt, RXE_ATOMIC_WRITE_MASK);
>> +		qp->resp.res = res;
>> +	}
>> +
>> +	if (!res->replay) {
>> +#ifdef CONFIG_64BIT
>> +		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);
> 
> Someone needs to fix iova_to_vaddr to do the missing kmap, we can't
> just assume you can cast a u64 pfn to a vaddr like this.

Hi Jason,
Cc Ira,

When using PMEM with DAX mode(devdax or fsdax), we cannot ensure that 
iova_to_vaddr() can cast a u64 pfn to a vaddr, right? so we have to 
replace page_address() with kmap_local_page().

Without Ira's PKS patch set, I didn't see any failure when accessing 
remote PMEM with devdax mode by RDMA based on RXE. I don't know why I 
cannot trigger any failure in the condition.

> 
>> +		/* 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
>> +		pr_err("32-bit arch doesn't support 8-byte atomic write\n");
>> +		return RESPST_ERR_UNSUPPORTED_OPCODE;
> 
> No print on receiving a remote packet

OK

Best Regards,
Xiao Yang

> 
> Jason

  reply	other threads:[~2022-09-26  6:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  4:02 [RESEND PATCH v5 0/2] RDMA/rxe: Add RDMA Atomic Write operation yangx.jy
2022-07-08  4:02 ` [RESEND PATCH v5 1/2] RDMA/rxe: Support " yangx.jy
2022-09-23 22:22   ` Jason Gunthorpe
2022-09-26  6:55     ` Yang, Xiao/杨 晓 [this message]
2022-10-06  7:53     ` Yang, Xiao/杨 晓
2022-10-14 16:00       ` Jason Gunthorpe
2022-10-20 13:25         ` Yang, Xiao/杨 晓
2022-10-24 17:02           ` Jason Gunthorpe
2022-09-27  8:18   ` Li Zhijian
2022-09-27 13:17     ` Jason Gunthorpe
2022-09-29  3:58       ` Yang, Xiao/杨 晓
2022-09-29  5:36         ` Yang, Xiao/杨 晓
2022-07-08  4:02 ` [RESEND PATCH v5 2/2] RDMA/rxe: Add RDMA Atomic Write attribute for rxe device yangx.jy
2022-08-04  7:30 ` [RESEND PATCH v5 0/2] RDMA/rxe: Add RDMA Atomic Write operation yangx.jy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f34a180c-1d24-7780-7472-3f054fa35f59@fujitsu.com \
    --to=yangx.jy@fujitsu.com \
    --cc=ira.weiny@intel.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=rpearsonhpe@gmail.com \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.