Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp50079pxb; Mon, 31 Jan 2022 14:58:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIdhLLfBrZjgvNheMazvK8++kKIrFCQ4tL4PocJ1NWkimtN2gaywni2TlHpj4CMczwm3vY X-Received: by 2002:aa7:da4e:: with SMTP id w14mr1178018eds.442.1643669884999; Mon, 31 Jan 2022 14:58:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643669884; cv=none; d=google.com; s=arc-20160816; b=uzwnAkp4BoHLsUMQ3jZ183+vwjpGjGsaLVDu+LMtzi+eUYxt00oUdD4UgIo8J4+QI3 5NsWQSHp4ue7ZtUeZm/TXK1EacpVxF8jUgGhO/eQfsNmxznnMarrE9qK/QNLjf3OPP29 QyeUUda/vWITzZGlXgsz41tsewaw6/ftn5maFF0yRqv4us2aa37M33aXSXIobbbHUaXj tLWGUPmb34BesDxvX4eXCmIg4THXJAg2IzDbOqnQcTJ9ym3FkFq9Q1y4aCtYk9Gnkj2B mlwATeDKEKG+SPBVMvwcXBQAIFvWv1bkotYU6RZPN/wZaRYqRf9Jzj8goqCgNegrJwPm 7YiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=DApj/eKHC4uqFkcTSiUAoDxc+GXQTKd6xJRlyM4N1U0=; b=EsdG0ElEFZh7j6jDaZLhf2t35yMlzpr3CuO4TfZX0iP/ZeJBTg1qRGx4fI2GgFcVPC fnB3hHlFrhFdQXvaERhbzXkPUs7OXa/9fcTJYGtkPXGCaUcdB0bCiplY1NknXsA+I6M/ oYZ5rtpwZzfLnnV5M/enXt3W6rIhiY/0xAvseTgObLmkHkEA9tHIXt2vcklXcwDoNo8O M4RrFX8OkjdjW/kxvotX49uESWNtHkDfcqI98RhnLQ8RqfTSh/30+/Rs7BkBu4QVs0+g xdpSJFQV9imetawmEuFR5dEpdNwM8L+TTSRdMeW02dd4iZP4OtXOJKmh0bTfPC0iUHtU EnjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di17si8672202ejc.910.2022.01.31.14.57.40; Mon, 31 Jan 2022 14:58:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352319AbiA2Dn2 (ORCPT + 99 others); Fri, 28 Jan 2022 22:43:28 -0500 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:40744 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241747AbiA2Dn0 (ORCPT ); Fri, 28 Jan 2022 22:43:26 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V34uYIR_1643427803; Received: from 30.15.211.55(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0V34uYIR_1643427803) by smtp.aliyun-inc.com(127.0.0.1); Sat, 29 Jan 2022 11:43:24 +0800 Message-ID: Date: Sat, 29 Jan 2022 11:43:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC PATCH net-next] net/smc: Introduce receive queue flow control support Content-Language: en-US To: Stefan Raspl , kgraul@linux.ibm.com Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, davem@davemloft.net References: <20220120065140.5385-1-guangguan.wang@linux.alibaba.com> <1f13f001-e4d7-fdcd-6575-caa1be1526e1@linux.ibm.com> From: Guangguan Wang In-Reply-To: <1f13f001-e4d7-fdcd-6575-caa1be1526e1@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/1/25 17:42, Stefan Raspl wrote: > > That's some truly substantial improvements! > But we need to be careful with protocol-level changes: There are other operating systems like z/OS and AIX which have compatible implementations of SMC, too. Changes like a reduction of connections per link group or usage of reserved fields would need to be coordinated, and likely would have unwanted side-effects even when used with older Linux kernel versions. > Changing the protocol is "expensive" insofar as it requires time to thoroughly discuss the changes, perform compatibility tests, and so on. > So I would like to urge you to investigate alternative ways that do not require protocol-level changes to address this scenario, e.g. by modifying the number of completion queue elements, to see if this could yield similar results. > > Thx! > Yes, there are alternative ways, as RNR caused by the missmatch of send rate and receive rate, which means sending too fast or receiving too slow. What I have done in this patch is to backpressure the sending side when sending too fast. Another solution is to process and refill the receive queue as quickly as posibble, which requires no protocol-level change. The fllowing modifications are needed: - Enqueue cdc msgs to backlog queues instead of processing in rx tasklet. llc msgs remain unchanged. - A mempool is needed as cdc msgs are processed asynchronously. Allocate new receive buffers from mempool when refill receive queue. - Schedule backlog queues to other cpus, which are calculated by 4-tuple or 5-tuple hash of the connections, to process the cdc msgs, in order to reduce the usage of the cpu where rx tasklet runs on. the pseudocode shows below: rx_tasklet if cdc_msgs enqueue to backlog; maybe smp_call_function_single_async is needed to wakeup the corresponding cpu to process backlog; allocate new buffer and modify the sge in rq_wr; else process remains unchanged; endif post_recv rq_wr; end rx_tasklet smp_backlog_process in corresponding cpu, called by smp_call_function_single_async for connections hashed to this cpu for cdc_msgs in backlog process cdc msgs; end cdc_msgs end connections end smp_backlog_process I‘d like to hear your suggestions of this solution. Thank you.