[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b7684046-39eb-f0a1-a1ff-12580d8db42e@linux.alibaba.com>
Date: Fri, 22 Sep 2023 16:42:05 +0800
From: Wen Gu <guwen@...ux.alibaba.com>
To: Wenjia Zhang <wenjia@...ux.ibm.com>, kgraul@...ux.ibm.com,
jaka@...ux.ibm.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com
Cc: alibuda@...ux.alibaba.com, tonylu@...ux.alibaba.com,
linux-s390@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v3 05/18] net/smc: reserve CHID range for SMC-D
virtual device
On 2023/9/22 07:32, Wenjia Zhang wrote:
>
>
> On 21.09.23 15:19, Wen Gu wrote:
>> This patch reserve CHID range from 0xFF00 to 0xFFFF for SMC-D virtual
>> device and introduces helpers to identify them.
>>
>> Signed-off-by: Wen Gu <guwen@...ux.alibaba.com>
>> ---
>> net/smc/smc_ism.h | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/net/smc/smc_ism.h b/net/smc/smc_ism.h
>> index 14d2e77..2ecc8de 100644
>> --- a/net/smc/smc_ism.h
>> +++ b/net/smc/smc_ism.h
>> @@ -15,6 +15,9 @@
>> #include "smc.h"
>> +#define SMC_VIRT_ISM_CHID_MAX 0xFFFF
>> +#define SMC_VIRT_ISM_CHID_MIN 0xFF00
>> +
>> struct smcd_dev_list { /* List of SMCD devices */
>> struct list_head list;
>> struct mutex mutex; /* Protects list of devices */
>> @@ -57,4 +60,16 @@ static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok,
>> return rc < 0 ? rc : 0;
>> }
>> +static inline bool __smc_ism_is_virtdev(u16 chid)
>> +{
>> + return (chid >= SMC_VIRT_ISM_CHID_MIN && chid <= SMC_VIRT_ISM_CHID_MAX);
>> +}
>> +
>> +static inline bool smc_ism_is_virtdev(struct smcd_dev *smcd)
>> +{
>> + u16 chid = smcd->ops->get_chid(smcd);
>> +
>> + return __smc_ism_is_virtdev(chid);
>> +}
>> +
> I'm wondering if barrier is needed here.
I think this helper doesn't involve memory race or multi-threaded/multi-processor
cases that needs enforcing ordering and synchronization of memory operations.
So IMHO barrier is no very necessary here.
Thank you.
>> #endif
Powered by blists - more mailing lists