Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1239760lqb; Thu, 30 May 2024 04:56:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVn/8pOVs5MOtxh4+FTbcnKAHB+RQug+Vp60jcrcEEbAOIbqynVCghhgUPdVdjS+JpnoLPIze/wqxLrXD8B0z4PkmMP2hVCdX1QB8g0Nw== X-Google-Smtp-Source: AGHT+IGAw2nubjaSPqIftdnC7sPgOrgg6ynEucOPlPFSi0995zKrVb7bIXxAsAqXJPfh7ME9/z93 X-Received: by 2002:a19:ac08:0:b0:529:593f:3f3c with SMTP id 2adb3069b0e04-52b7d47ac02mr1293353e87.53.1717070172668; Thu, 30 May 2024 04:56:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717070172; cv=pass; d=google.com; s=arc-20160816; b=XyWiv8ALqvTkH4+aZzV0yRmXWJuePapnJq7mKhxUVQG+kVcOrGTiNp0KmWTVgP0rFQ 4HTvcqz3jMdHPkDMhnBWBiYv3qb4qn/Vgn9qUthdszMHPX52nkHWfxXxPqtzli9DFTzl VH3PgC+krrZuNASR6yLXBuTB3WzeH/qKZUCUFfR5whqz3Mvb/3m9+EKtzHZ1A9riXcu8 QPCvOZpo6kZqBNBlS9FKYmxsNEX2mrdaxblmDfj63oiDutApBCI4UlpdDEFnBYcZ5hmQ W/nEB60xQFldgwuurBNNDxME4bn/tbEDGciFn0Cvp1niNoWtYiShUUkDN6wYwV2U1N1J b1XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=M3K5XGSDfWbI4lB7ESD4sp7zphrlBgbkJOr4pru6vAk=; fh=ujksmUrBEjpGhQjWbrjZMx9PDXUXbYR/j4y8MAq1x1o=; b=Omxqr4yUhZ4ZxW1BqQ4Rulyr1pq+MBwrV8JdPVZ+/DDRRW9WIEhRQXvzJF8k3hsdTU AqeSv2Xo6TgK0jvHAfqW63COqpVRlvNuDN88M+yv8WG1LyYpk4s6u0/khyK5D3iJAdl/ 3YJ7kns2eK9wBIxGjRCTpvRjjmbhzvLSQyjQ5QbNRIl+iOBzXvIUmv5oBAp9aNBgKXFe YqTE0hcbyuZZvhknqe+i9fD1DrKvq3oKMg/FEaLMcVO3qoHOjggR1bCJ0F9GDGzYUCC7 i6Bg1tYphxwZF3N1vCkx+zgtyAjOOo5jF0wdv4yWRY+AQB3jOi3sh1D5NDBlXTB50VTx eCug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=sFzBlGkh; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-195328-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195328-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.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 4fb4d7f45d1cf-579be3beb4dsi5649146a12.223.2024.05.30.04.56.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 04:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195328-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=@linux.microsoft.com header.s=default header.b=sFzBlGkh; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-195328-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195328-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.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 36CAD1F239B3 for ; Thu, 30 May 2024 11:56:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D55D51822ED; Thu, 30 May 2024 11:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="sFzBlGkh" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B834C17D357; Thu, 30 May 2024 11:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717070126; cv=none; b=Es6O1ZK6ogXvcNymrFDYEdvvJSKaI01P8CuqQK5NcGmD9X2jr6KdWyKn62yUY7j49w+Qck/1ZlEe8S/qAZ9BSd+1qymMxV7LPiKpVEdCezYOQAMd9q+48vYutx9NcP5N7r8NLRBFdO8PVJSZEyQIOHTf/IPWDA7M9miJXvFSeAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717070126; c=relaxed/simple; bh=Tka6UiC1uoB3TRMiDul+wp8wRtb86hr277VqYplsCxc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=eS3G66lnjIz+xvU5g/bDy0YGB1M2wHK22wJO3yb/c+UzYiGUxwkQBJmQ30VpuCUn6tWVrsqZUVBsYAoiZ6A3g5cX2S9av/TJ1707Me/GNILHMAkqKJrW/W8gbzbXQRA07oQMz4p4pwNZ6f5jYCp2FAW6fnioeW13Fnwwzf1bdWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=sFzBlGkh; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 6F59B20B9260; Thu, 30 May 2024 04:55:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6F59B20B9260 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1717070123; bh=M3K5XGSDfWbI4lB7ESD4sp7zphrlBgbkJOr4pru6vAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sFzBlGkh2b/X90BdWWE4n3KeHDs6wSuxAmIQJbtw6/LXmCS/uLxFZDcopYIU9ZQSl cFxIhrZJJljW83qBtnNUiavB596sD26CrQ3xjfIF2Q+sZVPskNChZvZC1WTP5Ci2Zy FVQLZ/eR3PRnoxpucdyCTmedbsCWs0CB6xdDMbds= From: Konstantin Taranov To: kotaranov@microsoft.com, sharmaajay@microsoft.com, longli@microsoft.com, jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH rdma-next v2 2/2] RDMA/mana_ib: extend query device Date: Thu, 30 May 2024 04:55:17 -0700 Message-Id: <1717070117-1234-3-git-send-email-kotaranov@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1717070117-1234-1-git-send-email-kotaranov@linux.microsoft.com> References: <1717070117-1234-1-git-send-email-kotaranov@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Konstantin Taranov Fill in properties of the ib device. Order the assignment in the order of fields in the struct ib_device_attr. Signed-off-by: Konstantin Taranov Reviewed-by: Long Li --- drivers/infiniband/hw/mana/main.c | 19 ++++++++++++++++--- drivers/infiniband/hw/mana/mana_ib.h | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c index 2a41135..814a61e 100644 --- a/drivers/infiniband/hw/mana/main.c +++ b/drivers/infiniband/hw/mana/main.c @@ -547,14 +547,27 @@ int mana_ib_query_device(struct ib_device *ibdev, struct ib_device_attr *props, struct mana_ib_dev *dev = container_of(ibdev, struct mana_ib_dev, ib_dev); + memset(props, 0, sizeof(*props)); + props->max_mr_size = MANA_IB_MAX_MR_SIZE; + props->page_size_cap = PAGE_SZ_BM; props->max_qp = dev->adapter_caps.max_qp_count; props->max_qp_wr = dev->adapter_caps.max_qp_wr; + props->device_cap_flags = IB_DEVICE_RC_RNR_NAK_GEN; + props->max_send_sge = dev->adapter_caps.max_send_sge_count; + props->max_recv_sge = dev->adapter_caps.max_recv_sge_count; + props->max_sge_rd = dev->adapter_caps.max_recv_sge_count; props->max_cq = dev->adapter_caps.max_cq_count; props->max_cqe = dev->adapter_caps.max_qp_wr; props->max_mr = dev->adapter_caps.max_mr_count; - props->max_mr_size = MANA_IB_MAX_MR_SIZE; - props->max_send_sge = dev->adapter_caps.max_send_sge_count; - props->max_recv_sge = dev->adapter_caps.max_recv_sge_count; + props->max_pd = dev->adapter_caps.max_pd_count; + props->max_qp_rd_atom = dev->adapter_caps.max_inbound_read_limit; + props->max_res_rd_atom = props->max_qp_rd_atom * props->max_qp; + props->max_qp_init_rd_atom = dev->adapter_caps.max_outbound_read_limit; + props->atomic_cap = IB_ATOMIC_NONE; + props->masked_atomic_cap = IB_ATOMIC_NONE; + props->max_ah = INT_MAX; + props->max_pkeys = 1; + props->local_ca_ack_delay = MANA_CA_ACK_DELAY; return 0; } diff --git a/drivers/infiniband/hw/mana/mana_ib.h b/drivers/infiniband/hw/mana/mana_ib.h index 68c3b4f..59a7a35 100644 --- a/drivers/infiniband/hw/mana/mana_ib.h +++ b/drivers/infiniband/hw/mana/mana_ib.h @@ -27,6 +27,11 @@ */ #define MANA_IB_MAX_MR 0xFFFFFFu +/* + * The CA timeout is approx. 260ms (4us * 2^(DELAY)) + */ +#define MANA_CA_ACK_DELAY 16 + struct mana_ib_adapter_caps { u32 max_sq_id; u32 max_rq_id; -- 2.43.0