lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4dce179f-f808-0a18-7e9e-9877964d67e4@fujitsu.com>
Date:   Tue, 19 Sep 2023 00:57:46 +0000
From:   "Zhijian Li (Fujitsu)" <lizhijian@...itsu.com>
To:     Leon Romanovsky <leon@...nel.org>
CC:     "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "zyjzyj2000@...il.com" <zyjzyj2000@...il.com>,
        "jgg@...pe.ca" <jgg@...pe.ca>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "rpearsonhpe@...il.com" <rpearsonhpe@...il.com>,
        "Daisuke Matsuda (Fujitsu)" <matsuda-daisuke@...itsu.com>,
        Zhu Yanjun <yanjun.zhu@...ux.dev>
Subject: Re: [PATCH for-next v3 2/2] RDMA/rxe: Call rxe_set_mtu after
 rxe_register_device



On 18/09/2023 20:37, Leon Romanovsky wrote:
> On Mon, Sep 18, 2023 at 10:05:43AM +0800, Li Zhijian wrote:
>> 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.
> 
> I would expect removal of that print line instead of moving
> rxe_register_device().


I also struggled with this point. The last option is keep it as it is.
Once rxe is registered, this print will work fine.

Thanks
Zhijian


> 
> Thanks
> 
>>
>> And it's safe to do such change since mtu will not be used during the
>> rxe_register_device()
>>
>> After this change, the message becomes:
>> "rxe_eth0: rxe_set_mtu: Set mtu to 4096"
>>
>> Fixes: 9ac01f434a1e ("RDMA/rxe: Extend dbg log messages to err and info")
>> Reviewed-by: Daisuke Matsuda <matsuda-daisuke@...itsu.com>
>> Reviewed-by: Zhu Yanjun <yanjun.zhu@...ux.dev>
>> Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
>> ---
>>   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)
>> -- 
>> 2.29.2
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