Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3153973imm; Tue, 29 May 2018 01:55:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoFOl+H6G/uTn2viqzINLR/ktvftcwRYvIHG+IN36ywbwwsdBJf/OGrU/Hngguro6V1V72b X-Received: by 2002:a17:902:a702:: with SMTP id w2-v6mr16567603plq.8.1527584148348; Tue, 29 May 2018 01:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527584148; cv=none; d=google.com; s=arc-20160816; b=cjqZQcM4iSb8f/kH7AJUGcb1qxKDJI5n+z1qYlkCX9UMGxOhN0SYwd3UL3zGMF0+ke wBprgYwTnFUyYxqPOw4B7vcOihuNYDrJfbwWDRtzWSmq2xhmBV4vsARP8UczWYyMubgj s3MZ7HvzgwB7JQKKJkUWqP3T9wImJFf+UciWPttYOM4vp5WurcJUVISSYAmOMdFVogro cupv0mKeBrnkAeBxmfcNnepcaE/9PhQpZJzxgNYwS56HFe5JYDqP5poqBZOo0JsvjtLM BltqJQH6QknHB337YOqUXFyyL8hBYdgLvh5v2RD48sLo8f21ngOSs2P5vMjpUymqCzxv etrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=/FRVCJL+Wwil6m7DFhn32971vrUDOIVGmIp5+S8NloI=; b=cEjYU1Xs/8sBErMYQrcHTjxxKSUs+3sb2WhDQAzk8MOyg+b87l1qH9faW8SB0NsgEZ OMA1C0Bw8BNT5D0kKMAjlkGBloGdFSdMloWjSRuur4SAdi9aFTlsww0MQlaOmnmwL1FX Uj3camOSm0I9NBWWMKvLMWI516J6OceAn1wZlPWaWJWka0rzLVEfmfXGpY5i+uZYOclm 397m8r17YtxI94xsYCCcz4BTZCejUSMRFvj0THSEgTo3rvdmpNFUfV6Hc99PAMOiBNpi z0N2MveCt2ODo2g9LREYMld1mA+iVjPRwGQuco/jkltALuqcNxzHS5NtCGhWjY3OVhed MBXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L73SVvDX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si32615651plx.517.2018.05.29.01.55.33; Tue, 29 May 2018 01:55:48 -0700 (PDT) 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=@kernel.org header.s=default header.b=L73SVvDX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755392AbeE2IzG (ORCPT + 99 others); Tue, 29 May 2018 04:55:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:50208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755257AbeE2IzD (ORCPT ); Tue, 29 May 2018 04:55:03 -0400 Received: from localhost (unknown [5.29.173.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CACA20842; Tue, 29 May 2018 08:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527584102; bh=v/1UYgMXFAlC/0ulsbFZ2AZ6R9jbhp5NCSYwNfSoih0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L73SVvDXoSW+CoZCTrLmEVGGwppOBs3D88WZylVf76pAneK3mo31U4Mi1X1bAcGGi CvWuO5XTPhbVUzRmSqviMhbFE8/afUrVEAVo1WBD7SioDrAXWx0waEQB6FDkNxrKyR OELi5LtNEFME23jvuI5lxEfl5GtC/qEKSNgSuAog= Date: Tue, 29 May 2018 11:54:59 +0300 From: Leon Romanovsky To: Hans Westgaard Ry Cc: Doug Ledford , Jason Gunthorpe , Hakon Bugge , Jack Morgenstein , Daniel Jurgens , Parav Pandit , Pravin Shedge , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] IB/mad: Use ID allocator routines to allocate agent number Message-ID: <20180529085459.GF3697@mtr-leonro.mtl.com> References: <20180529073808.27735-1-hans.westgaard.ry@oracle.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4jXrM3lyYWu4nBt5" Content-Disposition: inline In-Reply-To: <20180529073808.27735-1-hans.westgaard.ry@oracle.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --4jXrM3lyYWu4nBt5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 29, 2018 at 09:38:08AM +0200, Hans Westgaard Ry wrote: > The agent TID is a 64 bit value split in two dwords. The least > significant dword is the TID running counter. The most significant > dword is the agent number. In the CX-3 shared port model, the mlx4 > driver uses the most significant byte of the agent number to store the > slave number, making agent numbers greater and equal to 2^24 (3 bytes) > unusable. The current codebase uses a variable which is incremented > atomically for each new agent number giving too large agent numbers > over time. The IDA set of functions are used instead of the simple > counter approach. This allows re-use of agent numbers. A sysctl > variable is also introduced, to control the max agent number. Why don't you simply limit this number per-driver? By default, any variable is allowed and mlx4_ib will set something else. What is the advantage of having sysctl? Thanks --4jXrM3lyYWu4nBt5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJbDRVjAAoJEORje4g2clinN0AP/idsbMxwIzDg+gKlb2EZQsNc B0j6QICUQKz4wqHuqghozSA2hjyTwcWRzmjFkf5VNaI0T6g93pOf3FcdFGFHlz+/ dhwDZsHa/EwJqFIbGDc/ch7XNMwAsLBXvllU3eq+dno5jdkjVJ9Vsvuc11pX6ttI N0sxuYhe4gaNE5OnBpASXmk58D+P4uAqlFdbcjTYyYlG3B0W3aapVk15Dii83dSa Ny8XPBMY1RgjI2txEVMwDjTLXNfvkSg7w+FfgkZA4m5VwyEK4BnQJSmoFidxEWjv 20OkzehDteZDI21BBNtQQxj0a5zdzGPSTnv/8RxkLOr7q6k8bYHXswcag99LjciD pcG59IVIJR9//tNw48Ey0uRdJwWfAiiBw6uA1fTOWWQjyg/5QwkVjlh2y/TT2Tfv 4AcDOjhDjhUrCSgEwYtetzXYUQRg6/z2GWps9oCVvHOXE/tC4EvXUGBwYRp62yIv rcN+FDhYcRjowLnIGuWOQUuOWucg7DDVC4T0gh05Tax3rvtw1wqz6plO+i5Shlag nQQj7VNElA1tcoIFJkWvRK+qLoaUkJLiuW0vRTMyqm7LeN1WdC2GvPCKTv5STeMC Ik2iSeoIm5WzYOUGdFoetdvBVL9sLZXXIy6bwtp84+ultwwWbVfSNn2gtkgPthR3 ZrnBiholSjKN79fe9s54 =4dh0 -----END PGP SIGNATURE----- --4jXrM3lyYWu4nBt5--