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 CAE87A034F; Tue, 8 Jun 2021 10:41:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46EA44067A; Tue, 8 Jun 2021 10:41:31 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id AFF954013F for ; Tue, 8 Jun 2021 10:41:29 +0200 (CEST) IronPort-SDR: XcLgANWaNcV6ZMxdZPvvHg01M0HpCyCXOFjtSk7kcIDA0eXhjdwBuc+DLmW/ues2AUk1Yiqoe1 VMnFjTvk4vgg== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="268654966" X-IronPort-AV: E=Sophos;i="5.83,257,1616482800"; d="scan'208";a="268654966" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 01:41:27 -0700 IronPort-SDR: XBBq5wlIfEvTPJrct6IvOMSo8VL/fuyH3nIVz0LbLvmdVCL7Zh6M+LljKF6Z7Vr70L+cA4EwZ4 3iZfZoyEOWFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,257,1616482800"; d="scan'208";a="449446992" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga008.fm.intel.com with ESMTP; 08 Jun 2021 01:41:27 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 8 Jun 2021 01:41:26 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 8 Jun 2021 01:41:25 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 8 Jun 2021 01:41:25 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Tue, 8 Jun 2021 01:41:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PLB+Vjo7/rakHjLXDoufe/TJc/XxsyiopQOdZurODGNOu6WMJlM1KHlKBeP6+oUxbR0azQ6t3+agDFERb+3qWeS9cWa6T9AqKtBPDCiWqIu7JT3K137fcKPQ1OL8TrNRMa872l9/4YsoFMB3IO0MNh9IwhfeEmmv9iy0p7f3VjxU4CN4juyI3QAjjx79KSykwHZQQFZAaj+R8XGvqs2FWg2AyrAUjOenSvNyKADtCxFCLVxopPAUN7FTooSUd6chNGfluwcdkFG1pQLttODXkx87J/W7sczfTGvhj8qCycIo6GcQmb1nyzY0LnlBzW4Skj8y1rZl/uw0UnuGOZdLwA== 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=mgS57YbLEdYKHOLO6SugovpI6o3DsGnTlRrtoQ2Ogxc=; b=EyrXKTa+slaRPUUp2tjNkqpKC/6JH8TNGYfwZPxxDcmu0GlbpoT5WXOfQtd1HRn60lVTWbEMlRNSkOu3Jfs4ObVkmp2/uAuEbuQIxFIuj7TY8xjaxS6NlwjYC9GHz48ldTGuuAzjJWmCMdQMhLRHrNA2hUSLk3TkN1EyDH9x9myNSpUzfKT01bXQGY8MtkjRPmww4z9qL7jQl4YSLA7f1rwE/dK9SeSZ2/FsxB4JpeShb0nScK+I0a63Zf/bM77m4GSaHySv68IxaeIsDE4FzGFSm7F5WckLgME4XofJNYzSboEhZT1Tx7d4BX910onzE6oUjfqSvfKZJMl+dZeNsA== 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=mgS57YbLEdYKHOLO6SugovpI6o3DsGnTlRrtoQ2Ogxc=; b=UPDHq63k23LQ4IPCB7gIVGqn0mu4YcAuyJCOo7kEgaM7KtFkpDu9dgnZi4sqIIgiJ3HOEPeeZIQDxpB7newMOBkRk4iKrWArWgOjo5VnJIchPh+Lv/wkeByKMITnVWjClyYVo5bnqTUpr62KPb/u29tPuGPGFxi/zKlenE+9rzY= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN9PR11MB5292.namprd11.prod.outlook.com (2603:10b6:408:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Tue, 8 Jun 2021 08:41:24 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::8807:6661:e425:102]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::8807:6661:e425:102%7]) with mapi id 15.20.4195.030; Tue, 8 Jun 2021 08:41:24 +0000 From: "Wang, Haiyue" To: Thomas Monjalon , Xueming Li CC: "dev@dpdk.org" , Parav Pandit , "Ray Kinsella" , "andrew.rybchenko@oktetlabs.ru" Thread-Topic: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus Thread-Index: AQHXRaMhTlLTLjv3/0+FlHyuhQKuP6sJ62AAgAAMPRA= Date: Tue, 8 Jun 2021 08:41:23 +0000 Message-ID: References: <20210413032329.25551-1-xuemingl@nvidia.com> <20210510134732.2174-1-xuemingl@nvidia.com> <2237980.2ZMkXp7bNk@thomas> In-Reply-To: <2237980.2ZMkXp7bNk@thomas> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.51] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9b7b4bc7-7a2d-4f01-e3d5-08d92a5932c4 x-ms-traffictypediagnostic: BN9PR11MB5292: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:369; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NJDrmUW2AmkWJFzgD+5EFlbkcOV3wp1cKu1BGMC/zCeaZE16nxsaILtYeVhT2jMZVcLEVYMKE2eihABJ1cj4WG+od7XXKyFzo6JkuWxyTKwTUqJZZlefsPDN1gSKB6upLWbtgE3nZa1ygXUsBXcAjySuuaUJXtFAGt/J0jOhHKvaczBRUBWIBZnEBuWrM7UGV7SgbG0S/jy986cw0LiIudP1/yVhhObNE27RIlAyYeR+K5YZs9WCP7SAjHIY20l+RhQ24Mo51KgluCH3mQKtAgiHby3NKxqjecRXX3D+2iuZnpNd6zmJhwx4+t9a6ZRJtkeNRahjTIpkzyYytblSN2RAobhz0slMcAfiqKWe9SvDjoCu0ehcorEEF+cg2hFk2D8ofHVRQ4zOk8w11kLfWF7usN4focl0j7W/q6xGCXoqucro0Vj74NSvo01VcFdS5/IuRmXo0sNs1PkHV/eIFkBo8NUmYnjD0Z2sZJ5ydv+5MB9v0sQIXZhul8iGSPm+GYjaosce/yRjYmFRY9Z+GJ6Ig4625JvYYHa1WTGt9+JK2NWlxtLNMpSokXvHYGVMYoB+nQyjhawhrBjNS2ohblNBA6mYmLqFzrh/z0IjxxQDZcP6bn5UtbcKL/gF4ytieWwp1ZI30jlbR58pjQ6paJ+uZk5fELVeyQWG9DfT5hVOyjXsY0QjTKi8P23Rabcz4TDCz/BEIBPnrhOuYVUeFHLmd4E/e4HqAWtf2MfVDSM= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(136003)(39860400002)(346002)(396003)(376002)(66446008)(64756008)(9686003)(66476007)(66556008)(5660300002)(55016002)(38100700002)(2906002)(71200400001)(76116006)(6506007)(8676002)(7696005)(8936002)(53546011)(66946007)(52536014)(966005)(54906003)(122000001)(33656002)(86362001)(316002)(478600001)(26005)(4326008)(83380400001)(110136005)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Oo98yXqiBYpH957y9wAfw2wu+1u/2JzktUMSkCAGKJLZKO7X8V7O7ECXbwL4?= =?us-ascii?Q?+dCmBMhrQnerE1FFq5OjXdsuETVD3l21r6Dl97gwhKN3jaV7PBVEIaXOb14e?= =?us-ascii?Q?G+6NjNIJihry4YqBKkD/Z0KHH9nqU8boOIsSxX5aGREGBayedb9nycfObAro?= =?us-ascii?Q?iAuaI7ZwA5ZWYirYWxN/3ayr533U9wGTYLqDMZxH4lzrS2fPQfRXXMfLotvN?= =?us-ascii?Q?G/dXi0OWWB+Sj0thkAJXWCIzLv9FW72HgFwVNkr9mGGmSFEy2P3vvM3Gh7D+?= =?us-ascii?Q?cwLjOopraE+HZ8nuu2HcaRvns7AqFS5cz5owZzsyQYgwnhtXSKhPUja33Nqf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ve+/F8vsJZ4R8gLrDT+G950jgwtXsT90cVz?= =?us-ascii?Q?eWEoIDTmYPJRs0zZig9tLUL3tvLAnmaOSXenHV3boTFa0XDUAJlbdxe2bBIR?= =?us-ascii?Q?JyR0VN2QFlEolpyr0X/HxVFW?= x-ms-exchange-transport-forked: True 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: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b7b4bc7-7a2d-4f01-e3d5-08d92a5932c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2021 08:41:24.0436 (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: b8BX483PYQ5fPqOtuw+fA02djoxNZI1BKm1jgGRkkewHnMlAUG4DdlTA3ZMcqR1CuWlP9/EAI5jQP38Dtuci7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5292 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus 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 Sender: "dev" Hi Andrew, > -----Original Message----- > From: Thomas Monjalon > Sent: Tuesday, June 8, 2021 15:53 > To: Xueming Li > Cc: dev@dpdk.org; Parav Pandit ; Ray Kinsella ; Wang, Haiyue > ; andrew.rybchenko@oktetlabs.ru > Subject: Re: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus >=20 > > + > > +/** > > + * Match function for the driver to decide if device can be handled. > > + * > > + * @param name > > + * Pointer to the auxiliary device name. > > + * @return > > + * Whether the driver can handle the auxiliary device. > > + */ > > +typedef bool(*rte_auxiliary_match_t) (const char *name); >=20 > I disagree with the earlier comment asking for typedef pointer > (based on one of my patches). > Actually Andrew's suggestion makes sense: > http://mails.dpdk.org/archives/dev/2021-June/210665.html >=20 I didn't get the error, but the same warning, I missed something ? ;-) 1. w/o pointer #include typedef int (gpu_malloc_t)(void *dev, size_t size, void **ptr); static gpu_malloc_t *mlx5_gpu_malloc_fn; static int mlx5_gpu_malloc(size_t size, void **ptr) { return 0; } int main() { mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; mlx5_gpu_malloc_fn(NULL, 0, NULL); return 0; } gcc -Wall fun.c fun.c: In function 'main': fun.c:15:21: warning: assignment to 'int (*)(void *, size_t, void **)' {ak= a 'int (*)(void *, long unsigned int, void **)'} from incompatible pointer= type 'int (*)(size_t, void **)' {aka 'int (*)(long unsigned int, void **= )'} [-Wincompatible-pointer-types] 15 | mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; | ^ 2. w pointer #include typedef int (*gpu_malloc_t)(void *dev, size_t size, void **ptr); static gpu_malloc_t mlx5_gpu_malloc_fn; static int mlx5_gpu_malloc(size_t size, void **ptr) { return 0; } int main() { mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; mlx5_gpu_malloc_fn(NULL, 0, NULL); return 0; } gcc -Wall fun.c fun.c: In function 'main': fun.c:15:21: warning: assignment to 'gpu_malloc_t' {aka 'int (*)(void *, lo= ng unsigned int, void **)'} from incompatible pointer type 'int (*)(size_t= , void **)' {aka 'int (*)(long unsigned int, void **)'} [-Wincompatible-p= ointer-types] 15 | mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; | ^ >=20