AF_SMC(7)
π AF_SMC π
okay bestie, gather round, because this one is a whole address family and she is iconic. this is from the Linux Programmer's Manual, and it's all about Sockets for SMC communication. no cap. π¦
β¨ NAME β¨
AF_SMC β Sockets for SMC communication π
πΈ SYNOPSIS πΈ
#include <sys/socket.h>
#define AF_SMC 43
#define SMCPROTO_SMC 0
#define SMCPROTO_SMC6 1
tcp_sockfd = socket(AF_SMC, SOCK_STREAM, SMCPROTO_SMC);
tcp_sockfd = socket(AF_SMC, SOCK_STREAM, SMCPROTO_SMC6);
see how it's literally just socket()? your TCP app doesn't even have to know. she's giving effortless. π
π DESCRIPTION π
so, Shared Memory Communication via RDMA (SMC) β say that five times fast, or don't, I'm not your mom β is a socket that rides on top of the RDMA communication protocol. the whole point? your existing TCP socket applications get to transparently benefit from RDMA when they're exchanging data over an RDMA over Converged Ethernet (RoCE) network. π«Ά
β οΈ heads up bestie: those networks are not routable. periodt.
SMC gives you host-to-host direct memory access without all that traditional TCP/IP processing overhead. she also offers preservation of existing IP topology and IP security, and introduces minimal administrative and operational changes. and the exploitation of SMC? completely transparent to TCP socket applications. they don't even notice. main character energy but in the background. β¨
the new address family AF_SMC supports the SMC protocol on Linux. it keeps the address format of AF_INET and AF_INET6 sockets and supports streaming socket types only. that's it. that's the whole vibe. π
π¦ Usage modes π¦
two usage modes are possible, and yes you have to pick:
- AF_SMC native usage β uses the socket domain
AF_SMCinstead ofAF_INETandAF_INET6. specifySMCPROTO_SMCforAF_INETcompatible socket semantics, andSMC_PROTO_SMC6forAF_INET6respectively. - Usage of AF_INET socket applications with SMC preload library β converts
AF_INETandAF_INET6sockets toAF_SMCsockets. the SMC preload library is part of the SMC tools package.
SMC socket capabilities are negotiated at connection setup. and if one peer is not SMC capable? further socket processing falls back to TCP usage automatically. she's polite like that. π
π₯ Implementation details: Links and Link Groups π₯
to run RDMA traffic to a peer, a so-called link is established between a local RoCE card and a remote RoCE card. and because we love redundancy in this house, to enhance availability you can configure alternate links with automatic fail over. primary and backup links to a certain peer get combined in a so-called link group. it's giving squad goals. π
π RoCE adapter mapping: Creation of a pnet table π
the SMC protocol requires grouping of multiple physical networks β standard Ethernet and RoCE networks. such groups are called Physical Networks (PNets). for SMC, RoCE adapter mapping is configured within a table called a pnet table.
any available Ethernet interface can be combined with available RDMA-capable network interface cards (RNICs), if they belong to the same Converged Ethernet fabric. to configure RoCE Adapter mapping, you must create a pnet table. modify the table with the smc-tools command smc_pnet. π§
for details see smc_pnet(8).
π Displaying SMC socket state information π
SMC socket state information can be obtained with the smc-tools command smcss. for details see smcss(8). go peek, she tells you everything. π
β Starting a TCP application to work with SMC β
to use an existing TCP application to work with SMC, use the SMC preload library. the SMC Tools package provides the command smc_run to convert AF_INET and AF_INET6 socket calls to AF_SMC socket calls by means of the preload technique. for more information about the preload mechanism, see also ld.so(8).
Example:
smc_run ftp
this command-line example starts an FTP client over SMC. look at her go. π₯
π MTU and Infiniband data transfer π
Infiniband traffic may use MTU values 256, 512, 1024, 2048, or 4096. SMC determines the configured MTU size of the RoCE Ethernet port, announces this MTU size to the peer during connection start, and chooses the minimum MTU size of both peers. so basically she asks, and then takes the smaller one, because that's what works. no drama. π
π SEE ALSO π
socket(2), ip(7), tcp(7), socket(7), smc_chk(8) smc_run(8), smcss(8), smc_pnet(8)
π HISTORY π
AF_SMC, version 1.0.0
- Initial version.
and that's the whole page bestie, slay π β¨
this one comes to you from smc-tools, dated January 2017, and it lives at AF_SMC(7) in the manual. iykyk π¦ππ
π¦ where this page comes from
- centos-stream 10: smc-tools 1.8.8-1.el10 Β· EPL-1.0
- centos-stream 9: smc-tools 1.8.8-1.el9 Β· EPL-1.0
- centos-stream 9: smc-tools 1.8.8-1.el9 Β· EPL-1.0
- fedora 43: smc-tools 1.8.5-2.fc43 Β· EPL-1.0
- fedora 43: smc-tools 1.8.5-2.fc43 Β· EPL-1.0
- fedora 44: smc-tools 1.8.6-2.fc44 Β· EPL-1.0
- fedora 44: smc-tools 1.8.6-2.fc44 Β· EPL-1.0
- opensuse-leap 16.0: smc-tools 1.8.8-160000.1.1 Β· EPL-1.0
- opensuse-leap 16.0: smc-tools 1.8.8-160000.1.1 Β· EPL-1.0
- opensuse-leap 16.0: smc-tools 1.8.8-160000.1.1 Β· EPL-1.0
- opensuse-leap 16.0: smc-tools 1.8.8-160000.1.1 Β· EPL-1.0
- ubuntu jammy: smc-tools 1.7.0-0ubuntu1 Β· EPL-1.0
- ubuntu jammy: smc-tools 1.7.0-0ubuntu1.2 Β· EPL-1.0
- ubuntu noble: smc-tools 1.8.3-0ubuntu1 Β· EPL-1.0
- ubuntu noble: smc-tools 1.8.3-0ubuntu1.1 Β· EPL-1.0
- ubuntu questing: smc-tools 1.8.5-0ubuntu1
- ubuntu resolute: smc-tools 1.8.7-0ubuntu1 Β· EPL-1.0
- ubuntu stonking: smc-tools 1.8.8-0ubuntu1 Β· EPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms