From: Jason Gunthorpe <jgg@nvidia.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: zyjzyj2000@gmail.com, leonro@nvidia.com, yangx.jy@fujitsu.com,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next v5 4/6] RDMA-rxe: Isolate mr code from atomic_write_reply()
Date: Wed, 18 Jan 2023 09:53:34 -0400 [thread overview]
Message-ID: <Y8f53jdDAN0B9qy7@nvidia.com> (raw)
In-Reply-To: <1a198842-91f6-2fe4-a478-1df4dda341c0@gmail.com>
On Tue, Jan 17, 2023 at 02:41:53PM -0600, Bob Pearson wrote:
> On 1/17/23 12:05, Jason Gunthorpe wrote:
> > On Tue, Jan 17, 2023 at 11:04:29AM -0600, Bob Pearson wrote:
> >> On 1/17/23 10:59, Jason Gunthorpe wrote:
> >>> On Tue, Jan 17, 2023 at 10:57:31AM -0600, Bob Pearson wrote:
> >>>
> >>>>>> - 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;
> >>>>>> + if (res->replay)
> >>>>>> + return RESPST_ACKNOWLEDGE;
> >>>>>>
> >>>>>> - /* Do atomic write after all prior operations have completed */
> >>>>>> - smp_store_release(dst, src);
> >>>>>> + mr = qp->resp.mr;
> >>>>>> + value = *(u64 *)payload_addr(pkt);
> >>>>>> + iova = qp->resp.va + qp->resp.offset;
> >>>>>>
> >>>>>> - /* decrease resp.resid to zero */
> >>>>>> - qp->resp.resid -= sizeof(payload);
> >>>>>> +#if defined CONFIG_64BIT
> >>>>>
> >>>>> Shouldn't need a #ifdef here
> >>>>
> >>>> This avoids a new special error (i.e. NOT_64_bit) and makes it clear we
> >>>> won't call the code in mr.
> >>>
> >>> ? That doesn't seem right
> >>
> >> that was the -3 of the -1, -2, -3 that we just fixed. there are three error paths out
> >> of this state and we need a way to get to them. The #ifdef provides
> >> that third path.
> >
> > I feel like it should be solvable without this ifdef though
> >
> > Jason
>
> You could get rid of the ifdef in the atomic_write_reply() routine but then the rxe_mr_do_atomic_write() routine would have to have a second version in the #else case
> that would have to return something different so that the third exit could be taken i.e.
> whatever replaces the original -3. I really think this is simpler.
You really should just return the RESPST_* from these functions.
Jason
next prev parent reply other threads:[~2023-01-18 14:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 23:55 [PATCH for-next v5 0/6] RDMA/rxe: Replace mr page map with an xarray Bob Pearson
2023-01-16 23:55 ` [PATCH for-next v5 1/6] RDMA/rxe: Cleanup mr_check_range Bob Pearson
2023-01-16 23:55 ` [PATCH for-next v5 2/6] RDMA/rxe: Move rxe_map_mr_sg to rxe_mr.c Bob Pearson
2023-01-16 23:56 ` [PATCH for-next v5 3/6] RDMA-rxe: Isolate mr code from atomic_reply() Bob Pearson
2023-01-17 15:09 ` Jason Gunthorpe
2023-01-17 16:52 ` Bob Pearson
2023-01-16 23:56 ` [PATCH for-next v5 4/6] RDMA-rxe: Isolate mr code from atomic_write_reply() Bob Pearson
2023-01-17 15:11 ` Jason Gunthorpe
2023-01-17 16:57 ` Bob Pearson
2023-01-17 16:59 ` Jason Gunthorpe
2023-01-17 17:04 ` Bob Pearson
2023-01-17 18:05 ` Jason Gunthorpe
2023-01-17 20:41 ` Bob Pearson
2023-01-18 13:53 ` Jason Gunthorpe [this message]
2023-01-16 23:56 ` [PATCH for-next v5 5/6] RDMA/rxe: Cleanup page variables in rxe_mr.c Bob Pearson
2023-01-16 23:56 ` [PATCH for-next v5 6/6] RDMA/rxe: Replace rxe_map and rxe_phys_buf by xarray Bob Pearson
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=Y8f53jdDAN0B9qy7@nvidia.com \
--to=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--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.