netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Wen Gu <guwen@linux.alibaba.com>,
	kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Cc: wintera@linux.ibm.com, gbayer@linux.ibm.com, pasic@linux.ibm.com,
	alibuda@linux.alibaba.com, tonylu@linux.alibaba.com,
	dust.li@linux.alibaba.com, linux-s390@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 00/18] net/smc: implement virtual ISM extension and loopback-ism
Date: Thu, 05 Oct 2023 10:21:03 +0200	[thread overview]
Message-ID: <dcc46fedda57e7e3ade14685ddb262309544ad7e.camel@linux.ibm.com> (raw)
In-Reply-To: <1695568613-125057-1-git-send-email-guwen@linux.alibaba.com>

On Sun, 2023-09-24 at 23:16 +0800, Wen Gu wrote:
> 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
> 

Hi Wen Gu,

I've been trying out your series with iperf3, qperf, and uperf on
s390x. I'm using network namespaces with a ConnectX VF from the same
card in each namespace for the initial TCP/IP connection i.e. initially
it goes out to a real NIC even if that can switch internally. All of
these look great for streaming workloads both in terms of performance
and stability. With a Connect-Request-Response workload and uperf
however I've run into issues. The test configuration I use is as
follows:

Client Command:

# host=$ip_server ip netns exec client smc_run uperf -m tcp_crr.xml

Server Command:

# ip netns exec server smc_run uperf -s &> /dev/null

Uperf tcp_crr.xml:

<?xml version="1.0"?>
<profile name="TCP_CRR">
        <group nthreads="12">
                <transaction duration="120">
                        <flowop type="connect" options="remotehost=$host protocol=tcp" />
                        <flowop type="write" options="size=200"/>
                        <flowop type="read" options="size=1000"/>
                        <flowop type="disconnect" />
                </transaction>
        </group>
</profile>

The workload first runs fine but then after about 4 GB of data
transferred fails with "Connection refused" and "Connection reset by
peer" errors. The failure is not permanent however and re-running
the streaming workloads run fine again (with both uperf server and
client restarted). So I suspect something gets stuck in either the
client or server sockets. The same workload runs fine with TCP/IP of
course.

Thanks,
Niklas



  parent reply	other threads:[~2023-10-05 15:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2023-10-08  7:19   ` Wen Gu
2023-10-17  3:49     ` Wen Gu
2023-10-18 19:43       ` Wenjia Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dcc46fedda57e7e3ade14685ddb262309544ad7e.camel@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@google.com \
    --cc=gbayer@linux.ibm.com \
    --cc=guwen@linux.alibaba.com \
    --cc=jaka@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.com \
    --cc=wintera@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).