public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@nvidia.com>
To: Mark Zhang <markzhang@nvidia.com>
Cc: <jgg@nvidia.com>, <dledford@redhat.com>,
	<jiapeng.chong@linux.alibaba.com>, <cgel.zte@gmail.com>,
	<linux-rdma@vger.kernel.org>
Subject: Re: [PATCH rdma-next 2/3] IB/cm: remove cm_id_priv->id.service_mask and service_mask parameter of cm_init_listen()
Date: Sun, 21 Aug 2022 16:47:44 +0300	[thread overview]
Message-ID: <YwI3gG23YhD2zg0k@unreal> (raw)
In-Reply-To: <8863ab45-8b9f-3f1b-32c7-2c8f7e06b8ea@nvidia.com>

On Sun, Aug 21, 2022 at 08:50:08PM +0800, Mark Zhang wrote:
> On 8/21/2022 7:34 PM, Leon Romanovsky wrote:
> > On Fri, Aug 19, 2022 at 12:08:58PM +0300, Mark Zhang wrote:
> > > The service_mask is always ~cpu_to_be64(0), so the result is always
> > > a NOP when it is &'d with a service_id. Remove it for simplicity.
> > > 
> > > Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> > > ---
> > >   drivers/infiniband/core/cm.c | 28 ++++++++--------------------
> > >   include/rdma/ib_cm.h         |  1 -
> > >   2 files changed, 8 insertions(+), 21 deletions(-)

<...>

> > > -	if (service_id == IB_CM_ASSIGN_SERVICE_ID) {
> > > +	if (service_id == IB_CM_ASSIGN_SERVICE_ID)
> > >   		cm_id_priv->id.service_id = cpu_to_be64(cm.listen_service_id++);
> > > -		cm_id_priv->id.service_mask = ~cpu_to_be64(0);
> > > -	} else {
> > > +	else
> > >   		cm_id_priv->id.service_id = service_id;
> > > -		cm_id_priv->id.service_mask = service_mask;
> > > -	}
> > 
> > If service_id != IB_CM_ASSIGN_SERVICE_ID, we had zero as service_mask
> > and not FFF... like you wrote. It puts in question all
> > cm_id_priv->id.service_mask & service_id => service_id conversions in
> > this patch.
> 
> The id.service_mask field is removed in this patch, check the change in
> include/rdma/ib_cm.h

Right, you removed service_mask and described it "is always ~cpu_to_be64(0)".
As far as I can tell, this is not true and in this "if (service_id == IB_CM_ASSIGN_SERVICE_ID)"
sometimes we set cm_id_priv->id.service_mask to be 0 and sometimes 0xFF....

Why is it correct to remove cm_id_priv->id.service_mask in this hunk?

Thanks

  reply	other threads:[~2022-08-21 13:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  9:08 [PATCH rdma-next 0/3] IB/cm refactors Mark Zhang
2022-08-19  9:08 ` [PATCH rdma-next 1/3] IB/cm: Remove the service_mask parameter from ib_cm_listen() Mark Zhang
2022-08-19  9:08 ` [PATCH rdma-next 2/3] IB/cm: remove cm_id_priv->id.service_mask and service_mask parameter of cm_init_listen() Mark Zhang
2022-08-21 11:34   ` Leon Romanovsky
2022-08-21 12:50     ` Mark Zhang
2022-08-21 13:47       ` Leon Romanovsky [this message]
2022-08-21 14:08         ` Mark Zhang
2022-08-21 14:14           ` Leon Romanovsky
2022-08-19  9:08 ` [PATCH rdma-next 3/3] IB/cm: Refactor cm_insert_listen() and cm_find_listen() Mark Zhang
2022-08-29  8:21 ` [PATCH rdma-next 0/3] IB/cm refactors Leon Romanovsky

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=YwI3gG23YhD2zg0k@unreal \
    --to=leonro@nvidia.com \
    --cc=cgel.zte@gmail.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=markzhang@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox