Skip to contentSkip to conversation

net: implement SMC-R solution

PATCH Superseded Ursula Braun 2 participants 4 messages Sep 11, 2015

Subsystems (5)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover net: implement SMC-R solution

From: Ursula Braun <[email protected]>

Dave,

this is V5 of my SMC-R patches taking care about your V4 comments:
getting rid of tcp_set_keepalive() and enforcing inverse christmas tree ordering for local variables.
Since you are asking for a solution "100% in our own separate module with our own can of worms", we have to give up the transparent detection whether a communication peer can do SMC-R or not (this has been the purpose of the rejected TCP hooks). Instead, we want just the new self-contained SMC-R socket family added to the kernel.
By the way, since August 2015 the SMC-R Informational RFC is no longer a draft, but published as RFC7609.

V5 changes:
1. Do no longer invoke tcp_set_keepalive() to implement setsockopt SO_KEEPALIVE.
2. Enforce inverse christmas tree ordering for all declarations of local function variables.
3. switch back to TCP if IPSEC is needed
4. fix dangling sockets
5. make sure link groups are freed before module unload

V4 changes:
1. Remove tcp patches supporting TCP experimental options
2. Remove references to tcp_sock syn_smc flag in smc-code, since TCP experimental options are not supported by the Linux-tcp.
3. clc_wait_msg() simplified

V3 changes:
1. Avoid adding of new space for smc-related bits in the tcp structures.
2. Make the smc feature to be nearly zero cost using Static Keys / jump labels
3. Increase / decrease smc static key in the smc-code
4. Make sure the next-to-last patch does not break the build
5. Additional pnet table checking

V2 changes:
1. activate tcp changes for CONFIG_AFSMC only (as suggested by Eric Dumazet)
2. add additional hook in net/core/sock.c
3. fix bitfield endianness problem

Thanks,
Ursula

In 2013, IBM introduced an optimized communications solution for the IBM zEnterprise EC12 and BC12 (s390 in Linux terminology) that is comprised of the IBM 10GbE RoCE Express feature with Shared Memory Communications-RDMA (SMC-R) protocol [1].
SMC-R is designed for the enterprise data center environment and is an open protocol as specified in the informational RFC7609 [2]. It has been published in August 2015. Another implementation of this protocol is available since 2013 with IBM z/OS Version 2 Release 1.

SMC-R provides a “sockets over RDMA” solution that leverages industry standard RDMA over Converged Ethernet (RoCE) technology.

IBM has developed a Linux implementation of the SMC-R standard. A new socket protocol family AF_SMC is introduced. A preload library can be used to enable TCP-based applications to use SMC-R without changes.

Key aspects of SMC-R are:
1. Provides optimized performance compared to standard TCP/IP over Ethernet within the data center for both request/response (latency) and streaming workloads (CPU savings) [3].
Initial benchmarks on Linux on x86 processors have shown latency reduction of up to 52% with a throughput gain of 111% using SMC-R vs TCP for request/response message patterns (10 concurrent TCP connections
with 16KB messages) and CPU savings of up to 69% for streaming data
patterns (single TCP connection with 20MB of data in one direction).
[1] is currently updated to contain more detailed information on Linux and performance.
2. In order to preserve the traditional network administrative model the SMC-R protocol ties into the existing IP addresses and uses TCP's handshake to establish connections. This allows existing management tools and security infrastructure to control the creation of SMC connections.
3. The SMC-R protocol logically bonds multiple RoCE adapters together
providing redundancy with transparent fail-over for improved high
availability, increased bandwidth and load balancing across multiple RDMA-capable devices.
Without the rejected TCP Experimental Options the following aspects are restricted; alternate solutions are in discussion.
4. Due to its handshake protocol, SMC-R is compatible with (transparent to) existing TCP connection load balancers that are commonly used in the enterprise data center environment for multi-tier application workloads.
5. SMC-R's handshake protocol allows for transparent fallback to TCP/IP, should one of the peers not be capable of the protocol.

