Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2709621rdh; Mon, 30 Oct 2023 05:42:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFp76vNVo8ijBOrESwzdgOqhqMNVBDni34S64cUHZRMIcoJHqVIIzjf2gYDuzAQ+Y/wDxGP X-Received: by 2002:a17:902:8504:b0:1c9:ccb3:2352 with SMTP id bj4-20020a170902850400b001c9ccb32352mr9251618plb.12.1698669754490; Mon, 30 Oct 2023 05:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698669754; cv=none; d=google.com; s=arc-20160816; b=LkWbCnuOPMLKcgHL/qI8+PppQ6gEvguRoREr9Jg4vzYd9LDOKTkbaaID3M2aiBFjmq YNqSSFJucc/xDlNYV6UJmeFa9eWUgK2htm7HokY7sZyIqF0uqVa52lTaDTvC/dOM3WzB P6iE9e2HUZZ6zJJmtXe5tzG1FKQ03uLXBJmfCtXZ5P/DdU2c3D/zZ17q4llwcKxFniW9 P2j/7WWwyhcMjEaMbXU5LK+z4fMgl0vQ5/LR/Y8i8Eky+WtHE+bUitPPyaVUSiYrsdQ9 Qemm+hUGjVixmZgi5QXl6QmYRUF7I0ga6o0OBJ4G/dqkdcCCQuJxuQPc6drN+YoXyp0f 2gng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DaVImc0dkBy3Z9VTY5Zc/APOkE9bH1O0oC3xdyopltQ=; fh=sNlnsCy/NIcaZL6bcQ2si+OQSKrKUQqOTWU6zfTC8so=; b=WmlRwLtscj+QrbgAWcxQsSGlEtkt+D+vNafAYLS1DHPKBj4Jjlsi1rNYtUMijRU+bT LmHwZdcm8p7PcCFpIWN9Re+1GqpmYmTk1UViy4xpVhAexG0lf6mvaYmdMetQF7H9fDZb +8igVE4OgZaNDrJ0SS+DZHPlDKjD14R/tOi38ndytfQVwXcPC/Z8OMu4hj+upy7fntBq 1ePL8Nz8WlDTFX3FRFCdwu+cXqg7ZtRNMhmS5a9uQ/m0S+1Op/7jqGjK6/i7UyhiACC7 Jx3sAKLgyN1myhh5uQMNavKUVQ2E8ITlOIwN0ltAf+UKCdAsOaOGfycIE9UXTtPlxU9q viWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=b2VjK9lY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q17-20020a17090311d100b001c574110eecsi5047585plh.341.2023.10.30.05.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 05:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=b2VjK9lY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4ED368083A8E; Mon, 30 Oct 2023 05:42:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233276AbjJ3MmI (ORCPT + 99 others); Mon, 30 Oct 2023 08:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233191AbjJ3MmH (ORCPT ); Mon, 30 Oct 2023 08:42:07 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0EB2C9 for ; Mon, 30 Oct 2023 05:42:02 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-66cfc96f475so29495186d6.3 for ; Mon, 30 Oct 2023 05:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1698669722; x=1699274522; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DaVImc0dkBy3Z9VTY5Zc/APOkE9bH1O0oC3xdyopltQ=; b=b2VjK9lYfopeqoSMxqnpGF1Z7qPRaXlTZt4hG+CzcTOrrSAtsnjeeF79xLDAVhtQ0m ymnruuu84qnPeBvB8KSb6Bo4VOLsy1dmN9iTEMeWOCB3ddSMku3/QNP8wIi3YKcW8HKs XpnOqGg+DwRjfRwMfK5BfKxiR9GdlLS/SAiXGrZOPYldPNzB+Sft/YMuG5l+1CAft3dN xsc8TTXKMArFYX5ROH2dOJwi2iM5EJZymzm4LHfxKjq0sQchIUO6JsFrZxyANbBWWPLf R5jqgBLVPKFQVUmYcKEsKQbOYkNDiWkFVUSibu3U9p1TY36kLEMfcT54+MUHn3+YLC5Z +NUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698669722; x=1699274522; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DaVImc0dkBy3Z9VTY5Zc/APOkE9bH1O0oC3xdyopltQ=; b=OZnzn3VE+TkPC8M6lDtT1NfPZESlmaJJ8q5XUeOmeZ1vnjJ1o8jPEFDSeY56b7cGfn YF2iUo+6XBtcZ5hdID/LyT9GKQ3YY7TNKYtpPnByd+rnnW/Em+ndsXnT6sfxlRIjuYpY rud8SYDAbdRAvaiJ5TKjtDUMg174Q6MPyCnuku5o7pTA1v/k+SrmdUW9he9dcnb9q+6C vmNCsS7pbIVCDO8gzhdR3THox+1GfoPiknA6/vj54o3YR9xlIVauo3f3EQb4sTXu+tMT UmCEv1qMqe+5KJTazN4PWyLfmZOz05W2+g7+/n4RzKOzfJmGUOo3CFaJ4DwQqykoJyft nMwQ== X-Gm-Message-State: AOJu0Yy0A59LZ7532psNJgX73aFCtKagfcyZLwSdr81y6lyKoH9CfRtL 5JOHmwWZzpk0P5HDEe5yyC1p6g== X-Received: by 2002:a0c:cd0f:0:b0:66d:6544:8eae with SMTP id b15-20020a0ccd0f000000b0066d65448eaemr10074472qvm.34.1698669721602; Mon, 30 Oct 2023 05:42:01 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-26-201.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.26.201]) by smtp.gmail.com with ESMTPSA id w10-20020a0562140b2a00b00656e2464719sm3390314qvj.92.2023.10.30.05.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 05:42:01 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qxRai-006ev4-JC; Mon, 30 Oct 2023 09:42:00 -0300 Date: Mon, 30 Oct 2023 09:42:00 -0300 From: Jason Gunthorpe To: Long Li Cc: Ajay Sharma , "sharmaajay@linuxonhyperv.com" , Leon Romanovsky , Dexuan Cui , Wei Liu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "linux-rdma@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [EXTERNAL] Re: [Patch v7 5/5] RDMA/mana_ib: Send event to qp Message-ID: <20231030124200.GF691768@ziepe.ca> References: <1697494322-26814-1-git-send-email-sharmaajay@linuxonhyperv.com> <1697494322-26814-6-git-send-email-sharmaajay@linuxonhyperv.com> <20231023182332.GL691768@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 30 Oct 2023 05:42:18 -0700 (PDT) On Fri, Oct 27, 2023 at 09:35:05PM +0000, Long Li wrote: > > Subject: RE: [EXTERNAL] Re: [Patch v7 5/5] RDMA/mana_ib: Send event to qp > > > > > > > -----Original Message----- > > > From: Jason Gunthorpe > > > Sent: Monday, October 23, 2023 11:24 AM > > > To: sharmaajay@linuxonhyperv.com > > > Cc: Long Li ; Leon Romanovsky ; > > > Dexuan Cui ; Wei Liu ; David S. > > > Miller ; Eric Dumazet ; > > > Jakub Kicinski ; Paolo Abeni ; > > > linux- rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; > > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Ajay Sharma > > > > > > Subject: [EXTERNAL] Re: [Patch v7 5/5] RDMA/mana_ib: Send event to qp > > > > > > On Mon, Oct 16, 2023 at 03:12:02PM -0700, > > sharmaajay@linuxonhyperv.com > > > wrote: > > > > > > > diff --git a/drivers/infiniband/hw/mana/qp.c > > > > b/drivers/infiniband/hw/mana/qp.c index ef3275ac92a0..19fae28985c3 > > > > 100644 > > > > --- a/drivers/infiniband/hw/mana/qp.c > > > > +++ b/drivers/infiniband/hw/mana/qp.c > > > > @@ -210,6 +210,8 @@ static int mana_ib_create_qp_rss(struct ib_qp > > > *ibqp, struct ib_pd *pd, > > > > wq->id = wq_spec.queue_index; > > > > cq->id = cq_spec.queue_index; > > > > > > > > + xa_store(&mib_dev->rq_to_qp_lookup_table, wq->id, qp, > > > GFP_KERNEL); > > > > + > > > > > > A store with no erase? > > > > > > A load with no locking? > > > > > > This can't be right > > > > > > Jason > > > > This wq->id is assigned from the HW and is guaranteed to be unique. May be I > > am not following why do we need a lock here. Can you please explain ? > > Ajay > > I think we need to check the return value of xa_store(), and call xa_erase() in mana_ib_destroy_qp(). > > wq->id is generated by the hardware. If we believe in hardware > always behaves in good manner, we don't need a lock. It has nothing to do with how the ID is created, you need to explain how the missing erase can't race with any loads, in a comment above the unlocked xa_load. Jason