net/smc/smc_ism.h
Source file repositories/reference/linux-study-clean/net/smc/smc_ism.h
File Facts
- System
- Linux kernel
- Corpus path
net/smc/smc_ism.h- Extension
.h- Size
- 3365 bytes
- Lines
- 124
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/uio.hlinux/types.hlinux/mutex.hlinux/dibs.hsmc.h
Detected Declarations
struct smcd_dev_liststruct smc_ism_vlanidstruct smc_ism_seidstruct smcd_devfunction smc_ism_writefunction __smc_ism_is_emulatedfunction smc_ism_is_emulatedfunction smc_ism_is_loopbackfunction copy_to_smcdgidfunction copy_to_dibsgid
Annotated Snippet
struct smcd_dev_list { /* List of SMCD devices */
struct list_head list;
struct mutex mutex; /* Protects list of devices */
};
extern struct smcd_dev_list smcd_dev_list; /* list of smcd devices */
struct smc_ism_vlanid { /* VLAN id set on ISM device */
struct list_head list;
unsigned short vlanid; /* Vlan id */
refcount_t refcnt; /* Reference count */
};
struct smc_ism_seid {
u8 seid_string[24];
u8 serial_number[4];
u8 type[4];
};
struct smcd_dev;
int smc_ism_cantalk(struct smcd_gid *peer_gid, unsigned short vlan_id,
struct smcd_dev *dev);
void smc_ism_set_conn(struct smc_connection *conn);
void smc_ism_unset_conn(struct smc_connection *conn);
int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
struct smc_buf_desc *dmb_desc);
void smc_ism_unregister_dmb(struct smcd_dev *dev,
struct smc_buf_desc *dmb_desc);
bool smc_ism_support_dmb_nocopy(struct smcd_dev *smcd);
int smc_ism_attach_dmb(struct smcd_dev *dev, u64 token,
struct smc_buf_desc *dmb_desc);
int smc_ism_detach_dmb(struct smcd_dev *dev, u64 token);
int smc_ism_signal_shutdown(struct smc_link_group *lgr);
void smc_ism_get_system_eid(u8 **eid);
u16 smc_ism_get_chid(struct smcd_dev *dev);
bool smc_ism_is_v2_capable(void);
void smc_ism_set_v2_capable(void);
int smc_ism_init(void);
void smc_ism_exit(void);
int smcd_nl_get_device(struct sk_buff *skb, struct netlink_callback *cb);
static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok,
unsigned int idx, bool sf, unsigned int offset,
void *data, size_t len)
{
int rc;
rc = smcd->dibs->ops->move_data(smcd->dibs, dmb_tok, idx, sf, offset,
data, len);
return rc < 0 ? rc : 0;
}
static inline bool __smc_ism_is_emulated(u16 chid)
{
/* CHIDs in range of 0xFF00 to 0xFFFF are reserved
* for Emulated-ISM device.
*
* loopback-ism: 0xFFFF
* virtio-ism: 0xFF00 ~ 0xFFFE
*/
return ((chid & 0xFF00) == 0xFF00);
}
static inline bool smc_ism_is_emulated(struct smcd_dev *smcd)
{
u16 chid = smcd->dibs->ops->get_fabric_id(smcd->dibs);
return __smc_ism_is_emulated(chid);
}
static inline bool smc_ism_is_loopback(struct dibs_dev *dibs)
{
return (dibs->ops->get_fabric_id(dibs) == DIBS_LOOPBACK_FABRIC);
}
static inline void copy_to_smcdgid(struct smcd_gid *sgid, uuid_t *dibs_gid)
{
__be64 temp;
memcpy(&temp, dibs_gid, sizeof(sgid->gid));
sgid->gid = ntohll(temp);
memcpy(&temp, (uint8_t *)dibs_gid + sizeof(sgid->gid),
sizeof(sgid->gid_ext));
sgid->gid_ext = ntohll(temp);
}
Annotation
- Immediate include surface: `linux/uio.h`, `linux/types.h`, `linux/mutex.h`, `linux/dibs.h`, `smc.h`.
- Detected declarations: `struct smcd_dev_list`, `struct smc_ism_vlanid`, `struct smc_ism_seid`, `struct smcd_dev`, `function smc_ism_write`, `function __smc_ism_is_emulated`, `function smc_ism_is_emulated`, `function smc_ism_is_loopback`, `function copy_to_smcdgid`, `function copy_to_dibsgid`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.