Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp86780pxb; Thu, 30 Sep 2021 01:33:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5OhqiIY7lRU4IzVORr+6gLjlhAyE3Sn61ZEXVtRuPM9uyauU7D9zPyKLaT6Lu5cRUdBre X-Received: by 2002:a17:906:8467:: with SMTP id hx7mr5123525ejc.369.1632990812792; Thu, 30 Sep 2021 01:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632990812; cv=none; d=google.com; s=arc-20160816; b=eZT4G5DpaYWE9IMXaoE6wWU2/Cdwvk8jMSAAybhAx3D7PMFU1d/FwU6kiAixN+fWR9 ystxqVRiwel7MITAywNOfNprS9RW4VykfPi7lB61GTF3HQnUUBzX0ak0d+sR202VTXEN hPZ68INIMDn4M+e1nhJfsunlF6LJXMZ9Fk2ZKeaFU0YtTwt0Tl0WNvmSAMQC2Ult5u8D fQBieT5mg7Vsncp18dzy0GFQwppBkRrcvedhtPwBio82yZceHB8QmW3AInObfEayeIWN XIcDi5McT24T6rj+xBA7BokJ5rUOfq1Ad82ph/CcnzMCc0FEv/YDGsnxgrvfQnPpV+O/ NHdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1I1nXLI6APgtAXVlnSH2tDSE1F+gk/nTZkMd/P13QnM=; b=KAWGivFeDABCPjOJizy4RDkE8rmtBx2fZXdeuZE83IM0hX3HLwMqfOZNLGFNDAP1Fd MXe7/GG4u02J0LjNQX7HU/f/CppPp5pLqL8ku3Eju8e4FmnQxyd/o93Kcc55022A+MrB 1wNIxkCHTE94qnPrf5wgCbgmZg/H+YURC2QvdJMn9f+O7oyuJzTIGbkHj4/FyAmDaLCh x33CaQaRHuF/Ub3o9zAVAPilODZmJCOvLbpT7Bl/Xlm4rzNYsHJPmsBK5Q3yg/BlVBvp 5DUe9o21ANApqPF2RRYLxwieOVNKkvSrMkPGoW7xNuHdHS4VOW0j3CsSPePm1VAqeYvD S5Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AM00vJx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si2762693ejs.401.2021.09.30.01.33.08; Thu, 30 Sep 2021 01:33:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AM00vJx8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348705AbhI3HZF (ORCPT + 99 others); Thu, 30 Sep 2021 03:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348699AbhI3HZE (ORCPT ); Thu, 30 Sep 2021 03:25:04 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1F2C06161C; Thu, 30 Sep 2021 00:23:22 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id g62-20020a9d2dc4000000b0054752cfbc59so6169354otb.1; Thu, 30 Sep 2021 00:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1I1nXLI6APgtAXVlnSH2tDSE1F+gk/nTZkMd/P13QnM=; b=AM00vJx8YutY2y03FGwOzMB4F65tCdTPaWerM11qRrgq55yZhS8ZGBFp0tpAVyO6Wb gUwNrDppdPLFqCHICaRzrcwXawyxIM1xDLWZTR4XVuNzTgSUC02vUfp8LzCl7S/VOFS7 ixqY5BL4KNH9gHHnwpnTTstkk7zIt/1fY/vKdXaW07IkHOvo7iskocXGhAcSWZcDHc+9 pq6xubaraFJR+yZ6ZDBB2CK7GaOL0fjp52QcsGtdnG5Cq/zzyxIo/UL05C6//UP+ZNtI mnGXbC+CLflXmPAY7glOl3xYRbPBxliG0LxRCw2ZtDSsfhE3jDSaWvqfAHkic75hGp5c eCZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1I1nXLI6APgtAXVlnSH2tDSE1F+gk/nTZkMd/P13QnM=; b=GZI7ZG7aS88+dP9KYjFMRQGWc3PodWtXgFFF+EjRFe27iUwpyPtEHrjbeL4mVRnOZD E8jPU6q1KJZX8K2XWYbuT0UsEKOHMk6ONlC9hTYdSh9F/zYPYhEDNat0q1sfg0pn6DhY 3Gim5HFzKIQ1/E/nkyJYeIYOA2KNwqO7VgDyBWlMYtjvzD+cVllqv2Cj/zsRR5jIycrH HpbOSVXT2yGWJYiY2nLTt6eVvba62s7Zg4ZiZcEUiZ2MrRXqCa8FS5ZF9Kd99vLENd3f SItE65hgwwuG+GuLZO9PttxZh+fGhi2KbzJI0YAIAjyrTF/uBibVMlC57e3iM/NolT5H g2qA== X-Gm-Message-State: AOAM532RJEs7SnEIxk82ZY86sEjNJMw0tohUC24Sa7EeCuhF3lw2Cgnm RdHAtG8v4JePgFe9Yb1f1jP3gion0EgTq/9qX1o= X-Received: by 2002:a05:6830:1089:: with SMTP id y9mr3930400oto.335.1632986602241; Thu, 30 Sep 2021 00:23:22 -0700 (PDT) MIME-Version: 1.0 References: <20210930062014.38200-1-mie@igel.co.jp> <20210930062014.38200-2-mie@igel.co.jp> In-Reply-To: From: Zhu Yanjun Date: Thu, 30 Sep 2021 15:23:10 +0800 Message-ID: Subject: Re: [RFC PATCH v2 1/1] Providers/rxe: Add dma-buf support To: Shunsuke Mie Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Alex Deucher , Daniel Vetter , Doug Ledford , Jason Gunthorpe , Jianxin Xiong , Leon Romanovsky , Maor Gottlieb , Sean Hefty , Sumit Semwal , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, LKML , RDMA mailing list , Damian Hobson-Garcia , Takanari Hayama , Tomohito Esaki Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 2:58 PM Shunsuke Mie wrote: > > 2021=E5=B9=B49=E6=9C=8830=E6=97=A5(=E6=9C=A8) 15:37 Zhu Yanjun : > > > > On Thu, Sep 30, 2021 at 2:20 PM Shunsuke Mie wrote: > > > > > > Implement a new provider method for dma-buf base memory registration. > > > > > > Signed-off-by: Shunsuke Mie > > > --- > > > providers/rxe/rxe.c | 21 +++++++++++++++++++++ > > > 1 file changed, 21 insertions(+) > > > > > > diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c > > > index 3c3ea8bb..84e00e60 100644 > > > --- a/providers/rxe/rxe.c > > > +++ b/providers/rxe/rxe.c > > > @@ -239,6 +239,26 @@ static struct ibv_mr *rxe_reg_mr(struct ibv_pd *= pd, void *addr, size_t length, > > > return &vmr->ibv_mr; > > > } > > > > > > +static struct ibv_mr *rxe_reg_dmabuf_mr(struct ibv_pd *pd, uint64_t = offset, > > > + size_t length, uint64_t iova,= int fd, > > > + int access) > > > +{ > > > + struct verbs_mr *vmr; > > > + int ret; > > > + > > > + vmr =3D malloc(sizeof(*vmr)); > > > + if (!vmr) > > > + return NULL; > > > + > > > > Do we need to set vmr to zero like the following? > > > > memset(vmr, 0, sizeof(*vmr)); > > > > Zhu Yanjun > Thank you for your quick response. > > I think it is better to clear the vmr. Actually the mlx5 driver allocates > the vmr using calloc(). > > In addition, rxe_reg_mr() (not rxe_reg_dmabuf_mr()) is used the malloc > and not clear the vmr. I think It has to be fixed too. Should I make > another patch to fix this problem? Yes. Please. Zhu Yanjun > > Thanks a lot. > Shunsuke > > ~