Additional SMC-R overview and reference materials are available [1].

The SMC-R “rendezvous" protocol eliminates the need for RDMA-CM and the exchange occurs through an initial TCP connection. Building on a TCP connection to establish an SMC-R connection solves many key requirements. The rendezvous process occurs now in 1 phase only:
1. TCP/IP 3-way exchange with TCP experimental options is skipped.
2. SMC-R 3-way exchange:
It is assumed both partners indicate SMC-R capability. Then at the completion of the 3-way TCP handshake the SMC-R layers in each peer take control of the TCP connection and exchange their RDMA credentials. If this 3-way exchange completes successfully the connection continues using SMC-R. If the exchange is not successful the connections falls back to standard TCP/IP.

References:
[1] SMC-R Overview and Reference Materials:
http://www-01.ibm.com/software/network/commserver/SMCR/
[2] SMC-R Informational RFC:

    https://tools.ietf.org/rfc/rfc7609
[3] Linux SMC-R Overview and Performance Summary
    (archs x86 and s390):
    http://www-01.ibm.com/software/network/commserver/SMCR/ 

The patch series is prepared to apply to net-next and consists of these parts:
1. net: definitions to establish new socket family
2. net/smc: new socket family

In the future, SMC-R will be enhanced to cover:
- alternate SMC-capability detection
- IPv6 support
- Tracing
- Statistics support

shortlog:

Ursula Braun (2):
net: introduce socket family constants
smc: introduce socket family AF_SMC

Signature · 1 line
2.3.8
#1 lore raw

PATCH v5 1/2 net: introduce socket family constants

From: Ursula Braun <[email protected]>

The new socket family is assigned the next available address / protocol family constant 41.

---
 include/linux/socket.h |  4 +++-
 include/net/smc.h      | 13 +++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 include/net/smc.h
