Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1568113imj; Sun, 17 Feb 2019 08:53:23 -0800 (PST) X-Google-Smtp-Source: AHgI3Ias7fvsLuYw1tlG2OVta2JX+fTWh8njCrAr/lxiz3PxxDDrE7CeU4pYn2ReTTbFqRkhMyyh X-Received: by 2002:a65:6654:: with SMTP id z20mr6308021pgv.390.1550422403818; Sun, 17 Feb 2019 08:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550422403; cv=none; d=google.com; s=arc-20160816; b=ageQkfIyvtABUXy9Fd6oFO2krSYdW8RhzhgtwnQ7TljpU54iRuq4kQqjAxByhNRfsU A+fbQryySYZH2XFbITmJkInmJkSxVX2C4aL7eG5x9unFwoth0DaDeXQx3bjq5hP6k4P0 lI4qKpDWyje31wmlw8I87mlNZ8w1/+tH28BaV8a/ofgCotQgrFBeTqY4cHwczYc0ImMo kZ35ETOcUQnGqmvIMgvuwP2ThAQV2q6rQjNpRfcWsiJnEnq2ZMQoifYSTsjhPNqu7sNI bkrFWJ+izYd0/pTNE75HlNI+18wgyggv/11qmOkMI/5difQTYyTD5mNKPc0WxMDC98fM 35pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=SJbT7ufd3FmlzPu6Oxgbsa30XHQohpMofSF2GIXdxWE=; b=tPeRcxJbvYuNpHOxhZMJdrctJNpHtFsF8RKoKhz7OR8AlXZQsA8VsR/LKvL2Rmnki0 31cD0f3DYJ6pbrgW3pF1apl7JLnbKv0EXZuSWqI4g3uv9sJo2i734tSsHrKLNd4kPC1C ePbADP40W1icLXdFO6qy7A6JSj7R85f1hh0E/p7RNuB2V7y8nzL5hZJuPtsv4TnkuQxt cNq7M+TgJzsQ+wV0kAp6NwyIJ7UM1914JRqlCr8IXleT0PLJfZtCYdeFXPQt6x/vD08P OWWwL3C2LXmIxooXdcsKd618X/mgWfAjhurGjnhJMftBK9SkKWDO0rXb4FYKq0pkPOiY LDcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dev-mellanox-co-il.20150623.gappssmtp.com header.s=20150623 header.b=x9RyghVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.co.il Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si1052918pgv.512.2019.02.17.08.53.07; Sun, 17 Feb 2019 08:53:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@dev-mellanox-co-il.20150623.gappssmtp.com header.s=20150623 header.b=x9RyghVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.co.il Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbfBQQvH (ORCPT + 99 others); Sun, 17 Feb 2019 11:51:07 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38694 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbfBQQvH (ORCPT ); Sun, 17 Feb 2019 11:51:07 -0500 Received: by mail-wr1-f65.google.com with SMTP id v13so15623214wrw.5 for ; Sun, 17 Feb 2019 08:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=SJbT7ufd3FmlzPu6Oxgbsa30XHQohpMofSF2GIXdxWE=; b=x9RyghVdPj8vl/k9Pl6ic1HC3OcX3LU1+CWS5Nq4LqQdSSK4BkMN6k0e+2ti31L1l7 YXVX76Gm35wymeBMP8mtC5tGE2CBqutiFnVS2IoQn5JuOC9sIwVpCP436C/jvLCJqLrZ daU+dQuuSA0hagXRlJPfQGqhg6L5mjpRjQXqHfRFRZixl2w8P3U+IwKyBUM1hpO1fysp kgxrXq+iCAc2HuabxWEoz1D45+57xfFobTK8llHznqp++itdOlp8ADcZZ/BCIoKJTL1+ iK8pkL86HE4xEhSpHmmi6YHp0cm2/0M5NRgomZ7ikPs/+onLOByMlic5HA96sv/x5QPw kH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=SJbT7ufd3FmlzPu6Oxgbsa30XHQohpMofSF2GIXdxWE=; b=FhnXF/XStIv425TelcVbH90W5IYcD+LSLJmyA1S7fRAmzXO+f2JckFhMzoCFLIJ8Or +2p9Y19/trs5DiY7CWY6mSmOBYUR87POHKc9WyH7vrUnljcLmG8Q5KtE2cqmJ30PxnZT Fu+4oqcgJ4LKmfFR1yzJ7v8mOwEYkTglbMZ3gYx1vJCa4/4L90+WbA3CiTa5V/t8TN3Y 1gpgF3rOeMhgc6OcJYuaLCZ0OgkprUnuPqL+ElInLyEMjWfmcMW3kd7zsn6vBs6f3zz0 uP+qd1icBunm9+QaTEtwPT1SbYMZKOZeooETJgQfUDEnWehqhug/JxJfN9t2EWeg9wb7 qX7A== X-Gm-Message-State: AHQUAuZav659BjyFna0HovB3Zz1budyDlzWAMJ+uFZmKGAMWvqRU4Mbr sLn2Xlyd/K5zVJfMXTvCXm7gdg== X-Received: by 2002:adf:eb85:: with SMTP id t5mr13241400wrn.157.1550422265083; Sun, 17 Feb 2019 08:51:05 -0800 (PST) Received: from localhost ([5.102.238.15]) by smtp.gmail.com with ESMTPSA id o18sm40428636wrg.40.2019.02.17.08.51.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Feb 2019 08:51:04 -0800 (PST) Date: Sun, 17 Feb 2019 18:51:00 +0200 From: jackm To: =?ISO-8859-1?Q?H=E5kon?= Bugge Cc: Yishai Hadas , Doug Ledford , Jason Gunthorpe , majd@mellanox.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] IB/mlx4: Increase the timeout for CM cache Message-ID: <20190217185100.00002c83@dev.mellanox.co.il> In-Reply-To: <20190217144512.1171546-1-haakon.bugge@oracle.com> References: <20190217144512.1171546-1-haakon.bugge@oracle.com> Organization: Mellanox X-Mailer: Claws Mail 3.15.0 (GTK+ 2.24.31; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 17 Feb 2019 15:45:12 +0100 H=E5kon Bugge wrote: > Using CX-3 virtual functions, either from a bare-metal machine or > pass-through from a VM, MAD packets are proxied through the PF driver. >=20 > Since the VF drivers have separate name spaces for MAD Transaction Ids > (TIDs), the PF driver has to re-map the TIDs and keep the book keeping > in a cache. >=20 > Following the RDMA Connection Manager (CM) protocol, it is clear when > an entry has to evicted form the cache. But life is not perfect, > remote peers may die or be rebooted. Hence, it's a timeout to wipe out > a cache entry, when the PF driver assumes the remote peer has gone. >=20 > During workloads where a high number of QPs are destroyed > concurrently, excessive amount of CM DREQ retries has been observed >=20 > The problem can be demonstrated in a bare-metal environment, where two > nodes have instantiated 8 VFs each. This using dual ported HCAs, so we > have 16 vPorts per physical server. >=20 > 64 processes are associated with each vPort and creates and destroys > one QP for each of the remote 64 processes. That is, 1024 QPs per > vPort, all in all 16K QPs. The QPs are created/destroyed using the > CM. >=20 > When tearing down these 16K QPs, excessive CM DREQ retries (and > duplicates) are observed. With some cat/paste/awk wizardry on the > infiniband_cm sysfs, we observe as sum of the 16 vPorts on one of the > nodes: >=20 > cm_rx_duplicates: > dreq 2102 > cm_rx_msgs: > drep 1989 > dreq 6195 > rep 3968 > req 4224 > rtu 4224 > cm_tx_msgs: > drep 4093 > dreq 27568 > rep 4224 > req 3968 > rtu 3968 > cm_tx_retries: > dreq 23469 >=20 > Note that the active/passive side is equally distributed between the > two nodes. >=20 > Enabling pr_debug in cm.c gives tons of: >=20 > [171778.814239] mlx4_ib_multiplex_cm_handler: id{slave: > 1,sl_cm_id: 0xd393089f} is NULL! >=20 > By increasing the CM_CLEANUP_CACHE_TIMEOUT from 5 to 30 seconds, the > tear-down phase of the application is reduced from approximately 90 to > 50 seconds. Retries/duplicates are also significantly reduced: >=20 > cm_rx_duplicates: > dreq 2460 > [] > cm_tx_retries: > dreq 3010 > req 47 >=20 > Increasing the timeout further didn't help, as these duplicates and > retries stems from a too short CMA timeout, which was 20 (~4 seconds) > on the systems. By increasing the CMA timeout to 22 (~17 seconds), the > numbers fell down to about 10 for both of them. >=20 > Adjustment of the CMA timeout is not part of this commit. >=20 > Signed-off-by: H=E5kon Bugge >=20 > --- >=20 > v1 -> v2: > * Reworded commit message to reflect the new test-setup using > multiple VFs > --- > drivers/infiniband/hw/mlx4/cm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Jack Morgenstein