Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2031431lqa; Tue, 30 Apr 2024 06:41:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLVm0u3cFnPE/NsvCWSujqYrw0gaL/z4aiEalpzxhyGTwyX+/e58nkY1vsADEqdz6pgWBFaJpxy6WiuT9hLOOw9Cn7bwI/NjoEtvutHw== X-Google-Smtp-Source: AGHT+IGdRIoPZpBvVV1L4dDSaLAJ9W3Id2QvIVY/EoLxsDY2VWGzJ3/Xu9L5ey9tXSu/UlvJIYr3 X-Received: by 2002:a17:906:48d4:b0:a58:bd17:f96a with SMTP id d20-20020a17090648d400b00a58bd17f96amr2010174ejt.36.1714484483409; Tue, 30 Apr 2024 06:41:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714484483; cv=pass; d=google.com; s=arc-20160816; b=UG2VFgG8TuihoWKv0mLmcDbxQoDAPQaHy3H9AXCIuvZG4g5rY+tApg7PcbZ3sp/3tJ P7M8qFUYMLT4PT7FU+dO4TPLhPUUXJeXwp8lfr+Tr+YiqqpWi4wfKJhCpsgdw6fM+VIR FacBOVcW3QTGf87u9N1Ru32rO6MfrwnoHBS4oq7sw+F4QqdMn+BpI7WraPJn+QGhONmI h7Vmq1O2VK45P6QwnMu1rokusQLPz34+lI/BNDu8n05nO0/s21XR9KJQYPxkqzVecbAw jvftkSy7VhZHeaASLCVlIOEHlATs6+9AXVd5QwSl7IkNbt952gIWU/0uBWKqL8wV1Nqy 07gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Dzw9A3IXUr1HMpouSEVNHEKHoRky87JvxE7doN13XH4=; fh=lvCqn7HO3RirHq28aLdqD1w94P/zTetaRPzx9mCNvhA=; b=kvfA1C9tOdE9ySEHeXwblAPQUKaT0DdCjMiHFSVrwzRW1JMRA+DwnLlo9uzOZCZEyX DrszPM1k2kSUtXFOLb7t8No0jafWb/ljQTIGfx9nJBA2t2WZK2NwgAdKpOaitMTF+ImL KHZlpGTrmJQvT26uTXZlqJ8ZWfsG3ZmWlUoUwrl3+SvnY2e639VCKwGjlZX1hwhVl0Mj jKHuePLJe00ISwJApkDX+JdGnP8f4wh5zV7zKU7l6CsVpyBHgw4FDYZKfM89T6uIFX43 Dr/bPdr+p/LuAbNs1k53VZMuehcqiyhVKEfDUP4JcuQ4WLWtQ/MA8tSZDsRWhZqsC+zk 6yQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=CxlVORiS; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-164030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164030-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c1-20020a17090603c100b00a5917137c6dsi1195692eja.189.2024.04.30.06.41.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=CxlVORiS; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-164030-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164030-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 27B0C1F22992 for ; Tue, 30 Apr 2024 13:41:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0844171E5E; Tue, 30 Apr 2024 13:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="CxlVORiS" Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E8D01F171 for ; Tue, 30 Apr 2024 13:41:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714484477; cv=none; b=lKmBWDAQN30k1EzihrDOwYw6xSR+3wLIALGuDE1DQeNNd5Ygw5HB1Em1AgX4OrY9hnNOFi8Tp/5ZFmEXAO3eRz53OHyP1cZ3RoP2DNv97+JB245+XPrABV0EcIV8svmIxS8GDnmLLbSaghhu0/K20C5lFN3/d21UtrN9r+rcGVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714484477; c=relaxed/simple; bh=F1qt8VVpzCRzm8FHEJTQ7+DA8vuSysbZAqcXhPKDx5o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fLJOsZD+9lm7sW24OWz2RJqR9bogc06es6JaE28AWfnewp7ClA7Vv4si/EZWGKevQjas+AgrdoUb/ifj54fvCttlUJFBVA6GcczZ06nSsxrfxMwafV1PiuFK9+NODhjqhRinKcfGLR7FK2jIKh+Skjd0y0CL2jyDTAYXv5nsZFU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=CxlVORiS; arc=none smtp.client-ip=209.85.161.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5acf5c1a2f5so3757290eaf.0 for ; Tue, 30 Apr 2024 06:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1714484474; x=1715089274; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Dzw9A3IXUr1HMpouSEVNHEKHoRky87JvxE7doN13XH4=; b=CxlVORiSz8Ft+XhknC5X7p8hpv95R1hsLSjC2Z7cgeB39Jg9Az+wAdgRgN8sXMuZ8A QnUwjKbSE44px15olS+y8Hk7BNVKJS/EDEFonQA1pFbFnQ6GFUNx2mxi2iDlA0Ntn2+C IdV9sLgmp8ex1V69i/eu8EznerLW7BGFqeusmNTkyB9QJfCPDq0xheSAvk4QEhQEwfAP pvenH7QkCbYV/fwdiKXfFvSsQCR0jYSj6+dKhjqWHS//Nzg6UZM+RlK3WbUUIxiT5y/G GP2k8VKC9UffkWuV3HFbDmrVi2CgHYBk8fo5LDOgeiA3j+09q98iCxFHDeBJIWL4bNUP GLjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714484474; x=1715089274; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Dzw9A3IXUr1HMpouSEVNHEKHoRky87JvxE7doN13XH4=; b=NMoMiZ380uXZSUbLQKDqOIrUTuNawHtDF9wdNch+k7u2JsKtlm45vQBPsqpj5nD9Fs 9qB1qGbyhqkBRxO6wSwL+QKWCsadYISXQLl5zYfuDJBlHGs9NVKDGZj8Uei5zueoDsjQ Bb9Aal22Jszr1h5prc3XBehAVd2KjljIm0uB0X8jSZcTnYyR/RHVWZGClplIWKjxn7y7 HcCXisSoSyhLuVwchqNPsltmZbhbnV5GnXyYEWsB9fV1KC/in9wkK1uh180MdSW7zE0h T54DBctu3OuGRFv7J+2YAKyDNfQygY+Kq5R5p1lUgE3PtdfhlTb/7A/sfu7uTGNm9TqH 3afw== X-Forwarded-Encrypted: i=1; AJvYcCV3upAonDaahOW363Ml6qhLkn2wbM05H39FltA4dwx8A/KPvPuTZLiK8nSRQUDbOzDQgXV5qQpFrEvEmjjmWRCa+sfuI51F/XG1BoD8 X-Gm-Message-State: AOJu0YykSEBpwQDBTyTkNYjAqzhQOXKJPgIdnLuWjIyKsI8/Xuc9XlwY qBfHFZL47cEDKJc952XscArrZTJpWib29ZEIfUxKgh5cmU0OftNCGbYxneGkPFg= X-Received: by 2002:a4a:bd0a:0:b0:5af:bf76:e3d with SMTP id n10-20020a4abd0a000000b005afbf760e3dmr3781473oop.2.1714484474715; Tue, 30 Apr 2024 06:41:14 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-80-239.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.80.239]) by smtp.gmail.com with ESMTPSA id ch14-20020a0568200a0e00b005afafa10ed7sm766053oob.33.2024.04.30.06.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:41:14 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1s1njN-007E4h-2V; Tue, 30 Apr 2024 10:41:13 -0300 Date: Tue, 30 Apr 2024 10:41:13 -0300 From: Jason Gunthorpe To: Junxian Huang Cc: leon@kernel.org, linux-rdma@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH for-next] RDMA/hns: Support flexible WQE buffer page size Message-ID: <20240430134113.GU231144@ziepe.ca> References: <20240430092845.4058786-1-huangjunxian6@hisilicon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240430092845.4058786-1-huangjunxian6@hisilicon.com> On Tue, Apr 30, 2024 at 05:28:45PM +0800, Junxian Huang wrote: > From: Chengchang Tang > > Currently, driver fixedly allocates 4K pages for userspace WQE buffer > and results in HW reading WQE with a granularity of 4K even in a 64K > system. HW has to switch pages every 4K, leading to a loss of performance. > In order to improve performance, add support for userspace to allocate > flexible WQE buffer page size between 4K to system PAGESIZE. > @@ -90,7 +90,8 @@ struct hns_roce_ib_create_qp { > __u8 log_sq_bb_count; > __u8 log_sq_stride; > __u8 sq_no_prefetch; > - __u8 reserved[5]; > + __u8 pageshift; > + __u8 reserved[4]; It doesn't make any sense to pass in a pageshift from userspace. Kernel should detect whatever underlying physical contiguity userspace has been able to create and configure the hardware optimally. The umem already has all the tools to do this trivially. Why would you need to specify anything? Jason