From patchwork Thu May 10 12:48:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Zambre X-Patchwork-Id: 10391783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E5CC360236 for ; Thu, 10 May 2018 12:48:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CADC628B06 for ; Thu, 10 May 2018 12:48:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF4BB28B0B; Thu, 10 May 2018 12:48:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4569B28B06 for ; Thu, 10 May 2018 12:48:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757294AbeEJMsv (ORCPT ); Thu, 10 May 2018 08:48:51 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:40179 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757259AbeEJMsu (ORCPT ); Thu, 10 May 2018 08:48:50 -0400 Received: by mail-io0-f196.google.com with SMTP id g14-v6so2845650ioc.7 for ; Thu, 10 May 2018 05:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uci-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=BFIPKq+Z5j9KnYPyxDphdMLQSXDOra+5G/2/NDTS5yI=; b=iCpdZF/60QgnegP1q73EdUr9aU7sVC9kHvX2ETRSMfNqvHRl9DHRV2V58GEPiW8hga l8WSuGNahbfI83wZ1D508kLR9eJeqSsm+GjBOU0p8MNFcBziUFZcjbd3LKv3SWx8tyPF fQoLnH1NEa2LwHy8v7E3QyR1xZ+6J+wtZpDubxHT3JFDnCIAV9gVOqPwqGKTiNfHa5wk e2hlPBXnaGe655AnRbDdRbVd7k4UsMovfHMECbLkwVgkc9hYatKSQ2l3iFJf2k59zx88 s/RxHjfxJXMadx35pxq9fHWdkv2BO29zNUj2Yg5FpbruH7u021/sNndsojeuPv4fvlFv 27dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BFIPKq+Z5j9KnYPyxDphdMLQSXDOra+5G/2/NDTS5yI=; b=HymJJ3wncklbxFDl5iztGUtfGq6yzoJwr7WAT+H3vzwbBgnhjVqXnA6nZvSJJSiSmo T6B08derOYrB007nkAC8eB89koTPzo/my/KfgKZAyz6TmnhzBn3gMyPcmz0F58p1k7wl T28rJLV96AiFYBaGnwX70b+vVzY7ERFrGE8F3e8UtnxJb2jiufXGZwoTVbgyEkB0Jwxx tyvsVE2brNGJqWU3/lHwHUgwOJcxlabHTsmekjQ7sO/bpovuBogCv/PJ6/vrFui17VHU x15TkVkwuaJmurt8AnrYfTwUp0qUKzFpbqybe+CzBaKSEkYnybaTyuxpnsfMYIfouSEE 5spA== X-Gm-Message-State: ALKqPwegxp5dnOnP3jTrX2piXPKkzZu15flbhUANekSjcm491Cca1tdx lnn0tUKnEvDofjJouuAdXxLxZA== X-Google-Smtp-Source: AB8JxZpUPlstd8RhPGWDdbJvYVoBixNTMFjzzqei4r2jiUcVvlwCG32vTEgMYfS7ReXESUWglMRv1A== X-Received: by 2002:a5e:8813:: with SMTP id l19-v6mr1340112ioj.243.1525956530141; Thu, 10 May 2018 05:48:50 -0700 (PDT) Received: from jlselogin1.ftm.alcf.anl.gov (jlselogin1.pub.jlse.anl.gov. [140.221.96.130]) by smtp.gmail.com with ESMTPSA id i128-v6sm321054ioa.38.2018.05.10.05.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 05:48:49 -0700 (PDT) From: Rohit Zambre To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, Rohit Zambre Subject: [PATCH rdma-core 1/1] mlx5: Fix bug in disabling lock on extended CQ Date: Thu, 10 May 2018 12:48:41 +0000 Message-Id: <1525956521-11960-1-git-send-email-rzambre@uci.edu> X-Mailer: git-send-email 1.8.3.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the lock on an extended CQ is still taken even if the user sets the IBV_CREATE_CQ_ATTR_SINGLE_THREADED flag. This is because the MLX5_CQ_FLAGS_SINGLE_THREADED flag is not set before mlx5_cq_fill_pfns. This patch sets the MLX5_CQ_FLAGS_SINGLE_THREADED flag after allocating the extended CQ and before calling mlx5_cq_fill_pfns, allowing correct control on the lock in mlx5_start_poll and mlx5_end_poll. Thanks, Signed-off-by: Rohit Zambre --- providers/mlx5/verbs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index 4dd40b2..c3dcee8 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -653,6 +653,10 @@ static struct ibv_cq_ex *create_cq(struct ibv_context *context, return NULL; } + if (cq_attr->comp_mask & IBV_CQ_INIT_ATTR_MASK_FLAGS && + cq_attr->flags & IBV_CREATE_CQ_ATTR_SINGLE_THREADED) + cq->flags |= MLX5_CQ_FLAGS_SINGLE_THREADED; + if (cq_alloc_flags & MLX5_CQ_FLAGS_EXTENDED) { rc = mlx5_cq_fill_pfns(cq, cq_attr, mctx); if (rc) { @@ -698,9 +702,6 @@ static struct ibv_cq_ex *create_cq(struct ibv_context *context, cq->cqe_sz = cqe_sz; cq->flags = cq_alloc_flags; - if (cq_attr->comp_mask & IBV_CQ_INIT_ATTR_MASK_FLAGS && - cq_attr->flags & IBV_CREATE_CQ_ATTR_SINGLE_THREADED) - cq->flags |= MLX5_CQ_FLAGS_SINGLE_THREADED; cmd.buf_addr = (uintptr_t) cq->buf_a.buf; cmd.db_addr = (uintptr_t) cq->dbrec; cmd.cqe_size = cqe_sz;