From patchwork Sat May 11 04:36:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13662271 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 B4D3527452 for ; Sat, 11 May 2024 04:52:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715403168; cv=none; b=fLLwXtck66NMe2wVx5zWpBvIdq7LJrlFRFGTYxrLBOh15S5Z2OFp/0QdEIQg04WJ3bP7j3l0TLTkMgS7ZkfbfptovtQIrbQ6K/AuyCQQNmiS30xYEBWZXvMb0/ZbNvxukBfSRYrku5l/iI5ybXt1/JhYZPC8eImb9VDafajIrRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715403168; c=relaxed/simple; bh=59qpdAIZOBm5ADs/nFORynZnnEU+GlBVxIrVrckgFdQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=rxV6fhM/kBWmaFp8WPYzIFd9kiaeQ+dJOKiHcQV9tB2RryvkHcpnjFuCCNRPwG4LTYY7JE37nFX8rAFPAdix51hd3PlrIpSrwWC01IBhB7o9GSNTknhCQ8bWKeACbVTG+Qh5EMuWQdKqQhcAxz8d7/mLGZ3yz1ttuIoqrhGl4yE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=BFg9rfat; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="BFg9rfat" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6f44b390d5fso2300481b3a.3 for ; Fri, 10 May 2024 21:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1715403165; x=1716007965; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=XJnzyB2bRP5BwgXamd+/r2RGyZMKZ0x5TQ/JJkIn1VI=; b=BFg9rfat+cgdHrdz0L7zHBUrkt0rsyF6cqk8BuWctXT4lgWmqBzj6GkipHIqpLFNpc abidPMLzUHdDbxXn35ClQ0j94igVhA7MA40px3vFQBWaGAbm06iyzu4F9/Msqp//BdoH l1Gh1sgqNbcRAMyFhRwh3qdYKHgd2Al2A5dhc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715403165; x=1716007965; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XJnzyB2bRP5BwgXamd+/r2RGyZMKZ0x5TQ/JJkIn1VI=; b=ovvvsbQVzxH5arJ1TpB3r+2F9gyExYxfJLRMW5rhkUqi8P02niZlPy2eeWz9MEtxL4 rZ6mlbp660p1o5bCmGkUT43Mpqu8mqhcTtAaS8WTOMyHA/UE0mCG6l0vtC76kNeKyAeX K5+RSUrsJcnDGjDSLMQ9lcwjT/fpUpugRJjvQ5Dcs5tgUPXNKQS9M8m1NYScfx4j7hNm qZvd3i7C7cV4YTUz7Tthp1O6ZfMq4s9anIGDTt8wXX88bou9jtRn9s7Wn/2smyLzCraK /xoqeYXVuCSgybSzbMzsw1wuoHCEr1w8a0iyFi9vOH5HQbWVUfkDg4scSoxf5d5CU9rN 31gQ== X-Gm-Message-State: AOJu0YwpVkDDDPJ3dL8Z8GOHGzPrQ2aiF725DyYOWqhz6rp7akynq+5N gI/YVtZ4v+KoSbpIQhJmROLWEx+KYfAv2ybXfcSfgFrGlxavr4Avzw/RKuwhmg== X-Google-Smtp-Source: AGHT+IG7oaeZY9Pa5vRIy5umeexIqoph2ZWQvRcaYPkhpBfpQJvMGwyTUm7WrrelcZZiwD4Zz2VQCw== X-Received: by 2002:a05:6a00:1254:b0:6ed:e1c:102b with SMTP id d2e1a72fcca58-6f4e026bc23mr4838614b3a.4.1715403165452; Fri, 10 May 2024 21:52:45 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d6b71760sm3519153b3a.97.2024.05.10.21.52.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2024 21:52:44 -0700 (PDT) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Selvin Xavier Subject: [PATCH v2 for-next 2/2] RDMA/bnxt_re: Expose the MSN table capability for user library Date: Fri, 10 May 2024 21:36:30 -0700 Message-Id: <1715402190-28657-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1715402190-28657-1-git-send-email-selvin.xavier@broadcom.com> References: <1715402190-28657-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED was introduced to share the HW retransmit capability between driver and lib. The main difference in implementation for HW Retransmit support is the usage of MSN table or PSN table . When HW retrans is enabled, HW expects MSN table to be allocated by driver/lib, else PSN table (for older adapters). FW expose a new field which gives MSN capability. Drivers and libs can depend on the new field instead of HW Retrasns capability. For adapters which support HW_RETX feature, MSN table capability will be set. For older adapters, this value will be 0(to maintain backward compatibility with older FW). Rename UAPI just to capture the correct name of the HW capability that driver/library is interested in. No functional impact even if older rdma-core is used. Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 +++ include/uapi/rdma/bnxt_re-abi.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index ce9c5ba..d261b09 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -4201,6 +4201,9 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ib_udata *udata) if (rdev->pacing.dbr_pacing) resp.comp_mask |= BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED; + if (_is_host_msn_table(rdev->qplib_res.dattr->dev_cap_flags2)) + resp.comp_mask |= BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED; + if (udata->inlen >= sizeof(ureq)) { rc = ib_copy_from_udata(&ureq, udata, min(udata->inlen, sizeof(ureq))); if (rc) diff --git a/include/uapi/rdma/bnxt_re-abi.h b/include/uapi/rdma/bnxt_re-abi.h index c0c34ac..e61104f 100644 --- a/include/uapi/rdma/bnxt_re-abi.h +++ b/include/uapi/rdma/bnxt_re-abi.h @@ -55,7 +55,7 @@ enum { BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED = 0x04ULL, BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED = 0x08ULL, BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL, - BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED = 0x40, + BNXT_RE_UCNTX_CMASK_MSN_TABLE_ENABLED = 0x40, }; enum bnxt_re_wqe_mode {