include/linux/socket.h +3 -1
index 5bf59c8..1adcbcc 100644
@@ -200,7 +200,8 @@ struct ucred {
 #define AF_ALG		38	/* Algorithm sockets		*/
 #define AF_NFC		39	/* NFC sockets			*/
 #define AF_VSOCK	40	/* vSockets			*/
-#define AF_MAX		41	/* For now.. */
+#define AF_SMC		41	/* smc sockets			*/
+#define AF_MAX		42	/* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC	AF_UNSPEC
@@ -246,6 +247,7 @@ struct ucred {
 #define PF_ALG		AF_ALG
 #define PF_NFC		AF_NFC
 #define PF_VSOCK	AF_VSOCK
+#define PF_SMC		AF_SMC
 #define PF_MAX		AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
include/net/smc.h new file +13 -0
new file mode 100644
index 0000000..cd513ee
@@ -0,0 +1,13 @@
+/*
+ * SMC		Definitions for the SMC protocol.
+ *
+ * Author:	Ursula Braun <[email protected]>
+ */
+#ifndef _SMC_H
+#define _SMC_H
+
+/* SMC socket options - disjunct with TCP socket options */
+#define SMC_KEEPALIVE		99	/* start/stop keepalives */
+
+#endif /* _SMC_H */
+
Signature · 1 line
2.3.8
maintainer
#2 lore raw

Re: [PATCH V5 net-next 1/2] net: introduce socket family constants

From: Ursula Braun <[email protected]>
Date: Fri, 11 Sep 2015 14:09:09 +0200

Quoted 4 lines
include/net/smc.h new file +3 -0
@@ -0,0 +1,13 @@
+/*
+ * SMC		Definitions for the SMC protocol.
+ *

include/net/smc.h line 13

Quoted 10 lines
include/net/smc.h new file +10 -0
+ * Author:	Ursula Braun <[email protected]>
+ */
+#ifndef _SMC_H
+#define _SMC_H
+
+/* SMC socket options - disjunct with TCP socket options */
+#define SMC_KEEPALIVE		99	/* start/stop keepalives */
+
+#endif /* _SMC_H */
+

Trailing empty lines in files always generate warnings when such patches are attempted to be applied by GIT.

#3 lore raw

PATCH v5 2/2 smc: introduce socket family AF_SMC

In reply to Ursula Braun

From: Ursula Braun <[email protected]>

In 2013, IBM introduced an optimized communications solution for the IBM zEnterprise EC12 and BC12 (s390 in Linux terminology) that is comprised of the IBM 10GbE RoCE Express feature with Shared Memory Communications-RDMA (SMC-R) protocol [1].
SMC-R is designed for the enterprise data center environment and is an open protocol as specified in the informational RFC7609 [2]. It has been published in August 2015. Another implementation of this protocol is available since 2013 with IBM z/OS Version 2 Release 1.

SMC-R provides a “sockets over RDMA” solution that leverages industry standard RDMA over Converged Ethernet (RoCE) technology.

IBM has developed a Linux implementation of the SMC-R standard. A new socket protocol family AF_SMC is introduced. A preload library can be used to enable TCP-based applications to use SMC-R without changes.

Key aspects of SMC-R are:
1. Provides optimized performance compared to standard TCP/IP over Ethernet within the data center for both request/response (latency) and streaming workloads (CPU savings) [3].
2. In order to preserve the traditional network administrative model the SMC-R protocol ties into the existing IP addresses and uses TCP's handshake to establish connections. This allows existing management tools and security infrastructure to control the creation of SMC connections.
3. The SMC-R protocol logically bonds multiple RoCE adapters together providing redundancy with transparent fail-over for improved high availability, increased bandwidth and load balancing across multiple RDMA-capable devices.
4. Due to its handshake protocol, SMC-R is compatible with (transparent to) existing TCP connection load balancers that are commonly used in the enterprise data center environment for multi-tier application workloads.
5. SMC-R's handshake protocol allows for transparent fallback to TCP/IP, should one of the peers not be capable of the protocol.

Additional SMC-R overview and reference materials are available [1].

The SMC-R “rendezvous" protocol eliminates the need for RDMA-CM and the exchange occurs through an initial TCP connection. Building on a TCP connection to establish an SMC-R connection solves many key requirements. The rendezvous process occurs now in 1 phase only:
1. TCP/IP 3-way exchange with TCP experimental options is skipped.
2. SMC-R 3-way exchange:
It is assumed both partners indicate SMC-R capability. Then at the completion of the 3-way TCP handshake the SMC-R layers in each peer take control of the TCP connection and exchange their RDMA credentials. If this 3-way exchange completes successfully the connection continues using SMC-R. If the exchange is not successful the connections falls back to standard TCP/IP.

A connection using SMC-R starts out setting up a connection using the TCP/IP protocol [2]. Thus an internal smc-managed TCP socket is established, whose traffic flows across an interface belonging to the same Converged Ethernet fabric, defined by a so-called "pnet table" [1].

Since SMC-R negotiation during TCP handshake is no longer possible, it is assumed both parties are SMC-R capable. The TCP/IP connection is used to exchange the necessary connection data for setup of RoCE RC-QP connection in the so-called "rendezvous handshake".

The code implements also the link management of the SMC-R protocol forming link groups for each remote host and provides for
- dynamic addition of further RoCE Host Channel Adapters (HCAs) to form a so-called link group
- seamless failover, moving existing connections from a failed HCA to the remaining HCAs in a link group
- load balancing of connections across the links in a link group

SMC-R design defines memory areas for data transport through RDMA called RDMA Memory Buffer (RMB) which are split up into several RMB Elements (RMBEs) assigned to single connections. This initial Linux implementation requires real contiguous storage for these RMBs and uses a separate RMB with just 1 RMBE for every connection. Its size is derived from:
- a system wide default minimum SMC receive buffer size (tailorable by /proc/net/smc/rcvbuf
- if given, the socket specific SETSOCKOPT SO_RCVBUF configuration
- the size of the tcp socket receive buffer determined from the system wide tcp socket receive buffer configuration
- the amount of available contiguous storage
In the Linux implementation, an equivalent concept exists for the socket send buffers [1].

In the future, SMC-R will be enhanced to cover:
- alternate SMC-capability detection
- IPv6 support
- Tracing
- Statistic hooks

References:
[1] SMC-R Overview and Reference Materials:
http://www-01.ibm.com/software/network/commserver/SMCR/
[2] SMC-R Informational RFC:

    https://tools.ietf.org/rfc/rfc7609
[3] Linux SMC-R Overview and Performance Summary
    (archs x86 and s390):
    http://www-01.ibm.com/software/network/commserver/SMCR/

<patch subject - no prefix>

<patch description>

Reference-ID:

---
 net/Kconfig        |    1 +
 net/Makefile       |    1 +
 net/smc/Kconfig    |    9 +
 net/smc/Makefile   |    3 +
 net/smc/af_smc.c   | 3173 ++++++++++++++++++++++++++++++++++++++++++++++++++
 net/smc/af_smc.h   |  707 +++++++++++
 net/smc/smc_core.c | 3295 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 net/smc/smc_llc.c  | 1594 +++++++++++++++++++++++++
 net/smc/smc_llc.h  |  192 +++
 net/smc/smc_proc.c |  955 +++++++++++++++
 10 files changed, 9930 insertions(+)
 create mode 100644 net/smc/Kconfig
 create mode 100644 net/smc/Makefile
 create mode 100644 net/smc/af_smc.c
 create mode 100644 net/smc/af_smc.h
 create mode 100644 net/smc/smc_core.c
 create mode 100644 net/smc/smc_llc.c
 create mode 100644 net/smc/smc_llc.h
 create mode 100644 net/smc/smc_proc.c
net/Kconfig +1 -0
index 7021c1b..57435aa 100644
@@ -54,6 +54,7 @@ source "net/packet/Kconfig"
 source "net/unix/Kconfig"
 source "net/xfrm/Kconfig"
 source "net/iucv/Kconfig"
+source "net/smc/Kconfig"
 
 config INET
 	bool "TCP/IP networking"
net/Makefile +1 -0
index 3995613..33a5f54 100644
@@ -49,6 +49,7 @@ obj-$(CONFIG_MAC80211)		+= mac80211/
 obj-$(CONFIG_TIPC)		+= tipc/
 obj-$(CONFIG_NETLABEL)		+= netlabel/
 obj-$(CONFIG_IUCV)		+= iucv/
+obj-$(CONFIG_AFSMC)		+= smc/
 obj-$(CONFIG_RFKILL)		+= rfkill/
 obj-$(CONFIG_NET_9P)		+= 9p/
 obj-$(CONFIG_CAIF)		+= caif/
net/smc/Kconfig new file +9 -0
new file mode 100644
index 0000000..4ae42d5
@@ -0,0 +1,9 @@
+config AFSMC
+	tristate "AF_SMC socket address family"
+	depends on INET && INFINIBAND
+	---help---
+	  SMC_R provides a "sockets over RDMA" solution making use of
+	  RDMA over Converged Ethernet (ROCE) technology.
+	  Socket family AF_SMC implements this solution for Linux.
+
+	  Select this option if you want to run AF_SMC socket applications
net/smc/Makefile new file +3 -0
new file mode 100644
index 0000000..76017f0
@@ -0,0 +1,3 @@
+ccflags-y += -I$(src)
+smc-y := af_smc.o smc_core.o smc_proc.o smc_llc.o
+obj-$(CONFIG_AFSMC)	+= smc.o
net/smc/af_smc.c new file +3173 -0

2,974 lines not on this page · raw message

net/smc/af_smc.h new file +707 -0

707 lines not on this page · raw message

net/smc/smc_core.c new file +3295 -0

3,295 lines not on this page · raw message

net/smc/smc_llc.c new file +1594 -0

1,594 lines not on this page · raw message

net/smc/smc_llc.h new file +192 -0

192 lines not on this page · raw message

net/smc/smc_proc.c new file +955 -0

955 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.3.8

Part of the diff is not shown here. View the raw message.