From: Wen Gu <guwen@linux.alibaba.com>
To: Wenjia Zhang <wenjia@linux.ibm.com>,
kgraul@linux.ibm.com, jaka@linux.ibm.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: alibuda@linux.alibaba.com, tonylu@linux.alibaba.com,
linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 05/18] net/smc: reserve CHID range for SMC-D virtual device
Date: Fri, 22 Sep 2023 16:42:05 +0800 [thread overview]
Message-ID: <b7684046-39eb-f0a1-a1ff-12580d8db42e@linux.alibaba.com> (raw)
In-Reply-To: <0a150c58-5fdc-5e8d-1ea6-861406f2c70a@linux.ibm.com>
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@linux.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
prev parent reply other threads:[~2023-09-22 8:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1695302360-46691-1-git-send-email-guwen@linux.alibaba.com>
2023-09-21 23:31 ` [PATCH net-next v3 00/18] net/smc: implement virtual ISM extension and loopback-ism Wenjia Zhang
2023-09-22 12:18 ` Wen Gu
[not found] ` <1695302360-46691-13-git-send-email-guwen@linux.alibaba.com>
2023-09-21 23:31 ` [PATCH net-next v3 12/18] net/smc: implement DMB-related operations of loopback Wenjia Zhang
2023-09-22 7:42 ` Wen Gu
[not found] ` <1695302360-46691-10-git-send-email-guwen@linux.alibaba.com>
2023-09-21 23:32 ` [PATCH net-next v3 09/18] net/smc: introduce SMC-D loopback device Wenjia Zhang
2023-09-22 7:55 ` Wen Gu
[not found] ` <1695302360-46691-7-git-send-email-guwen@linux.alibaba.com>
2023-09-21 23:32 ` [PATCH net-next v3 06/18] net/smc: extend GID to 128bits for virtual ISM device Wenjia Zhang
2023-09-22 12:12 ` Wen Gu
[not found] ` <1695302360-46691-6-git-send-email-guwen@linux.alibaba.com>
2023-09-21 23:32 ` [PATCH net-next v3 05/18] net/smc: reserve CHID range for SMC-D virtual device Wenjia Zhang
2023-09-22 8:42 ` Wen Gu [this message]
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=b7684046-39eb-f0a1-a1ff-12580d8db42e@linux.alibaba.com \
--to=guwen@linux.alibaba.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jaka@linux.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tonylu@linux.alibaba.com \
--cc=wenjia@linux.ibm.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