From: Jason Gunthorpe <jgg@nvidia.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next v12 01/11] RDMA/rxe: Replace #define by enum
Date: Fri, 18 Mar 2022 15:00:29 -0300 [thread overview]
Message-ID: <20220318180029.GW11336@nvidia.com> (raw)
In-Reply-To: <20220318015514.231621-2-rpearsonhpe@gmail.com>
On Thu, Mar 17, 2022 at 08:55:04PM -0500, Bob Pearson wrote:
> Currently the #define IB_SRQ_INIT_MASK is used to distinguish
> the rxe_create_srq verb from the rxe_modify_srq verb so that some code
> can be shared between these two subroutines.
>
> This commit replaces the #define with an enum which extends
> enum ib_srq_attr_mask and makes related changes to prototypes
> to clean up type warnings. The parameter is given a rxe specific
> name.
>
> Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
> drivers/infiniband/sw/rxe/rxe_loc.h | 8 ++------
> drivers/infiniband/sw/rxe/rxe_srq.c | 10 +++++-----
> drivers/infiniband/sw/rxe/rxe_verbs.c | 7 ++++---
> drivers/infiniband/sw/rxe/rxe_verbs.h | 6 ++++++
> 4 files changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
> index 2ffbe3390668..9067d3b6f1ee 100644
> +++ b/drivers/infiniband/sw/rxe/rxe_loc.h
> @@ -159,17 +159,13 @@ void retransmit_timer(struct timer_list *t);
> void rnr_nak_timer(struct timer_list *t);
>
> /* rxe_srq.c */
> -#define IB_SRQ_INIT_MASK (~IB_SRQ_LIMIT)
> -
> int rxe_srq_chk_attr(struct rxe_dev *rxe, struct rxe_srq *srq,
> - struct ib_srq_attr *attr, enum ib_srq_attr_mask mask);
> -
> + struct ib_srq_attr *attr, enum rxe_srq_attr_mask
> mask);
It is very old code that is passing around a enum to indicate a
bitfield, this is not the correct way.
Please just change these to unsigned int.
> +enum rxe_srq_attr_mask {
> + RXE_SRQ_MAX_WR = IB_SRQ_MAX_WR,
> + RXE_SRQ_LIMIT = IB_SRQ_LIMIT,
> + RXE_SRQ_INIT = BIT(2),
> +};
But this seems pretty dodgy?
Why not add another parameter, or maybe split the function or
something?
Jason
next prev parent reply other threads:[~2022-03-18 18:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 1:55 [PATCH for-next v12 00/11] Fix race conditions in rxe_pool Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 01/11] RDMA/rxe: Replace #define by enum Bob Pearson
2022-03-18 18:00 ` Jason Gunthorpe [this message]
2022-03-18 1:55 ` [PATCH for-next v12 02/11] RDMA/rxe: Add rxe_srq_cleanup() Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 03/11] RDMA/rxe: Check rxe_get() return value Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 04/11] RDMA/rxe: Move qp cleanup code to rxe_qp_do_cleanup() Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 05/11] RDMA/rxe: Move mr cleanup code to rxe_mr_cleanup() Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 06/11] RDMA/rxe: Move mw cleanup code to rxe_mw_cleanup() Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 07/11] RDMA/rxe: Enforce IBA C11-17 Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 08/11] RDMA/rxe: Stop lookup of partially built objects Bob Pearson
2022-03-18 18:07 ` Jason Gunthorpe
2022-03-18 1:55 ` [PATCH for-next v12 09/11] RDMA/rxe: Add wait_for_completion to pool objects Bob Pearson
2022-03-18 18:10 ` Jason Gunthorpe
2022-03-18 1:55 ` [PATCH for-next v12 10/11] RDMA/rxe: Convert read side locking to rcu Bob Pearson
2022-03-18 1:55 ` [PATCH for-next v12 11/11] RDMA/rxe: Cleanup rxe_pool.c 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=20220318180029.GW11336@nvidia.com \
--to=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--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.