mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Li Zhijian <lizhijian@fujitsu.com>, linux-rdma@vger.kernel.org
Cc: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org,
	linux-kernel@vger.kernel.org, rpearsonhpe@gmail.com,
	Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
Subject: Re: [PATCH v2 2/2] RDMA/rxe: Call rxe_set_mtu after rxe_register_device
Date: Sat, 16 Sep 2023 10:28:06 +0800	[thread overview]
Message-ID: <a3a0c874-8a92-0018-2593-f18a28545080@linux.dev> (raw)
In-Reply-To: <20230823061141.258864-2-lizhijian@fujitsu.com>

在 2023/8/23 14:11, Li Zhijian 写道:
> rxe_set_mtu() will call rxe_info_dev() to print message, and
> rxe_info_dev() expects dev_name(rxe->ib_dev->dev) has been assigned.
> 
> Previously since dev_name() is not set, when a new rxe link is being
> added, 'null' will be used as the dev_name like:
> 
> "(null): rxe_set_mtu: Set mtu to 1024"
> 
> Move rxe_register_device() earlier to assign the correct dev_name
> so that it can be read by rxe_set_mtu() later.
> 
> And it's safe to do such change since mtu will not be used during the
> rxe_register_device()
> 
> After this change, message becomes:
> "rxe_eth0: rxe_set_mtu: Set mtu to 4096"
> 
> Reviewed-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

In rxe_register_device function, the correct dev_name is assigned.
So the rxe_info_dev in rxe_set_mtu can use the correct dev_name.
I am fine with it.

It seems that it is a trivial problem. If the Fixes tag is added, then 
we can know which commit introduces this problem, it is better.

Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Thanks,
Zhu Yanjun

> ---
>   drivers/infiniband/sw/rxe/rxe.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
> index a086d588e159..8a43c0c4f8d8 100644
> --- a/drivers/infiniband/sw/rxe/rxe.c
> +++ b/drivers/infiniband/sw/rxe/rxe.c
> @@ -169,10 +169,13 @@ void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
>    */
>   int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name)
>   {
> +	int ret;
> +
>   	rxe_init(rxe);
> +	ret = rxe_register_device(rxe, ibdev_name);
>   	rxe_set_mtu(rxe, mtu);
>   
> -	return rxe_register_device(rxe, ibdev_name);
> +	return ret;
>   }
>   
>   static int rxe_newlink(const char *ibdev_name, struct net_device *ndev)


  reply	other threads:[~2023-09-16  2:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  6:11 [PATCH v2 1/2] RDMA/rxe: Improve newline in printing messages Li Zhijian
2023-08-23  6:11 ` [PATCH v2 2/2] RDMA/rxe: Call rxe_set_mtu after rxe_register_device Li Zhijian
2023-09-16  2:28   ` Zhu Yanjun [this message]
2023-08-23  7:07 ` [PATCH v2 1/2] RDMA/rxe: Improve newline in printing messages Daisuke Matsuda (Fujitsu)
2023-08-23  7:16   ` Zhijian Li (Fujitsu)
2023-08-23  7:25     ` Daisuke Matsuda (Fujitsu)
2023-08-23  7:36       ` Zhijian Li (Fujitsu)
2023-08-23  7:43 ` Zhu Yanjun
2023-08-28  8:56   ` John Ogness
2023-08-28 10:15     ` Zhu Yanjun
2023-08-28 10:51       ` John Ogness
2023-08-28 12:15         ` Zhu Yanjun

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=a3a0c874-8a92-0018-2593-f18a28545080@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=matsuda-daisuke@fujitsu.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®