From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3972A42B6A; Mon, 22 May 2023 05:42:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4AAB410DD; Mon, 22 May 2023 05:42:42 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id B4F4D410D1 for ; Mon, 22 May 2023 05:42:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684726960; x=1716262960; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=T3hfzzFQeaGVcVKlXa1sM7qVaTIJFq1PbfEoJv6ddIs=; b=nJNa0rCLgx3wMU1YdDe1ykj05bkaC4EmW76hziWDGHurSo8JLmqXmXhK 8SqageGx2x4v+IDgxlFv0h67rG1bqvbBQloMeVzO0qadVtLpdVK7F4WGg haklHQ5hylf+3+wViP58z/R7hjuAmtcTALBF3moVkHK14bL+pbtxT5GdX RJ9Iu4cIvGGdQvz/+NXLFvlzKFOcwHfHBisEM2CGobMBTwt2MV7kVrrBZ 2TS++FeMoKRkVVSTcxDL/3Z60JdzY+N+SzdIuC/qvhd/nVAzy+fKbkH+o 1RQHwKBN9acS00CgAiAO7tOD3LO7XiQTJycgvn7CXQ9jiN39MZ96RVKOj w==; X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="351668570" X-IronPort-AV: E=Sophos;i="6.00,183,1681196400"; d="scan'208";a="351668570" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2023 20:42:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="703342925" X-IronPort-AV: E=Sophos;i="6.00,183,1681196400"; d="scan'208";a="703342925" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 21 May 2023 20:42:38 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 21 May 2023 20:42:38 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 21 May 2023 20:42:38 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 21 May 2023 20:42:38 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Sun, 21 May 2023 20:42:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJm0qawUT9KFSNSinm3+WteKfLuncRM/zEzBnE0XjjYjKD/2Rt8mVsH3Xbg0gi/2TfgJ7ZEuZ4jigJ/0qPa/4sRBlSprK3ibRqkA6m9ADYXGxQIA4i4ycBHXkUS6UNoWfKdGwCKUKkQTZsZ+eVhBeHDWFDe/6MkoVKo3SNHMFcReOay/Q4Aza8drtrsK+OsPEsexVVKqq7gdLDWazmz21m2laI0t2HUmbkSsQ/94+008zuYCtaMRlVjVQJDusEpBgGOXrmU06auNZ2sYZJ0XUR7HjAbKXR7FrnCA/GrYib1e+vRpNMl1b5uJEuYPZyk98XZxoJNNLGKjRAqWBju7eQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1NhNUJcToDyCZhNOwhWMXpCyn/RRuF7gHzPgoxDEVJ4=; b=M8cjTYrRMn70HwuwVgVu6DoXGSppnyOQt5Kp/bCX4JcYnjXDSBCLrlrhj2XwWVSA3X4Yjj0RRLiBwaip1E+BjFUxGL571mVhjRLSISDXwKg9OJ964XeP0LttEe8PTdXZ7FYrwqBX8+ST74pCrF5gsNp45DSS4b+2d98t5NvbfWlfaXXmmap6EBzyS3cNfvG8sdztormjgOUuFK4A0mOxd2hVVrhfWWdTtrfEujZlbRBDTmK6hC5nS9fkpWMx9vpMUSDVHiILfZAKSb76VdpCYPtKgxH6OwqzfQQ6x5EeRtt5iv7QIfDSyQPLRxQVw6LQR2MQRqB6CvvJBGl0blvxdA== 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 Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SA1PR11MB7132.namprd11.prod.outlook.com (2603:10b6:806:29e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.27; Mon, 22 May 2023 03:42:36 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::e427:f0a6:8472:d0f6]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::e427:f0a6:8472:d0f6%7]) with mapi id 15.20.6411.027; Mon, 22 May 2023 03:42:35 +0000 From: "Xia, Chenbo" To: Stephen Hemminger , "Li, Miao" CC: "dev@dpdk.org" , "skori@marvell.com" , "thomas@monjalon.net" , "david.marchand@redhat.com" , "ferruh.yigit@amd.com" , "Cao, Yahui" , "Burakov, Anatoly" Subject: RE: [PATCH v1 4/4] bus/pci: add VFIO sparse mmap support Thread-Topic: [PATCH v1 4/4] bus/pci: add VFIO sparse mmap support Thread-Index: AQHZhvkjtrq27kfD8EWY3hVT3E7PTq9bfKaAgAox22A= Date: Mon, 22 May 2023 03:42:34 +0000 Message-ID: References: <20230418053012.10667-1-chenbo.xia@intel.com> <20230515064700.624054-1-miao.li@intel.com> <20230515064700.624054-5-miao.li@intel.com> <20230515085249.283dd7d0@hermes.local> In-Reply-To: <20230515085249.283dd7d0@hermes.local> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3504:EE_|SA1PR11MB7132:EE_ x-ms-office365-filtering-correlation-id: 154a07e4-1161-4b7e-946f-08db5a7694a6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MkffR3bLq8/m5P52ZwwMQxUsaIwqsSdDhhr2OBlA8hAWDY6iT3qIlD8wKf1DE2ltAMobcmPeP8RPn8kEj/jRhay7Zm/eaArOCrdGoPof+tnCjo073//A8d9ignpeBPsbUv7cKkioDAI0jnmBP0BdkwCLo8+fNktpTtmKX1S+gfcGF3DbGuiiBz3NqySf8FUfoeSSE94vzofDOVM4DpTt0xGgt+SIYLu6NdZq9Xd040QHJlcEWJDWywJz7hKk38Qlcby6VVLThzGOm9YCkJJEBZKOFpATyDcB2Ah4ZCEwvVmdOBlA8ynVL1VHEJztT7UtXIB5TdVuHIp0RxybyHoj/VEeEhslqMqNOmHhymYza1ITiP2COTaRTywKtY3CK6orH1zSSLzyRJLthbgppGPAEJqD2+SHiRMbuhy8xJDR2w2ZNkHLwrsGOHttVpD07rztOdSFAJzZFE0/xXUn35NHqFfJyleTCRqXGtC1miNWKaAJwW/GP5et3Lor9uQMjbtTdP/LjERgUOPtqNijITLjvcz1lVMaYFU6AVBa/ZbRD/em0TRS+hdNfh4BGzpqQtNWRPA3SbY5XeeHEq/r0ja6U2jZbey6l0m3OFh/5WOBmxTSL2yc0F1g84QFpSL28daI x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(346002)(396003)(376002)(366004)(136003)(451199021)(5660300002)(52536014)(8676002)(8936002)(86362001)(33656002)(6506007)(26005)(9686003)(53546011)(83380400001)(2906002)(4744005)(186003)(107886003)(55016003)(66556008)(64756008)(66446008)(66476007)(4326008)(6636002)(66946007)(76116006)(122000001)(82960400001)(71200400001)(316002)(110136005)(54906003)(38100700002)(478600001)(38070700005)(7696005)(41300700001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qDf4UV9asCC84uTEDHWtGVAx9mLnT1nzw7z1T+fAWtBHKYD9AjvfmuC3R8mt?= =?us-ascii?Q?v4ySCBPjo8gOWcWaUIfTm5FpWPXxoq/hv1MT/YFFVHxqv7gxoy25zQBXqq07?= =?us-ascii?Q?s4Nnf/XI1NKRyGTp9M0oEMHIpyWj/x70XeYAD9LcrBfvzp+hRSd8L2WPv6Ii?= =?us-ascii?Q?PWN6F3IrgH26autrlkoca0lVsj+JibVgbhwFjIlyJ2Tb8mygioJRSV8fpLXA?= =?us-ascii?Q?jdagqSiQIExhzHqCO4uEbhgej+zxAuERMZZtVTcHSy+u4DYCRg+lviToLFJo?= =?us-ascii?Q?dXADjxxaBazBQTQGEVb/sDaVoGZwA9/Q/OgJPZTqhV5yL/d0m8E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VDbI/8/jQDD4YR5jeVLvucRit1+iwQauwp0MW+QJZn?= =?us-ascii?Q?wmX8YIGFGwJFNFS+UYsBtVJCY8+3RDYQrwV8GsAsyKUdD6yQ75EIzluiVprH?= =?us-ascii?Q?Wt4SeEVue5Dp8vEAeI5jPA54a/E0US5rCMApFQ5zmBv65haKwpmw0q+9fmsa?= =?us-ascii?Q?KxP1mBYzqkg0JhI0Nk/+Gs0X25cJlNGy/9YqfbZw0DZwNTbkkdyvZkXdEumL?= =?us-ascii?Q?QtWc6HEBWvraxK04+LVjb5DpEIXg9Sv3ODDfQSf0fmrLcWNLsYhDhTQPf1Am?= =?us-ascii?Q?Uv3AYK2Tp7cTlMPMIYncM43OeYrtOZ2WxcjIKnxtfXQKnRT/lhP1DEBauIax?= =?us-ascii?Q?kd/N1BitkIMxnZZlfU6NQfbGDr/EpV4Lri/Lyc2r?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 154a07e4-1161-4b7e-946f-08db5a7694a6 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2023 03:42:34.9143 (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: LhiT0gLJvpNpXBsN0HewLxdaNX9PEOmaTxwdqgvFt16+OpYZQjetkwC1bj7oBfJR0Avie3hg8Itslq5DXpWG3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB7132 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Stephen, > -----Original Message----- > From: Stephen Hemminger > Sent: Monday, May 15, 2023 11:53 PM > To: Li, Miao > Cc: dev@dpdk.org; skori@marvell.com; thomas@monjalon.net; > david.marchand@redhat.com; ferruh.yigit@amd.com; Xia, Chenbo > ; Cao, Yahui ; Burakov, Anatol= y > > Subject: Re: [PATCH v1 4/4] bus/pci: add VFIO sparse mmap support >=20 > On Mon, 15 May 2023 06:47:00 +0000 > Miao Li wrote: >=20 > > + map_addr =3D pci_map_resource(addr, vfio_dev_fd, > > + bar->offset + sparse->offset, sparse->size, > > + RTE_MAP_FORCE_ADDRESS); > > + if (map_addr =3D=3D NULL) { > > + munmap(bar_addr, bar->size); > > + RTE_LOG(ERR, EAL, "Failed to map pci > BAR%d\n", > > + bar_index); >=20 > If mmap() fails then printing errno would help diagnose why. Thanks for your review! It seems errno will be printed in function pci_map_resource() when mmap() fails. So I guess we don't need it here? Thanks, Chenbo