Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1761947rbb; Mon, 26 Feb 2024 23:28:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXMfQgqDq2n5wYNLU/RtVuVwiT/cLVeDvpg5/8UuKUr0Cn+T4ClaMGSTYa+dYpqZiAOdAgiledywqyT6dLoh/NUyheQwZfcuKDk1z8XZA== X-Google-Smtp-Source: AGHT+IE6FD4PQCbXFOPGGGJM4eEAxjasuWGxb3Xr6/gdLbuvXvXz8LaDsbN9Y2N2AbX6n9+KO81S X-Received: by 2002:aa7:d0ca:0:b0:565:862d:1c58 with SMTP id u10-20020aa7d0ca000000b00565862d1c58mr6346325edo.8.1709018898889; Mon, 26 Feb 2024 23:28:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709018898; cv=pass; d=google.com; s=arc-20160816; b=PLHcCB7op6iRHlhlzyNznya2UeiRKysqbnBdaYMY6Avj2r3x3YAt0/+g8UqKPF9WBk Al2NUiXDFsMIL3UyowTLI1Gp0VuoLVk6TEp/dq53Gy9Fny1+tEWb1BwZRl3B/a2C4aOK aJmTd2IUkvDkIIF0VmbtHcQvHIbKO3wtMgQZhcF/BYsSnjKwsSIvNwLjIJQhTOIscp3M cx5zj2JdJYmhkFlld9eJrJeZhlaAdZR3u58dfEGQ2BbOJ1fhmcx8cHflYZ0Xrug3b4Uv 2Q8IsulYBDeMmkFdBuxGcGQfOiQ9QK2OYz1d/I2Js2JOVflLLM27I6s8/3hIyPA32vsW xefA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Pcud2m+UpllR9gywjo/pmWtVwXhcUiZpPf7KUim5Vf0=; fh=orW+y8ThIcRUt1tmION/EI7bKbq6t59N4aaBWg+eeSQ=; b=OfbcnhqLswrLPcUXWBiGaSzYQiK8Gb9b5wr/Gi8BycrtQ+f28n2CUXF4PqMXAv/Hpr +LxY+ECF4sKKOVVhYHkLcZCBz6U6gfompUxW/3vx8AE6rvnNYLQCEXF0lymV40Saajlt xGcP2LYd0Z6eTabuilKujyklxo1pnFtK5gGjJKAWp1mcS0lj7P7ckaD0P9sqir/+to3B OyruVfca3Raglm4qjJP8KhDosSgMI3/0s/GKBrPidlL/tBC956f44U2pZiXJ+gwu0rFo zKnnq+7NzpwJz5a74VIWHfcMzf/dd6fLP0R+ogGWLrekeMY8vWtemJFCI19d1402nMgB sYmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-82800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x4-20020a05640226c400b00564cba07908si500372edd.123.2024.02.26.23.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 23:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82800-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; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-82800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com 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 82C9E1F228BD for ; Tue, 27 Feb 2024 07:28:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9516154BD8; Tue, 27 Feb 2024 07:28:10 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CECFEAD5; Tue, 27 Feb 2024 07:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709018890; cv=none; b=KWfNyNyDPRdAlR0Fggm6m5VXls3n0/kUSufEpzJIKuTp3TpixcVfyaOai4FxC+ALHImoQbHlaVjJs9m2Kc5NYAmjswZfZfsJEo390/VEZLMKqZrKD8uxsCs3Oed4y86j9IKgeKsurBsnqPqv3MTqQR5BDZOyEkZwTU9TXrFAWGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709018890; c=relaxed/simple; bh=hvL0sbx6R2Sh77C67/IR4/MDaL+YF2p9oTYtxx9nnWs=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=jafyANWARaYJiGPjqDRlGG2MXb053e7xO3krcT9Guf1PHu5bJ0ewKVned7fgexNcyF2yt115GeckccgxuOrK5f4NtuzACea/2RdnRU2hFUtsApYngSXsJAx2LtywzD90YuslQFLOQpQ3HtVtPBpTImeIqPGCZ1eAE1TvJuUpfhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4TkTZ12bpwzNlnQ; Tue, 27 Feb 2024 15:26:33 +0800 (CST) Received: from kwepemi500006.china.huawei.com (unknown [7.221.188.68]) by mail.maildlp.com (Postfix) with ESMTPS id B2B32140F0A; Tue, 27 Feb 2024 15:28:02 +0800 (CST) Received: from [10.67.120.168] (10.67.120.168) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 27 Feb 2024 15:28:02 +0800 Message-ID: Date: Tue, 27 Feb 2024 15:28:01 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.0 Subject: Re: [PATCH v2 for-next 2/2] RDMA/hns: Support userspace configuring congestion control algorithm with QP granularity To: Jason Gunthorpe CC: , , , References: <20240208035038.94668-1-huangjunxian6@hisilicon.com> <20240208035038.94668-3-huangjunxian6@hisilicon.com> <20240221155248.GD13491@ziepe.ca> <26ea175c-fa31-720c-2ac3-41abcb4d398a@hisilicon.com> <20240226140647.GB3220539@ziepe.ca> Content-Language: en-US From: Junxian Huang In-Reply-To: <20240226140647.GB3220539@ziepe.ca> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500006.china.huawei.com (7.221.188.68) Problems below will be fixed in next version. Thanks, Junxian On 2024/2/26 22:06, Jason Gunthorpe wrote: > On Thu, Feb 22, 2024 at 03:06:20PM +0800, Junxian Huang wrote: >>>> +enum hns_roce_congest_type_flags { >>>> + HNS_ROCE_CREATE_QP_FLAGS_DCQCN = 1 << 0, >>>> + HNS_ROCE_CREATE_QP_FLAGS_LDCP = 1 << 1, >>>> + HNS_ROCE_CREATE_QP_FLAGS_HC3 = 1 << 2, >>>> + HNS_ROCE_CREATE_QP_FLAGS_DIP = 1 << 3, >>>> +}; >>> >>> Why are these bit flags if they are exclusive? >>> >> >> Our FW uses bit flags. Although there is no direct relationship between >> FW and ABI, but from the perspective of readability, bit flags are also >> used consistently here in ABI. > > Don't do that in uapi. > >>>> +enum hns_roce_create_qp_comp_mask { >>>> + HNS_ROCE_CREATE_QP_MASK_CONGEST_TYPE = 1 << 1, >>> >>> Why 1<<1 not 1<<0? >> >> This is to keep consistent with our internal ABI, there are some >> features not upstream yet. > > Nope, pack them tightly. Don't keep an "internal ABI" > >>>> @@ -114,6 +128,9 @@ struct hns_roce_ib_alloc_ucontext_resp { >>>> __u32 reserved; >>>> __u32 config; >>>> __u32 max_inline_data; >>>> + __u8 reserved0; >>>> + __u8 congest_type; >>> >>> Why this layout? >> >> Same as the 1<<1 issue, to keep consistent with our internal ABI. > > Same answer > > Jason