netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 00/18] net/smc: implement virtual ISM extension and loopback-ism
@ 2023-09-24 15:16 Wen Gu
  2023-09-24 15:16 ` [PATCH net-next v4 01/18] net/smc: decouple ism_dev from SMC-D device dump Wen Gu
                   ` (20 more replies)
  0 siblings, 21 replies; 50+ messages in thread
From: Wen Gu @ 2023-09-24 15:16 UTC (permalink / raw)
  To: kgraul, wenjia, jaka, davem, edumazet, kuba, pabeni
  Cc: wintera, schnelle, gbayer, pasic, alibuda, tonylu, dust.li, guwen,
	linux-s390, netdev, linux-kernel

Hi, all

# Background

SMC-D is now used in IBM z with ISM function to optimize network interconnect
for intra-CPC communications. Inspired by this, we try to make SMC-D available
on the non-s390 architecture through a software-simulated virtual ISM device,
such as loopback-ism device here, to accelerate inter-process or inter-containers
communication within the same OS.

# Design

This patch set includes 4 parts:

 - Patch #1-#3: decouple ISM device hard code from SMC-D stack.
 - Patch #4-#8: implement virtual ISM extension defined in SMCv2.1.
 - Patch #9-#13: implement loopback-ism device.
 - Patch #14-#18: memory copy optimization for the case using loopback.

