type RdmaLinkAttrs … type RdmaLink … func getProtoField(clientType int, op int) int { … } func uint64ToGuidString(guid uint64) string { … } func executeOneGetRdmaLink(data []byte) (*RdmaLink, error) { … } func execRdmaSetLink(req *nl.NetlinkRequest) error { … } // RdmaLinkList gets a list of RDMA link devices. // Equivalent to: `rdma dev show` func RdmaLinkList() ([]*RdmaLink, error) { … } // RdmaLinkList gets a list of RDMA link devices. // Equivalent to: `rdma dev show` func (h *Handle) RdmaLinkList() ([]*RdmaLink, error) { … } // RdmaLinkByName finds a link by name and returns a pointer to the object if // found and nil error, otherwise returns error code. func RdmaLinkByName(name string) (*RdmaLink, error) { … } // RdmaLinkByName finds a link by name and returns a pointer to the object if // found and nil error, otherwise returns error code. func (h *Handle) RdmaLinkByName(name string) (*RdmaLink, error) { … } // RdmaLinkSetName sets the name of the rdma link device. Return nil on success // or error otherwise. // Equivalent to: `rdma dev set $old_devname name $name` func RdmaLinkSetName(link *RdmaLink, name string) error { … } // RdmaLinkSetName sets the name of the rdma link device. Return nil on success // or error otherwise. // Equivalent to: `rdma dev set $old_devname name $name` func (h *Handle) RdmaLinkSetName(link *RdmaLink, name string) error { … } func netnsModeToString(mode uint8) string { … } func executeOneGetRdmaNetnsMode(data []byte) (string, error) { … } // RdmaSystemGetNetnsMode gets the net namespace mode for RDMA subsystem // Returns mode string and error status as nil on success or returns error // otherwise. // Equivalent to: `rdma system show netns' func RdmaSystemGetNetnsMode() (string, error) { … } // RdmaSystemGetNetnsMode gets the net namespace mode for RDMA subsystem // Returns mode string and error status as nil on success or returns error // otherwise. // Equivalent to: `rdma system show netns' func (h *Handle) RdmaSystemGetNetnsMode() (string, error) { … } func netnsModeStringToUint8(mode string) (uint8, error) { … } // RdmaSystemSetNetnsMode sets the net namespace mode for RDMA subsystem // Returns nil on success or appropriate error code. // Equivalent to: `rdma system set netns { shared | exclusive }' func RdmaSystemSetNetnsMode(NewMode string) error { … } // RdmaSystemSetNetnsMode sets the net namespace mode for RDMA subsystem // Returns nil on success or appropriate error code. // Equivalent to: `rdma system set netns { shared | exclusive }' func (h *Handle) RdmaSystemSetNetnsMode(NewMode string) error { … } // RdmaLinkSetNsFd puts the RDMA device into a new network namespace. The // fd must be an open file descriptor to a network namespace. // Similar to: `rdma dev set $dev netns $ns` func RdmaLinkSetNsFd(link *RdmaLink, fd uint32) error { … } // RdmaLinkSetNsFd puts the RDMA device into a new network namespace. The // fd must be an open file descriptor to a network namespace. // Similar to: `rdma dev set $dev netns $ns` func (h *Handle) RdmaLinkSetNsFd(link *RdmaLink, fd uint32) error { … } // RdmaLinkDel deletes an rdma link // // Similar to: rdma link delete NAME // REF: https://man7.org/linux/man-pages/man8/rdma-link.8.html func RdmaLinkDel(name string) error { … } // RdmaLinkDel deletes an rdma link. func (h *Handle) RdmaLinkDel(name string) error { … } // RdmaLinkAdd adds an rdma link for the specified type to the network device. // Similar to: rdma link add NAME type TYPE netdev NETDEV // NAME - specifies the new name of the rdma link to add // TYPE - specifies which rdma type to use. Link types: // rxe - Soft RoCE driver // siw - Soft iWARP driver // NETDEV - specifies the network device to which the link is bound // // REF: https://man7.org/linux/man-pages/man8/rdma-link.8.html func RdmaLinkAdd(linkName, linkType, netdev string) error { … } // RdmaLinkAdd adds an rdma link for the specified type to the network device. func (h *Handle) RdmaLinkAdd(linkName string, linkType string, netdev string) error { … }