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; }