summaryrefslogtreecommitdiff
path: root/net/smc/smc_clc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2022-07-18 13:19:17 +0300
committerDavid S. Miller <davem@davemloft.net>2022-07-18 13:19:17 +0300
commit3898f52cd4f92a007d71a52edf70aafc7c8ae193 (patch)
tree40244d11e1a4a5762943b1830f96c1c788d0d01a /net/smc/smc_clc.c
parent2acd1022549e210edc4cfc9fc65b07b88751f0d9 (diff)
parentddefb2d205539418f3c3851a3e06fac9624f257d (diff)
downloadlinux-3898f52cd4f92a007d71a52edf70aafc7c8ae193.tar.xz
Merge branch 'net-smc-virt-contig-buffers'
Wen Gu says: ==================== net/smc: Introduce virtually contiguous buffers for SMC-R On long-running enterprise production servers, high-order contiguous memory pages are usually very rare and in most cases we can only get fragmented pages. When replacing TCP with SMC-R in such production scenarios, attempting to allocate high-order physically contiguous sndbufs and RMBs may result in frequent memory compaction, which will cause unexpected hung issue and further stability risks. So this patch set is aimed to allow SMC-R link group to use virtually contiguous sndbufs and RMBs to avoid potential issues mentioned above. Whether to use physically or virtually contiguous buffers can be set by sysctl smcr_buf_type. Note that using virtually contiguous buffers will bring an acceptable performance regression, which can be mainly divided into two parts: 1) regression in data path, which is brought by additional address translation of sndbuf by RNIC in Tx. But in general, translating address through MTT is fast. According to qperf test, this part regression is basically less than 10% in latency and bandwidth. (see patch 5/6 for details) 2) regression in buffer initialization and destruction path, which is brought by additional MR operations of sndbufs. But thanks to link group buffer reuse mechanism, the impact of this kind of regression decreases as times of buffer reuse increases. Patch set overview: - Patch 1/6 and 2/6 mainly about simplifying and optimizing DMA sync operation, which will reduce overhead on the data path, especially when using virtually contiguous buffers; - Patch 3/6 and 4/6 introduce a sysctl smcr_buf_type to set the type of buffers in new created link group; - Patch 5/6 allows SMC-R to use virtually contiguous sndbufs and RMBs, including buffer creation, destruction, MR operation and access; - patch 6/6 extends netlink attribute for buffer type of SMC-R link group; v1->v2: - Patch 5/6 fixes build issue on 32bit; - Patch 3/6 adds description of new sysctl in smc-sysctl.rst; ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_clc.c')
-rw-r--r--net/smc/smc_clc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index f9f3f59c79de..1472f31480d8 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -1034,7 +1034,7 @@ static int smc_clc_send_confirm_accept(struct smc_sock *smc,
ETH_ALEN);
hton24(clc->r0.qpn, link->roce_qp->qp_num);
clc->r0.rmb_rkey =
- htonl(conn->rmb_desc->mr_rx[link->link_idx]->rkey);
+ htonl(conn->rmb_desc->mr[link->link_idx]->rkey);
clc->r0.rmbe_idx = 1; /* for now: 1 RMB = 1 RMBE */
clc->r0.rmbe_alert_token = htonl(conn->alert_token_local);
switch (clc->hdr.type) {
@@ -1046,8 +1046,10 @@ static int smc_clc_send_confirm_accept(struct smc_sock *smc,
break;
}
clc->r0.rmbe_size = conn->rmbe_size_short;
- clc->r0.rmb_dma_addr = cpu_to_be64((u64)sg_dma_address
- (conn->rmb_desc->sgt[link->link_idx].sgl));
+ clc->r0.rmb_dma_addr = conn->rmb_desc->is_vm ?
+ cpu_to_be64((uintptr_t)conn->rmb_desc->cpu_addr) :
+ cpu_to_be64((u64)sg_dma_address
+ (conn->rmb_desc->sgt[link->link_idx].sgl));
hton24(clc->r0.psn, link->psn_initial);
if (version == SMC_V1) {
clc->hdr.length = htons(SMCR_CLC_ACCEPT_CONFIRM_LEN);