The loopback-ism device is designed as a kernel device and not be limited to
a specific net namespace, ends of both inter-process connection (1/1' in diagram
below) or inter-container connection (2/2' in diagram below) will find that peer
shares the same loopback-ism device during the CLC handshake. Then loopback-ism
device will be chosen.

 Container 1 (ns1)                              Container 2 (ns2)
 +-----------------------------------------+    +-------------------------+
 | +-------+      +-------+      +-------+ |    |        +-------+        |
 | | App A |      | App B |      | App C | |    |        | App D |<-+     |
 | +-------+      +---^---+      +-------+ |    |        +-------+  |(2') |
 |     |127.0.0.1 (1')|             |192.168.0.11       192.168.0.12|     |
 |  (1)|   +--------+ | +--------+  |(2)   |    | +--------+   +--------+ |
 |     `-->|   lo   |-` |  eth0  |<-`      |    | |   lo   |   |  eth0  | |
 +---------+--|---^-+---+-----|--+---------+    +-+--------+---+-^------+-+
              |   |           |                                  |
 Kernel       |   |           |                                  |
 +----+-------v---+-----------v----------------------------------+---+----+
 |    |                            TCP                               |    |
 |    |                                                              |    |
 |    +--------------------------------------------------------------+    |
 |                                                                        |
 |                           +--------------+                             |
 |                           | smc loopback |                             |
 +---------------------------+--------------+-----------------------------+


loopback-ism device allocs RMBs and sndbufs for each connection peer and 'moves'
data from sndbuf at one end to RMB at the other end. Since communication occurs
within the same kernel, the sndbuf can be mapped to peer RMB so that the data
copy in loopback-ism case can be avoided.

 Container 1 (ns1)                              Container 2 (ns2)
 +-----------------------------------------+    +-------------------------+
 | +-------+      +-------+      +-------+ |    |        +-------+        |
 | | App A |      | App B |      | App C | |    |        | App D |        |
 | +-------+      +--^----+      +-------+ |    |        +---^---+        |
 |       |           |               |     |    |            |            |
 |   (1) |      (1') |           (2) |     |    |       (2') |            |
 |       |           |               |     |    |            |            |
 +-------|-----------|---------------|-----+    +------------|------------+
         |           |               |                       |
 Kernel  |           |               |                       |
 +-------|-----------|---------------|-----------------------|------------+
 | +-----v-+      +-------+      +---v---+               +-------+        |
 | | snd A |-+    | RMB B |<--+  | snd C |-+          +->| RMB D |        |
 | +-------+ |    +-------+   |  +-------+ |          |  +-------+        |
 | +-------+ |    +-------+   |  +-------+ |          |  +-------+        |
 | | RMB A | |    | snd B |   |  | RMB C | |          |  | snd D |        |
 | +-------+ |    +-------+   |  +-------+ |          |  +-------+        |
 |           |               +-------------v+         |                   |
 |           +-------------->| smc loopback |---------+                   |
 +---------------------------+--------------+-----------------------------+

# Benchmark Test

 * Test environments:
      - VM with Intel Xeon Platinum 8 core 2.50GHz, 16 GiB mem.
      - SMC sndbuf/RMB size 1MB.

 * Test object:
      - TCP: run on TCP loopback.
      - domain: run on UNIX domain.
      - SMC lo: run on SMC loopback device.

1. ipc-benchmark (see [1])

 - ./<foo> -c 1000000 -s 100

                            TCP                  SMC-lo
Message
rate (msg/s)              81539                  151251(+85.50%)

2. sockperf

 - serv: <smc_run> taskset -c <cpu> sockperf sr --tcp
 - clnt: <smc_run> taskset -c <cpu> sockperf { tp | pp } --tcp --msg-size={ 64000 for tp | 14 for pp } -i 127.0.0.1 -t 30

                            TCP                  SMC-lo
Bandwidth(MBps)         5313.66                 8270.51(+55.65%)
Latency(us)               5.806                   3.207(-44.76%)

3. nginx/wrk

 - serv: <smc_run> nginx
 - clnt: <smc_run> wrk -t 8 -c 1000 -d 30 http://127.0.0.1:80

                           TCP                   SMC-lo
Requests/s           194641.79                258656.13(+32.89%)

4. redis-benchmark

 - serv: <smc_run> redis-server
 - clnt: <smc_run> redis-benchmark -h 127.0.0.1 -q -t set,get -n 400000 -c 200 -d 1024

                           TCP                   SMC-lo
GET(Requests/s)       85855.34                115640.35(+34.69%)
SET(Requests/s)       86337.15                118203.30(+36.90%)

[1] https://github.com/goldsborough/ipc-bench

v3->v4:
 - Fix build warning of patch#12 about:
   dmb_node->dma_addr = (dma_addr_t)dmb_node->cpu_addr;
 - Replace kzalloc with vzalloc to alloc DMB in loopback-ism, which
   may cause throughput or QPS to drop by 2% to 8%. see:
   https://lore.kernel.org/netdev/d6facfd5-e083-ffc7-05e5-2e8f3ef17735@linux.alibaba.com/
 - Add SMC_LO in Kconfig to turn on/off loopback-ism.
 - Make extension GID cleaner.

v2->v3:
 - Fix build warning of patch#1 and patch#10.

v1->v2:
 - Fix build error on s390 arch.

Wen Gu (18):
  net/smc: decouple ism_dev from SMC-D device dump
  net/smc: decouple ism_dev from SMC-D DMB registration
  net/smc: extract v2 check helper from SMC-D device registration
  net/smc: support SMCv2.x supplemental features negotiation
  net/smc: reserve CHID range for SMC-D virtual device
  net/smc: extend GID to 128bits only for virtual ISM device
  net/smc: disable SEID on non-s390 architecture
  net/smc: enable virtual ISM device feature bit
  net/smc: introduce SMC-D loopback device
  net/smc: implement ID-related operations of loopback
  net/smc: implement some unsupported operations of loopback
  net/smc: implement DMB-related operations of loopback
  net/smc: register loopback device as SMC-Dv2 device
  net/smc: add operation for getting DMB attribute
  net/smc: add operations for DMB attach and detach
  net/smc: avoid data copy from sndbuf to peer RMB in SMC-D
  net/smc: modify cursor update logic when sndbuf mapped to RMB
  net/smc: add interface implementation of loopback device

 drivers/s390/net/ism_drv.c    |  20 +-
 include/net/smc.h             |  32 ++-
 include/uapi/linux/smc.h      |   3 +
 include/uapi/linux/smc_diag.h |   2 +
 net/smc/Kconfig               |  13 ++
 net/smc/Makefile              |   2 +-
 net/smc/af_smc.c              |  88 ++++++--
 net/smc/smc.h                 |   7 +
 net/smc/smc_cdc.c             |  56 ++++-
 net/smc/smc_cdc.h             |   1 +
 net/smc/smc_clc.c             |  64 ++++--
 net/smc/smc_clc.h             |  10 +-
 net/smc/smc_core.c            | 111 +++++++++-
 net/smc/smc_core.h            |   9 +-
 net/smc/smc_diag.c            |  11 +-
 net/smc/smc_ism.c             | 100 ++++++---
 net/smc/smc_ism.h             |  24 ++-
 net/smc/smc_loopback.c        | 489 ++++++++++++++++++++++++++++++++++++++++++
 net/smc/smc_loopback.h        |  54 +++++
 net/smc/smc_pnet.c            |   4 +-
 20 files changed, 996 insertions(+), 104 deletions(-)
 create mode 100644 net/smc/smc_loopback.c
 create mode 100644 net/smc/smc_loopback.h

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2023-10-18 19:43 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-24 15:16 [PATCH net-next v4 00/18] net/smc: implement virtual ISM extension and loopback-ism Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 01/18] net/smc: decouple ism_dev from SMC-D device dump Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 02/18] net/smc: decouple ism_dev from SMC-D DMB registration Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 03/18] net/smc: extract v2 check helper from SMC-D device registration Wen Gu
2023-09-28  3:08   ` Jan Karcher
2023-09-30  8:41     ` Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 04/18] net/smc: support SMCv2.x supplemental features negotiation Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 05/18] net/smc: reserve CHID range for SMC-D virtual device Wen Gu
2023-09-28  3:08   ` Jan Karcher
2023-09-28  9:10     ` Alexandra Winter
2023-10-04  8:27       ` Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 06/18] net/smc: extend GID to 128bits only for virtual ISM device Wen Gu
2023-10-12  7:54   ` Dust Li
2023-10-12 13:24     ` Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 07/18] net/smc: disable SEID on non-s390 architecture Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 08/18] net/smc: enable virtual ISM device feature bit Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 09/18] net/smc: introduce SMC-D loopback device Wen Gu
2023-09-25 11:50   ` Alexandra Winter
2023-09-25 13:29     ` Alexandra Winter
2023-09-25 14:20       ` Wen Gu
2023-09-25 13:57     ` Wen Gu
2023-09-25 15:18     ` Dust Li
2023-09-26  7:24       ` Alexandra Winter
2023-09-28  3:16         ` Jan Karcher
2023-09-28 18:35           ` Wen Gu
2023-09-29 14:08             ` Alexandra Winter
2023-10-04  9:05               ` Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 10/18] net/smc: implement ID-related operations of loopback Wen Gu
2023-10-18 13:24   ` Alexandra Winter
2023-09-24 15:16 ` [PATCH net-next v4 11/18] net/smc: implement some unsupported " Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 12/18] net/smc: implement DMB-related " Wen Gu
2023-09-24 23:29   ` kernel test robot
2023-09-25  1:47     ` Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 13/18] net/smc: register loopback device as SMC-Dv2 device Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 14/18] net/smc: add operation for getting DMB attribute Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 15/18] net/smc: add operations for DMB attach and detach Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 16/18] net/smc: avoid data copy from sndbuf to peer RMB in SMC-D Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 17/18] net/smc: modify cursor update logic when sndbuf mapped to RMB Wen Gu
2023-09-24 15:16 ` [PATCH net-next v4 18/18] net/smc: add interface implementation of loopback device Wen Gu
2023-09-26  7:30 ` [PATCH net-next v4 00/18] net/smc: implement virtual ISM extension and loopback-ism Alexandra Winter
2023-09-27 15:16 ` Alexandra Winter
2023-09-28  8:56   ` Alexandra Winter
2023-09-28 17:29     ` Wen Gu
2023-09-29 13:31       ` Alexandra Winter
2023-10-04  8:42         ` Wen Gu
2023-09-28 16:42   ` Wen Gu
2023-10-05  8:21 ` Niklas Schnelle
2023-10-08  7:19   ` Wen Gu
2023-10-17  3:49     ` Wen Gu
2023-10-18 19:43       ` Wenjia Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).