public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Haakon Bugge <haakon.bugge@oracle.com>
Cc: Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	OFED mailing list <linux-rdma@vger.kernel.org>,
	Hans Ry <hans.westgaard.ry@oracle.com>
Subject: Re: [PATCH for-next v2] RDMA/cma: Replace RMW with atomic bit-ops
Date: Mon, 21 Jun 2021 12:54:01 +0300	[thread overview]
Message-ID: <YNBhuZNjGvUsJHUy@unreal> (raw)
In-Reply-To: <C8E39F1F-14D5-4DBE-ABE0-2EFC20353D83@oracle.com>

On Mon, Jun 21, 2021 at 08:20:47AM +0000, Haakon Bugge wrote:
> 
> 
> > On 21 Jun 2021, at 09:10, Leon Romanovsky <leon@kernel.org> wrote:
> > 
> > On Thu, Jun 17, 2021 at 02:59:25PM +0200, Håkon Bugge wrote:
> >> The struct rdma_id_private contains three bit-fields, tos_set,
> >> timeout_set, and min_rnr_timer_set. These are set by accessor
> >> functions without any synchronization. If two or all accessor
> >> functions are invoked in close proximity in time, there will be
> >> Read-Modify-Write from several contexts to the same variable, and the
> >> result will be intermittent.
> >> 
> >> Replace with a flag variable and an inline function for set with
> >> appropriate memory barriers and the use of test_bit().
> >> 
> >> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> >> Signed-off-by: Hans Westgaard Ry<hans.westgaard.ry@oracle.com>
> >> 
> >> ---
> >> 	v1 -> v2:
> >> 	   * Removed define wizardry and replaced with a set function
> >>             with memory barriers. Suggested by Leon.
> >> 	   * Removed zero-initialization of flags, due to kzalloc(),
> >>             as suggested by Leon
> >> 	   * Review comments from Stefan implicitly adapted due to
> >>             first bullet above
> >> 	   * Moved defines and inline function from header file to
> >>             cma.c, as suggested by the undersigned
> >> 	   * Renamed enum to cm_id_priv_flag_bits as suggested by the
> >>             undersigned
> >> ---
> >> drivers/infiniband/core/cma.c      | 38 +++++++++++++++++++++++++-------------
> >> drivers/infiniband/core/cma_priv.h |  4 +---
> >> 2 files changed, 26 insertions(+), 16 deletions(-)
> > 
> > This patch generates checkpatch warnings.
> > 
> > ➜  kernel git:(rdma-next) git checkpatch
> > WARNING: line length of 86 exceeds 80 columns
> > #69: FILE: drivers/infiniband/core/cma.c:1149:
> > +	if ((*qp_attr_mask & IB_QP_TIMEOUT) && test_bit(TIMEOUT_SET, &id_priv->flags))
> > 
> > WARNING: line length of 98 exceeds 80 columns
> > #73: FILE: drivers/infiniband/core/cma.c:1152:
> > +	if ((*qp_attr_mask & IB_QP_MIN_RNR_TIMER) && test_bit(MIN_RNR_TIMER_SET, &id_priv->flags))
> > 
> > WARNING: line length of 86 exceeds 80 columns
> > #127: FILE: drivers/infiniband/core/cma.c:3048:
> > +	u8 tos = test_bit(TOS_SET, &id_priv->flags) ? id_priv->tos : default_roce_tos;
> > 
> > WARNING: line length of 84 exceeds 80 columns
> > #136: FILE: drivers/infiniband/core/cma.c:3096:
> > +	route->path_rec->packet_life_time = test_bit(TIMEOUT_SET, &id_priv->flags) ?
> > 
> > 0001-RDMA-cma-Replace-RMW-with-atomic-bit-ops.patch total: 0 errors, 4 warnings, 118 lines checked
> 
> You're running an old checkpatch. Since commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning"), the default line-length is 100. As Linus states in:
> 
> https://lkml.org/lkml/2009/12/17/229
> 
> "... But 80 characters is causing too many idiotic changes."

I'm aware of that thread, but RDMA subsystem continues to use 80 symbols limit.

Thanks

  reply	other threads:[~2021-06-21  9:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 12:59 [PATCH for-next v2] RDMA/cma: Replace RMW with atomic bit-ops Håkon Bugge
2021-06-21  7:10 ` Leon Romanovsky
2021-06-21  8:20   ` Haakon Bugge
2021-06-21  9:54     ` Leon Romanovsky [this message]
2021-06-21 10:46       ` Haakon Bugge
2021-06-21 14:37         ` Jason Gunthorpe
2021-06-21 14:58           ` Haakon Bugge
2021-06-21 15:12             ` Jason Gunthorpe
2021-06-21 15:55               ` Haakon Bugge
2021-06-21 23:31                 ` Jason Gunthorpe
2021-06-22  6:16                 ` Leon Romanovsky
2021-06-22  7:06                   ` Haakon Bugge

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=YNBhuZNjGvUsJHUy@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=haakon.bugge@oracle.com \
    --cc=hans.westgaard.ry@oracle.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox