From patchwork Tue May 28 06:11:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13676182 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 594FF8F48 for ; Tue, 28 May 2024 06:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716877952; cv=none; b=XuZ5n1F14eB7CfvJDT8gt5AtDmAo2wxXaxj0BP1dLphK6tYCg/VlErUe/EKpJVhulLZEkQy8LmSDH2e9qSa03O4YqdBrRG3hSYMRFIa666iDuBaF/51z5JqM0vaoQzbHSAeCUg/cqXkkWBmDhQzLq8CKZDoZ2vG/yzheYxFtoGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716877952; c=relaxed/simple; bh=T24OON74mCfTriA2Cp4njKYPmbPmNIWmFNUAWhG4MQo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=s11OfpePZtCE0CVZ643/IMhl+U6/PO/L/+3bqkMmOnNcoWUzFpTgwN5or6jfJVEBDWZzrUdQNAzE0QeTkCfS13VKRw3ddrnH7JIAP0qdSkqlhubZaZsD74C5oUSI4NqueNWEcOHw4n7am9ZaSYEobaXrMV7CEHZPoMIxrW716xg= 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=huEhxxfV; arc=none smtp.client-ip=209.85.215.176 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="huEhxxfV" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-681ad26f277so345178a12.3 for ; Mon, 27 May 2024 23:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1716877951; x=1717482751; 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=kjM+k88JYI4biqIOvXBRUf9SNmyyu0IFUQGXq+P6aVw=; b=huEhxxfVfpovLOpjLwNN4Bg9j0xyY0jBT6mFjoMwgUD2bpZYYkPa3XX4BezGyUYXNZ ISQrdx1MXuAWtxWDc/NSQgcg1gZnxwISsLpkYzn0T8SvvzB0NS0B3pxSShHqUi5EwaHN D4uGeKOK54F5wx8pW3taELhNK1PDDwaN0HQVY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716877951; x=1717482751; 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=kjM+k88JYI4biqIOvXBRUf9SNmyyu0IFUQGXq+P6aVw=; b=IaCCqUPnduUCZ3us37aS2P91S9GHvl78wPMRkcGW8/9tbTE1s2n+wLAbDIm4EGwIDJ OG7d87wfTamhEQMtxrXDFur+ub7a89FQE7au8Y35OsHVYU1xfuj6hnuTyXR4ZfAPYhjw 2uZTzzqmsEgT6aEPbro9ugkj+wULqvdvkLVSyBd8lwyUZV2C+KunN0+mrJ1brqSdCF5g HNbhR1Fzj+M0cVTO9EMQjP+3WEvaygU2vlC5m6s7E31CbDRs6NUArtkzgqmOCD+4xUI5 TnWadj7HdbRw2IeFl9cY+MNq2X8PB0foCZlrDQ9V/H8ZN2DNVWa+tWPqIvj8yt+lsXKE /uJA== X-Gm-Message-State: AOJu0YztPDJw477jy6NWX6KSuvM4dsWcWigYCvcv1SKG5jPYaIaLxnkB eK23Tut6Pvo156Y8SmOBc5VyfgVNUwKEQmMeCO0EwrQo0TnOsZKXWEIDzfMKqg== X-Google-Smtp-Source: AGHT+IFRwOGoO3Pn4JJ8L94IjVu+dHwqvYT3Bis/lo4B0r1KaidCpC1JhqE+I+wSvPS7hi8+No0atA== X-Received: by 2002:a17:90b:30c1:b0:2bd:d2f9:e71a with SMTP id 98e67ed59e1d1-2bf5e169ea5mr10533869a91.29.1716877950490; Mon, 27 May 2024 23:32:30 -0700 (PDT) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.252.234]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2bf9edebd4asm4584847a91.55.2024.05.27.23.32.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2024 23:32:29 -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 v4 for-next 2/2] RDMA/bnxt_re: Expose the MSN table capability for user library Date: Mon, 27 May 2024 23:11:37 -0700 Message-Id: <1716876697-25970-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1716876697-25970-1-git-send-email-selvin.xavier@broadcom.com> References: <1716876697-25970-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 {