From patchwork Mon Mar 22 16:22:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Potnuri Bharat Teja X-Patchwork-Id: 12155463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C15D3C433DB for ; Mon, 22 Mar 2021 16:23:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 911996198E for ; Mon, 22 Mar 2021 16:23:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbhCVQWb (ORCPT ); Mon, 22 Mar 2021 12:22:31 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:3305 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbhCVQWV (ORCPT ); Mon, 22 Mar 2021 12:22:21 -0400 Received: from localhost (mehrangarh.blr.asicdesigners.com [10.193.185.169]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 12MGMCr1024202; Mon, 22 Mar 2021 09:22:13 -0700 From: Potnuri Bharat Teja To: jgg@nvidia.com, dledford@redhat.com Cc: linux-rdma@vger.kernel.org, bharat@chelsio.com Subject: [PATCH v1 for-rc] RDMA/cxgb4: Fix adapter LE hash errors while destroying ipv6 listening server Date: Mon, 22 Mar 2021 21:52:09 +0530 Message-Id: <20210322162210.21964-1-bharat@chelsio.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Not setting ipv6 bit while destroying ipv6 listening servers may result in potential fatal adapter errors due to lookup engine memory hash errors. Therefore always set ipv6 field while destroying ipv6 listening servers. Fixes: 830662f6f032 ("RDMA/cxgb4: Add support for active and passive open connection with IPv6 address") Signed-off-by: Potnuri Bharat Teja --- Changes since v0: - modified commit description to inform the severity of patch. --- --- drivers/infiniband/hw/cxgb4/cm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 8769e7aa097f..76faba892f00 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -3599,8 +3599,9 @@ int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog) int c4iw_destroy_listen(struct iw_cm_id *cm_id) { - int err; struct c4iw_listen_ep *ep = to_listen_ep(cm_id); + bool ipv6 = false; + int err; pr_debug("ep %p\n", ep); @@ -3610,13 +3611,14 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id) ep->com.local_addr.ss_family == AF_INET) { err = cxgb4_remove_server_filter( ep->com.dev->rdev.lldi.ports[0], ep->stid, - ep->com.dev->rdev.lldi.rxq_ids[0], 0); + ep->com.dev->rdev.lldi.rxq_ids[0], ipv6); } else { struct sockaddr_in6 *sin6; + ipv6 = true; c4iw_init_wr_wait(ep->com.wr_waitp); err = cxgb4_remove_server( ep->com.dev->rdev.lldi.ports[0], ep->stid, - ep->com.dev->rdev.lldi.rxq_ids[0], 0); + ep->com.dev->rdev.lldi.rxq_ids[0], ipv6); if (err) goto done; err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp,