Message ID | 1702021259-41504-6-git-send-email-guwen@linux.alibaba.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net/smc: implement SMCv2.1 virtual ISM device support | expand |
On 08.12.23 08:40, Wen Gu wrote: > According to virtual ISM support feature defined by SMCv2.1, CHIDs in > the range 0xFF00 to 0xFFFF are reserved for use by virtual ISM devices. > > And two helpers are introduced to distinguish virtual ISM devices from > the existing platform firmware ISM devices. > > Signed-off-by: Wen Gu <guwen@linux.alibaba.com> > --- I've sent you a Reviewed-by for v3 of this patch. Did you lose it?
On 2023/12/11 16:24, Alexandra Winter wrote: > > > On 08.12.23 08:40, Wen Gu wrote: >> According to virtual ISM support feature defined by SMCv2.1, CHIDs in >> the range 0xFF00 to 0xFFFF are reserved for use by virtual ISM devices. >> >> And two helpers are introduced to distinguish virtual ISM devices from >> the existing platform firmware ISM devices. >> >> Signed-off-by: Wen Gu <guwen@linux.alibaba.com> >> --- > > I've sent you a Reviewed-by for v3 of this patch. Did you lose it? Sorry! I missed it when formating the patches. I will add your and Wenjia's Reviewed-by to the unmodified patches, thank you! New version coming soon.
diff --git a/net/smc/smc_ism.h b/net/smc/smc_ism.h index 832b2f4..d1228a6 100644 --- a/net/smc/smc_ism.h +++ b/net/smc/smc_ism.h @@ -15,6 +15,8 @@ #include "smc.h" +#define SMC_VIRTUAL_ISM_CHID_MASK 0xFF00 + struct smcd_dev_list { /* List of SMCD devices */ struct list_head list; struct mutex mutex; /* Protects list of devices */ @@ -56,4 +58,22 @@ static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok, return rc < 0 ? rc : 0; } +static inline bool __smc_ism_is_virtual(u16 chid) +{ + /* CHIDs in range of 0xFF00 to 0xFFFF are reserved + * for virtual ISM device. + * + * loopback-ism: 0xFFFF + * virtio-ism: 0xFF00 ~ 0xFFFE + */ + return ((chid & 0xFF00) == 0xFF00); +} + +static inline bool smc_ism_is_virtual(struct smcd_dev *smcd) +{ + u16 chid = smcd->ops->get_chid(smcd); + + return __smc_ism_is_virtual(chid); +} + #endif
According to virtual ISM support feature defined by SMCv2.1, CHIDs in the range 0xFF00 to 0xFFFF are reserved for use by virtual ISM devices. And two helpers are introduced to distinguish virtual ISM devices from the existing platform firmware ISM devices. Signed-off-by: Wen Gu <guwen@linux.alibaba.com> --- net/smc/smc_ism.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)