From patchwork Tue Sep 6 22:32:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiraz Saleem X-Patchwork-Id: 12968278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF6EECAAA1 for ; Tue, 6 Sep 2022 22:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229686AbiIFWdJ (ORCPT ); Tue, 6 Sep 2022 18:33:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbiIFWdI (ORCPT ); Tue, 6 Sep 2022 18:33:08 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3313A8B2C7 for ; Tue, 6 Sep 2022 15:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662503588; x=1694039588; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fsnPFcfjS+nj5CH4sTubBqoPvoeJN6V38BsBGsi3dzI=; b=Bihbc+MyotvpPPMEbG3yfanKkEB4zdIG1DEbBn7AG1Cj9/I4zqHOJPY4 7w9KYL7F59RSfBZIYMjUvJ0mLD19y50y2WVFhGQtINN7RZuZmrPzXM9sY ef16zKYIIVRqLuubIDpSEqXW19D/iCfqi9f6WvPLFt9CkQXuY06V6Fz1J 7j4lmdULPl5gEXWMZI7+sr1pgIdJ+yAlyJaZDepKqvusm+LFJwMwGbxfH uyYSgs/N5bRaKPTzd/h1hyRmGVT21IWT2o/fXgFXH3oJti3sgyzCMZy7N Nh+sR7kdhCFNhfD+ivZuf5uNsIZ9cbhk2TcgPOzvixhJArqxvr5VAjI/K Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="296724563" X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="296724563" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:07 -0700 X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="675898219" Received: from ssaleem-mobl1.amr.corp.intel.com ([10.255.34.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:07 -0700 From: Shiraz Saleem To: jgg@nvidia.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Sindhu-Devale , Shiraz Saleem Subject: [PATCH for-rc 1/5] RDMA/irdma: Report the correct max cqes from query device Date: Tue, 6 Sep 2022 17:32:40 -0500 Message-Id: <20220906223244.1119-2-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220906223244.1119-1-shiraz.saleem@intel.com> References: <20220906223244.1119-1-shiraz.saleem@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Sindhu-Devale Report the correct max cqes available to an application taking into account a reserved entry to detect overflow. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Sindhu-Devale Signed-off-by: Shiraz Saleem --- drivers/infiniband/hw/irdma/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 9b07b8a..f272a32 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -39,7 +39,7 @@ static int irdma_query_device(struct ib_device *ibdev, props->max_send_sge = hw_attrs->uk_attrs.max_hw_wq_frags; props->max_recv_sge = hw_attrs->uk_attrs.max_hw_wq_frags; props->max_cq = rf->max_cq - rf->used_cqs; - props->max_cqe = rf->max_cqe; + props->max_cqe = rf->max_cqe - 1; props->max_mr = rf->max_mr - rf->used_mrs; props->max_mw = props->max_mr; props->max_pd = rf->max_pd - rf->used_pds; From patchwork Tue Sep 6 22:32:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiraz Saleem X-Patchwork-Id: 12968279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95D90C38145 for ; Tue, 6 Sep 2022 22:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiIFWdK (ORCPT ); Tue, 6 Sep 2022 18:33:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiIFWdJ (ORCPT ); Tue, 6 Sep 2022 18:33:09 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C58BD8A7FE for ; Tue, 6 Sep 2022 15:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662503588; x=1694039588; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=We8I9TKpkY1YIiwn67wtVkhDva/IN2Wj3b1wIOlLRqI=; b=cZ9uGpvoNQHoUJqFhWZIudg6ecUiv6dwkSKVy4v4761YDX/iEt1NcUMi usYW68RB0jcVV3s/BasMCvaHjZ+9VEJ+2cAafFRrTgxQK8T80In4VcUwm Ax18j+e5VrVbOUXRDJO0gKpNBYTVabyW0jaC54osWtEtUcMKCGpuRgXUj NhYNhrDeRgFRUEu3aBYFrg9haXHSs+5rNGJFOGmaDntWRpl80Ao8dNQb2 q1o86WybOFbqS02J8rz/XAuaFDVQ/j2BerVG9hA6F0b2fszg01kQ1YWLS JOxLCfi7/26RzSQgtov4C4B+fRwB+cysuNjMiy1Fzl6qA2hLo8zAIkiHT g==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="296724569" X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="296724569" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:08 -0700 X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="675898227" Received: from ssaleem-mobl1.amr.corp.intel.com ([10.255.34.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:07 -0700 From: Shiraz Saleem To: jgg@nvidia.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Sindhu-Devale , Shiraz Saleem Subject: [PATCH for-rc 2/5] RDMA/irdma: Return error on MR deregister CQP failure Date: Tue, 6 Sep 2022 17:32:41 -0500 Message-Id: <20220906223244.1119-3-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220906223244.1119-1-shiraz.saleem@intel.com> References: <20220906223244.1119-1-shiraz.saleem@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Sindhu-Devale The MR deregister CQP can fail if an MW is bound to it. Return an appropriate error for this case. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Sindhu-Devale Signed-off-by: Shiraz Saleem --- drivers/infiniband/hw/irdma/utils.c | 13 ++++++++----- drivers/infiniband/hw/irdma/verbs.c | 6 +++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c index c8b9235..075defa 100644 --- a/drivers/infiniband/hw/irdma/utils.c +++ b/drivers/infiniband/hw/irdma/utils.c @@ -590,11 +590,14 @@ static int irdma_wait_event(struct irdma_pci_f *rf, cqp_error = cqp_request->compl_info.error; if (cqp_error) { err_code = -EIO; - if (cqp_request->compl_info.maj_err_code == 0xFFFF && - cqp_request->compl_info.min_err_code == 0x8029) { - if (!rf->reset) { - rf->reset = true; - rf->gen_ops.request_reset(rf); + if (cqp_request->compl_info.maj_err_code == 0xFFFF) { + if (cqp_request->compl_info.min_err_code == 0x8002) + err_code = -EBUSY; + else if (cqp_request->compl_info.min_err_code == 0x8029) { + if (!rf->reset) { + rf->reset = true; + rf->gen_ops.request_reset(rf); + } } } } diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index f272a32..892467c 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -3009,6 +3009,7 @@ static int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata) struct irdma_pble_alloc *palloc = &iwpbl->pble_alloc; struct irdma_cqp_request *cqp_request; struct cqp_cmds_info *cqp_info; + int status; if (iwmr->type != IRDMA_MEMREG_TYPE_MEM) { if (iwmr->region) { @@ -3039,8 +3040,11 @@ static int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata) cqp_info->post_sq = 1; cqp_info->in.u.dealloc_stag.dev = &iwdev->rf->sc_dev; cqp_info->in.u.dealloc_stag.scratch = (uintptr_t)cqp_request; - irdma_handle_cqp_op(iwdev->rf, cqp_request); + status = irdma_handle_cqp_op(iwdev->rf, cqp_request); irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); + if (status) + return status; + irdma_free_stag(iwdev, iwmr->stag); done: if (iwpbl->pbl_allocated) From patchwork Tue Sep 6 22:32:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiraz Saleem X-Patchwork-Id: 12968280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D636C6FA86 for ; Tue, 6 Sep 2022 22:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbiIFWdL (ORCPT ); Tue, 6 Sep 2022 18:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbiIFWdJ (ORCPT ); Tue, 6 Sep 2022 18:33:09 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390A48B2C7 for ; Tue, 6 Sep 2022 15:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662503589; x=1694039589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h7MNDRjLxA8BoH9opd68f06ZtxWZYdxDXPrqtqDfDsE=; b=oFssC+lhfsUYnCvi4HgvgZ4sIjkFxJ6tgUc3D8jwuDy5gcHS053grtG3 zhOkLTTjgAqqMyXgJYVzgASYhCd3R3mFAOdL0pMzSQCyUmBblIo1tEmyv T7NCSaxF2tsvM0nod4vResOwAhZLhuy3OXrF4OXrbnaEfpK5aneiWzgUn KiwHHbtHY4E2CgTVdR54K9nYhOqS7jCfHb/nQbAp1Q+Qd+Rdqb6SFcXXu +KCRIszbXpi3r1wggk6amT8h9qX+mtC5RBJVweBG9J4MbnN6gTcirX9Yj 2hmoCokPA7AXM8DSAGu+qK3l+c+Mcdg+i3SfwA2RA0FtBVudQYROKUrRc A==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="296724575" X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="296724575" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:09 -0700 X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="675898233" Received: from ssaleem-mobl1.amr.corp.intel.com ([10.255.34.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:08 -0700 From: Shiraz Saleem To: jgg@nvidia.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Sindhu-Devale , Shiraz Saleem Subject: [PATCH for-rc 3/5] RDMA/irdma: Return correct WC error for bind operation failure Date: Tue, 6 Sep 2022 17:32:42 -0500 Message-Id: <20220906223244.1119-4-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220906223244.1119-1-shiraz.saleem@intel.com> References: <20220906223244.1119-1-shiraz.saleem@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Sindhu-Devale When a QP and a MR on a local host are in different PDs, the HW generates an asynchronous event (AE). The same AE is generated when a QP and a MW are in different PDs during a bind operation. Return the more appropriate IBV_WC_MW_BIND_ERR for the latter case by checking the OP type from the CQE in error. Fixes: 551c46edc769 ("RDMA/irdma: Add user/kernel shared libraries") Signed-off-by: Sindhu-Devale Signed-off-by: Shiraz Saleem --- drivers/infiniband/hw/irdma/uk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/irdma/uk.c b/drivers/infiniband/hw/irdma/uk.c index daeab5d..d003ad8 100644 --- a/drivers/infiniband/hw/irdma/uk.c +++ b/drivers/infiniband/hw/irdma/uk.c @@ -1005,6 +1005,7 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq, int ret_code; bool move_cq_head = true; u8 polarity; + u8 op_type; bool ext_valid; __le64 *ext_cqe; @@ -1187,7 +1188,6 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq, do { __le64 *sw_wqe; u64 wqe_qword; - u8 op_type; u32 tail; tail = qp->sq_ring.tail; @@ -1204,6 +1204,8 @@ int irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq, break; } } while (1); + if (op_type == IRDMA_OP_TYPE_BIND_MW && info->minor_err == FLUSH_PROT_ERR) + info->minor_err = FLUSH_MW_BIND_ERR; qp->sq_flush_seen = true; if (!IRDMA_RING_MORE_WORK(qp->sq_ring)) qp->sq_flush_complete = true; From patchwork Tue Sep 6 22:32:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiraz Saleem X-Patchwork-Id: 12968281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3842ECAAA1 for ; Tue, 6 Sep 2022 22:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbiIFWdM (ORCPT ); Tue, 6 Sep 2022 18:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbiIFWdK (ORCPT ); Tue, 6 Sep 2022 18:33:10 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01A938B2C7 for ; Tue, 6 Sep 2022 15:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662503590; x=1694039590; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sJDLgcZTSXWsaEUxD/QOt8U3DY/BmsHnKmBxRKVeOgQ=; b=PeoaKhgpDDk/jn8w501dHQb9YCp3HR/lBWYzvxhZh8prVukNeIp77h4K ZLFcveXQNO8iqFDdG5W34MpVaO7t0r73I2jhMCYVyPofb+fW6HC15FA0Z ywpmy/HGibr//RVJ4AZC6K/53yUr9Vw9iA+bLZyqxwPjJwO0Qcino6rbi EzcetmEG+YieEQuz0VbhPVh/mfIR1XNiVzFYeglIlAuLzhsTSreyRMFaI XhWoxe8T+HLC40OHERjvfCR+0dQWe3EAQVWXcQ1mjWIasZ6aNs6mxxgI/ jU9ReSWrtbOa++P7xY0eTZT7D7qJxlvoqbgeldJrp40iIO3WPAvLXNjCs Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="296724581" X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="296724581" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:09 -0700 X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="675898246" Received: from ssaleem-mobl1.amr.corp.intel.com ([10.255.34.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:09 -0700 From: Shiraz Saleem To: jgg@nvidia.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Sindhu-Devale , Shiraz Saleem Subject: [PATCH for-rc 4/5] RDMA/irdma: Use s/g array in post send only when its valid Date: Tue, 6 Sep 2022 17:32:43 -0500 Message-Id: <20220906223244.1119-5-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220906223244.1119-1-shiraz.saleem@intel.com> References: <20220906223244.1119-1-shiraz.saleem@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Sindhu-Devale Send with invalidate verb call can pass in an uninitialized s/g array with 0 sge's which is filled into irdma WQE and causes a HW asynchronous event. Fix this by using the s/g array in irdma post send only when its valid. Fixes: 551c46e ("RDMA/irdma: Add user/kernel shared libraries") Signed-off-by: Sindhu-Devale Signed-off-by: Shiraz Saleem --- drivers/infiniband/hw/irdma/uk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/irdma/uk.c b/drivers/infiniband/hw/irdma/uk.c index d003ad8..a6e5d35 100644 --- a/drivers/infiniband/hw/irdma/uk.c +++ b/drivers/infiniband/hw/irdma/uk.c @@ -497,7 +497,8 @@ int irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data)); i = 0; } else { - qp->wqe_ops.iw_set_fragment(wqe, 0, op_info->sg_list, + qp->wqe_ops.iw_set_fragment(wqe, 0, + frag_cnt ? op_info->sg_list : NULL, qp->swqe_polarity); i = 1; } From patchwork Tue Sep 6 22:32:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiraz Saleem X-Patchwork-Id: 12968282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 703E6C54EE9 for ; Tue, 6 Sep 2022 22:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbiIFWdN (ORCPT ); Tue, 6 Sep 2022 18:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiIFWdL (ORCPT ); Tue, 6 Sep 2022 18:33:11 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9D9E8B2D2 for ; Tue, 6 Sep 2022 15:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662503590; x=1694039590; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e/d/YSWSQaLK85irF5TXWWeW2ABM85xnpz7Emrhaw0U=; b=e9QPzPVbgazdE4QSLtjUZNngVTbIH6UCmNRIzBepYYvImxOTnn1cHQkW 1UuUd8iV4EYkjNoR94G9P/tGd4b8MFP6Ad/rkV23qIceqHnhW9HfwxiBz Y1d3QB3Lol7/nUeqwQsidUr8/1LeJIwlfwYVHyUNTSWJJDmwOZI9f063L fZTeT8/51EMLCuTf97UDXV9Forv040qjZGrquNc/R7z96HIL2XVG4huQG LQp1ep8aGXkkS1zoo84az2m3TqAnFAaO1zNb7WP5gRoAehferXZPLeGnF +SYyTht4XeAXUkx8oIppqcJPrZ9zT4nDCut/yDlGEfjVJ3UiYdVXTeFjw Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="296724584" X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="296724584" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:10 -0700 X-IronPort-AV: E=Sophos;i="5.93,294,1654585200"; d="scan'208";a="675898255" Received: from ssaleem-mobl1.amr.corp.intel.com ([10.255.34.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 15:33:09 -0700 From: Shiraz Saleem To: jgg@nvidia.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Sindhu-Devale , Shiraz Saleem Subject: [PATCH for-rc 5/5] RDMA/irdma: Report RNR NAK generation in device caps Date: Tue, 6 Sep 2022 17:32:44 -0500 Message-Id: <20220906223244.1119-6-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220906223244.1119-1-shiraz.saleem@intel.com> References: <20220906223244.1119-1-shiraz.saleem@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Sindhu-Devale Report RNR NAK generation when device capabilities are queried Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Sindhu-Devale Signed-off-by: Shiraz Saleem --- drivers/infiniband/hw/irdma/verbs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 892467c..9b207f5 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -46,8 +46,11 @@ static int irdma_query_device(struct ib_device *ibdev, props->max_sge_rd = hw_attrs->uk_attrs.max_hw_read_sges; props->max_qp_rd_atom = hw_attrs->max_hw_ird; props->max_qp_init_rd_atom = hw_attrs->max_hw_ord; - if (rdma_protocol_roce(ibdev, 1)) + if (rdma_protocol_roce(ibdev, 1)) { + props->device_cap_flags |= IB_DEVICE_RC_RNR_NAK_GEN; props->max_pkeys = IRDMA_PKEY_TBL_SZ; + } + props->max_ah = rf->max_ah; props->max_mcast_grp = rf->max_mcg; props->max_mcast_qp_attach = IRDMA_MAX_MGS_PER_CTX;