From: Leon Romanovsky <leon@kernel.org>
To: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Cc: kgraul@linux.ibm.com, davem@davemloft.net, kuba@kernel.org,
linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH net-next] net/smc: Introduce receive queue flow control support
Date: Thu, 20 Jan 2022 10:24:57 +0200 [thread overview]
Message-ID: <YekcWYwg399vR18R@unreal> (raw)
In-Reply-To: <20220120065140.5385-1-guangguan.wang@linux.alibaba.com>
On Thu, Jan 20, 2022 at 02:51:40PM +0800, Guangguan Wang wrote:
> This implement rq flow control in smc-r link layer. QPs
> communicating without rq flow control, in the previous
> version, may result in RNR (reveive not ready) error, which
> means when sq sends a message to the remote qp, but the
> remote qp's rq has no valid rq entities to receive the message.
> In RNR condition, the rdma transport layer may retransmit
> the messages again and again until the rq has any entities,
> which may lower the performance, especially in heavy traffic.
> Using credits to do rq flow control can avoid the occurrence
> of RNR.
>
> Test environment:
> - CPU Intel Xeon Platinum 8 core, mem 32 GiB, nic Mellanox CX4.
> - redis benchmark 6.2.3 and redis server 6.2.3.
> - redis server: redis-server --save "" --appendonly no
> --protected-mode no --io-threads 7 --io-threads-do-reads yes
> - redis client: redis-benchmark -h 192.168.26.36 -q -t set,get
> -P 1 --threads 7 -n 2000000 -c 200 -d 10
>
> Before:
> SET: 205229.23 requests per second, p50=0.799 msec
> GET: 212278.16 requests per second, p50=0.751 msec
>
> After:
> SET: 623674.69 requests per second, p50=0.303 msec
> GET: 688326.00 requests per second, p50=0.271 msec
>
> The test of redis-benchmark shows that more than 3X rps
> improvement after the implementation of rq flow control.
>
> Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
> ---
> net/smc/af_smc.c | 12 ++++++
> net/smc/smc_cdc.c | 10 ++++-
> net/smc/smc_cdc.h | 3 +-
> net/smc/smc_clc.c | 3 ++
> net/smc/smc_clc.h | 3 +-
> net/smc/smc_core.h | 17 ++++++++-
> net/smc/smc_ib.c | 6 ++-
> net/smc/smc_llc.c | 92 +++++++++++++++++++++++++++++++++++++++++++++-
> net/smc/smc_llc.h | 5 +++
> net/smc/smc_wr.c | 30 ++++++++++++---
> net/smc/smc_wr.h | 54 ++++++++++++++++++++++++++-
> 11 files changed, 222 insertions(+), 13 deletions(-)
<...>
> + // set peer rq credits watermark, if less than init_credits * 2/3,
> + // then credit announcement is needed.
<...>
> + // set peer rq credits watermark, if less than init_credits * 2/3,
> + // then credit announcement is needed.
<...>
> + // credits have already been announced to peer
<...>
> + // set local rq credits high watermark to lnk->wr_rx_cnt / 3,
> + // if local rq credits more than high watermark, announcement is needed.
<...>
> +// get one tx credit, and peer rq credits dec
<...>
> +// put tx credits, when some failures occurred after tx credits got
> +// or receive announce credits msgs
> +static inline void smc_wr_tx_put_credits(struct smc_link *link, int credits, bool wakeup)
<...>
> +// to check whether peer rq credits is lower than watermark.
> +static inline int smc_wr_tx_credits_need_announce(struct smc_link *link)
<...>
> +// get local rq credits and set credits to zero.
> +// may called when announcing credits
> +static inline int smc_wr_rx_get_credits(struct smc_link *link)
Please try to use C-style comments.
Thanks
next prev parent reply other threads:[~2022-01-20 8:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 6:51 [RFC PATCH net-next] net/smc: Introduce receive queue flow control support Guangguan Wang
2022-01-20 8:24 ` Leon Romanovsky [this message]
2022-01-20 9:20 ` Guangguan Wang
2022-01-20 9:51 ` dust.li
2022-01-21 16:21 ` Guangguan Wang
2022-01-20 11:03 ` Karsten Graul
2022-01-21 16:36 ` Guangguan Wang
2022-01-20 14:22 ` Tony Lu
2022-01-21 16:48 ` Guangguan Wang
2022-01-25 9:42 ` Stefan Raspl
2022-01-29 3:43 ` Guangguan Wang
2022-01-29 4:24 ` Tony Lu
2022-01-31 12:56 ` Karsten Graul
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=YekcWYwg399vR18R@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=guangguan.wang@linux.alibaba.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 \
/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).