All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pearson, Robert B" <robert.pearson2@hpe.com>
To: Jason Gunthorpe <jgg@nvidia.com>, Bob Pearson <rpearsonhpe@gmail.com>
Cc: "zyjzyj2000@gmail.com" <zyjzyj2000@gmail.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Hillf Danton <hdanton@sina.com>
Subject: RE: [PATCH for-next 2/5] RDMA/rxe: Fix misleading comments and names
Date: Fri, 22 Jan 2021 21:48:21 +0000	[thread overview]
Message-ID: <CS1PR8401MB0821842A2477AB7CE0B8290DBCA00@CS1PR8401MB0821.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20210122192725.GG4147@nvidia.com>



-----Original Message-----
From: Jason Gunthorpe <jgg@nvidia.com> 
Sent: Friday, January 22, 2021 1:27 PM
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: zyjzyj2000@gmail.com; linux-rdma@vger.kernel.org; Pearson, Robert B <robert.pearson2@hpe.com>; Hillf Danton <hdanton@sina.com>
Subject: Re: [PATCH for-next 2/5] RDMA/rxe: Fix misleading comments and names

On Thu, Jan 21, 2021 at 10:23:10PM -0600, Bob Pearson wrote:
> The names and comments of the 'unlocked' pool APIs are very misleading 
> and not what was intended. This patch replaces 'rxe_xxx_nl' with 
> 'rxe_xxx__' with comments indicating that the caller is expected to 
> hold the rxe pool lock.
> 
> Reported-by: Hillf Danton <hdanton@sina.com>
> Signed-off-by: Bob Pearson <rpearson@hpe.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_mcast.c |  8 ++--  
> drivers/infiniband/sw/rxe/rxe_pool.c  | 22 +++++------  
> drivers/infiniband/sw/rxe/rxe_pool.h  | 55 +++++++++++++--------------
>  3 files changed, 42 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c 
> b/drivers/infiniband/sw/rxe/rxe_mcast.c
> index 5be47ce7d319..b9f06f87866e 100644
> --- a/drivers/infiniband/sw/rxe/rxe_mcast.c
> +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c
> @@ -15,18 +15,18 @@ static struct rxe_mc_grp *create_grp(struct rxe_dev *rxe,
>  	int err;
>  	struct rxe_mc_grp *grp;
>  
> -	grp = rxe_alloc_nl(&rxe->mc_grp_pool);
> +	grp = rxe_alloc__(&rxe->mc_grp_pool);

Everything else seems fine, but this trailing __ is too weird

If a lock is supposed to be held then name it foo_locked() or locked_()

If it auto-locks then name it foo()

If there is some #define wrapper then it is 

#define foo() __foo()

Jason


I have both in some cases. A #define and a locked version in some cases. I'll try xxx_locked().
To be clear that means caller should hold some lock, yes?

bob

  reply	other threads:[~2021-01-22 21:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  4:23 [PATCH for-next 0/5] RDMA/rxe: Fix rxe_alloc() bug Bob Pearson
2021-01-22  4:23 ` [PATCH for-next 1/5] RDMA/rxe: Fix bug in rxe_alloc Bob Pearson
2021-01-22  4:23 ` [PATCH for-next 2/5] RDMA/rxe: Fix misleading comments and names Bob Pearson
2021-01-22 19:27   ` Jason Gunthorpe
2021-01-22 21:48     ` Pearson, Robert B [this message]
2021-01-25 15:15       ` Jason Gunthorpe
2021-01-22  4:23 ` [PATCH for-next 3/5] RDMA/rxe: Remove RXE_POOL_ATOMIC Bob Pearson
2021-01-22  4:23 ` [PATCH for-next 4/5] RDMA/rxe: Remove calls to ib_device_try_get/put Bob Pearson
2021-01-22  4:23 ` [PATCH for-next 5/5] RDMA/rxe: Remove unneeded pool->flag 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=CS1PR8401MB0821842A2477AB7CE0B8290DBCA00@CS1PR8401MB0821.NAMPRD84.PROD.OUTLOOK.COM \
    --to=robert.pearson2@hpe.com \
    --cc=hdanton@sina.com \
    --cc=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.