From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 DA8A6C433DB for ; Wed, 3 Feb 2021 17:58:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 542F864F8C for ; Wed, 3 Feb 2021 17:58:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 542F864F8C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8066C6EB15; Wed, 3 Feb 2021 17:58:52 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F25F6E16D for ; Wed, 3 Feb 2021 17:58:51 +0000 (UTC) IronPort-SDR: n8W6UlC3LLLrO+lyrAM7rb71+ifi9KNgwZDJPA7oUO6+vVzz4FIZUBLvQqP0Kn3hGb8tLRIucH zqDXPhFnzRtw== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="168769217" X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="168769217" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 09:58:50 -0800 IronPort-SDR: YfuinT6kOdWDpeJMn6rriwCV7HTAUVOSbvdNqCkqKVmyX89rdkF/pgHwGT3NdFPGfU2v7x3YO1 yj7c/mZsZJog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="392565376" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 03 Feb 2021 09:58:50 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 09:58:50 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 3 Feb 2021 09:58:49 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 3 Feb 2021 09:58:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WauYF2zr7osr80+q/xzLzIP7ynSq3lFroNMxV9PMUldnYtzvq5fOLqdfkly87zI9EawLRjDKsqoZTisyGw8pV7KazYRwGU0sIANcjfCzS5umwNHVdKllzg/U8DBDXiPmhzJ99PoYWs3mNrSFqvDbjurecWWVoenc+1ipqs9we0M3dbQhcQ43OhFrRVaUS6St/RrHMIfaHEqIL9P32fRhPd0eomuf34TMR6zVVDuAZsFnbzEZgHsjCrBbA3zQrdXQaWJnTggFqy4l1r1Lvryqu0SADDZJ1mO9++WGM5eHY2xFQlnIJKyYZIlq/9CZd6CvIxiqPRVQNcznmhyURu4Klw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GaJ+QqxjRAjkpi1i1DMqSh06Ab+F/ItEw7c6jc18GbM=; b=Gkb21svMnj5UkQ1E8xikxEnlhSVBvzQZGc6RmbdCpT+8z+JDPvZe+3BYAWklasYYJogfyxMIvtf+J8QnXSfD/vzzbO1q5FlkbzbWhhJkYWKsaw1O4i2MylM8NgQmCDbkCnIDTKyUYVoVl1E/sloQNb8zVvIjJzjm0/0NmUg8kG+CTYnKsw4WHlExx3BxAUqpoIkmlhJ5lJAb8u1luAXtc0j7lfE+18szJGGUgw5E7ZvDTDPPn2cPhBF1cUSM7X/Zz9jEb8d1NGIaO5+IaBrxt/2+nbYRrqihRraUrm6x0Y8Eb3/MUWplz98prkX5ttnXDTG03cTi/wIXJBhuZkvsPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GaJ+QqxjRAjkpi1i1DMqSh06Ab+F/ItEw7c6jc18GbM=; b=TS/RyDO7XxRnrLUt2rrCBAXmQqz1H8BWhGbu7OMf3ZstX3fa81BhcK3Di42pMfmIJu+u62InTnOceH+3LAh+DdpJegFgjLKOpiH31KfMRlaKRCBydcopDr12HGXfEpyipMS7f/Atcquy7MpxYYlxW7rycaKwr3BP7/cup5RzUJA= Received: from MW3PR11MB4555.namprd11.prod.outlook.com (2603:10b6:303:2e::24) by MWHPR11MB1535.namprd11.prod.outlook.com (2603:10b6:301:d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.19; Wed, 3 Feb 2021 17:58:43 +0000 Received: from MW3PR11MB4555.namprd11.prod.outlook.com ([fe80::4476:930f:5109:9c28]) by MW3PR11MB4555.namprd11.prod.outlook.com ([fe80::4476:930f:5109:9c28%6]) with mapi id 15.20.3805.026; Wed, 3 Feb 2021 17:58:43 +0000 From: "Xiong, Jianxin" To: Daniel Vetter Subject: RE: [PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR support Thread-Topic: [PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR support Thread-Index: AQHW81IsBXvBf9ch/Ui3XtDALqd1H6pB5ZYAgAD3NICAAIRsAIAAFi0AgAAZeICAAXeSgIAA9XkAgACyvICAABOigIAAAIWw Date: Wed, 3 Feb 2021 17:58:43 +0000 Message-ID: References: <1611604622-86968-1-git-send-email-jianxin.xiong@intel.com> <1611604622-86968-5-git-send-email-jianxin.xiong@intel.com> <137f406b-d3e0-fdeb-18e7-194a2aed927c@amazon.com> <20210201061603.GC4593@unreal> <20210201152922.GC4718@ziepe.ca> <20210203060320.GK3264866@unreal> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: ffwll.ch; dkim=none (message not signed) header.d=none;ffwll.ch; dmarc=none action=none header.from=intel.com; x-originating-ip: [73.53.14.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 488c9d5a-f5ab-4b94-9867-08d8c86d589f x-ms-traffictypediagnostic: MWHPR11MB1535: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Yart6WFz1fj5+phmHvwmTDuIBUCtUYJshRIj5D41PSxS91dfIEHb2TGCNleBz76+/RBV/HU/QONQTOXwqM+40VQejDC19PUU5oujQwOQuR4Z+X7rLq9luiF5/nyUV8Y9BKr2zJEZsLxt9eE3ng1kLlZPAIf/INc/8JomSP2XelgpPBEslt4ftyMLFNEjjHUldDf3iad42Pb/cEvGO5dQiUc2NaeUDhlHzhY4jL/vLQ8Lzvy1Iq0t2jlWNKe1QiM6fyaBgWuQS+5WhQPlBd2vP5/GeCyOgK5ufBrD+AtthOh5EC8tV3MCSMvyWsIFII8AgfZqZTkDfRWsqNDIG/xhhivUMNXoP8nDrxC0V6kLvGLsgm/udh1qdpa4ZxhLd26KtT0qUsiOoGuzgo4ObcPG38Ccu1dywtp4jcjVp9qR9UYq2ZD2HFoaCCROBlppoIIAthOY68LqORJH+x4EJBo+HJHxbTmqLYah6Kju3kDvZwAb07v56XzoeQEKGP4WZRGyQXqk+jBsyttlbLGM08enNjV+AqHPQJWdp/UUeaCs2eFPb5etWRe78DhAvkWpQIO7gOOBuXJ3sLFdtKjLaG7r0QHtoyKfqXZ1q2wAdlJ1Itx+rzKWC56RDz0wLWcWVCcH+pEvTsIDJGoTvQMv3d4/ai5CRWRK+uhp8uLu/LrkeFg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW3PR11MB4555.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(39860400002)(396003)(376002)(366004)(136003)(54906003)(316002)(33656002)(9686003)(6916009)(478600001)(76116006)(5660300002)(66446008)(66946007)(8676002)(53546011)(55016002)(7696005)(966005)(7416002)(2906002)(52536014)(26005)(186003)(107886003)(83380400001)(8936002)(4326008)(71200400001)(86362001)(83080400002)(64756008)(66556008)(66476007)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?ut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D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4555.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 488c9d5a-f5ab-4b94-9867-08d8c86d589f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2021 17:58:43.5535 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9KX4Go7Slox4+zerCMgv7z5PeKNON0VVDuELR3bF+4SCZjf79S5SXTfLkP/VTFTQTvjDwwsKmi5TFfYiR3S6vQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1535 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yishai Hadas , Leon Romanovsky , linux-rdma , Edward Srouji , Gal Pressman , dri-devel , Jason Gunthorpe , Doug Ledford , "Vetter, Daniel" , Christian Koenig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" > -----Original Message----- > From: Daniel Vetter > Sent: Wednesday, February 03, 2021 9:53 AM > To: Xiong, Jianxin > Cc: Leon Romanovsky ; Jason Gunthorpe ; Gal Pressman ; Yishai Hadas > ; linux-rdma ; Edward Srouji ; dri-devel devel@lists.freedesktop.org>; Christian Koenig ; Doug Ledford ; Vetter, Daniel > > Subject: Re: [PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR support > > On Wed, Feb 3, 2021 at 5:57 PM Xiong, Jianxin wrote: > > > > > -----Original Message----- > > > From: Leon Romanovsky > > > Sent: Tuesday, February 02, 2021 10:03 PM > > > To: Daniel Vetter > > > Cc: Xiong, Jianxin ; Jason Gunthorpe > > > ; Gal Pressman ; Yishai Hadas > > > ; linux-rdma ; > > > Edward Srouji ; dri-devel > > devel@lists.freedesktop.org>; Christian Koenig > > > ; Doug Ledford ; > > > Vetter, Daniel > > > Subject: Re: [PATCH rdma-core v7 4/6] pyverbs: Add dma-buf based MR > > > support > > > > > > > <...> > > > > > > > > > > > > +#include > > > > > > > > > > +#include #include > > > > > > > > > > +#include > > > > > > > > > > > > > > > > > > I assume these should come from the kernel headers package, right? > > > > > > > > > > > > > > > > This is gross, all kernel headers should be placed in > > > > > > > > kernel-headers/* and "update" script needs to be extended to take drm/* files too :(. > > > > > > > > > > > > > > drm kernel headers are in the libdrm package. You need that > > > > > > > anyway for doing the ioctls (if you don't hand-roll the restarting yourself). > > > > > > > > > > > > > > Also our userspace has gone over to just outright copying > > > > > > > the driver headers. Not the generic headers, but for the > > > > > > > rendering side of gpus, which is the topic here, there's really not much generic stuff. > > > > > > > > > > > > > > > Jianxin, are you fixing it? > > > > > > > > > > > > > > So fix is either to depend upon libdrm for building, or have > > > > > > > copies of the headers included in the package for the > > > > > > > i915/amdgpu/radeon headers (drm/drm.h probably not so good idea). > > > > > > > > > > > > We should have a cmake test to not build the drm parts if it can't be built, and pyverbs should skip the tests. > > > > > > > > > > > > > > > > Yes, I will add a test for that. Also, on SLES, the headers > > > > > could be under /usr/include/libdrm instead of /usr/include/drm. > > > > > The make test > > > should check that and use proper path. > > > > > > > > Please use pkgconfig for this, libdrm installs a .pc file to make > > > > sure you can find the right headers. > > > > > > rdma-core uses cmake build system and in our case cmake find_library() is preferable over pkgconfig. > > > > Only the headers are needed, and they could be installed via either the libdrm-devel package or the kernel-headers package. The cmake > find_path() command is more suitable here. > > Except if your distro is buggy (or doesn't support any gpu drivers at > all) they will never be installed as part of kernel-headers. Right, that's why we want to check for the existence of the header file (find_path() does just that) instead of the existence of the package(s). > -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel