All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zhijian <lizhijian@fujitsu.com>
To: "Yang, Xiao/杨 晓" <yangx.jy@fujitsu.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Cc: "leon@kernel.org" <leon@kernel.org>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>,
	"rpearsonhpe@gmail.com" <rpearsonhpe@gmail.com>,
	"zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>
Subject: Re: [RESEND PATCH v5 1/2] RDMA/rxe: Support RDMA Atomic Write operation
Date: Tue, 27 Sep 2022 16:18:52 +0800	[thread overview]
Message-ID: <fb02de6c-a32b-654a-62b9-55f44ffaec30@fujitsu.com> (raw)
In-Reply-To: <20220708040228.6703-2-yangx.jy@fujitsu.com>

Hi Yang

I wonder if you need to do something if a user register MR with ATOMIC_WRITE to non-rxe device, something like in my flush:

Thanks
Zhijian

  static inline int ib_check_mr_access(struct ib_device *ib_dev,
  				     unsigned int flags)
  {
+	u64 device_cap = ib_dev->attrs.device_cap_flags;
+
  	/*
  	 * Local write permission is required if remote write or
  	 * remote atomic permission is also requested.
@@ -4335,6 +4346,13 @@ static inline int ib_check_mr_access(struct ib_device *ib_dev,
  	if (flags & IB_ACCESS_ON_DEMAND &&
  	    !(ib_dev->attrs.kernel_cap_flags & IBK_ON_DEMAND_PAGING))
  		return -EINVAL;
+
+	if ((flags & IB_ACCESS_FLUSH_GLOBAL &&
+	    !(device_cap & IB_DEVICE_FLUSH_GLOBAL)) ||
+	    (flags & IB_ACCESS_FLUSH_PERSISTENT &&
+	    !(device_cap & IB_DEVICE_FLUSH_PERSISTENT)))
+		return -EINVAL;
+
  	return 0;
  }
  

On 08/07/2022 12:02, Yang, Xiao/杨 晓 wrote:
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 9c6317cf80d5..7834285c8498 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h


  parent reply	other threads:[~2022-09-27  8:19 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/杨 晓
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 [this message]
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=fb02de6c-a32b-654a-62b9-55f44ffaec30@fujitsu.com \
    --to=lizhijian@fujitsu.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.com \
    --cc=yangx.jy@fujitsu.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.