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 840BEA0C45; Thu, 10 Jun 2021 17:16:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B99A4067C; Thu, 10 Jun 2021 17:16:49 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id CC1F64003C for ; Thu, 10 Jun 2021 17:16:46 +0200 (CEST) IronPort-SDR: P+KaYQsclYgL8xq4DetqJaw2AtnuJnhe2aGefR/TZc38sJHGjLxAcpqr+3Ql0kKY+lZAhWe+HA GEmbuyYbKsmw== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="192431574" X-IronPort-AV: E=Sophos;i="5.83,263,1616482800"; d="scan'208";a="192431574" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 08:16:45 -0700 IronPort-SDR: IKsAdvy5CVkLL1ziYkp5Sq6/1hVw1UFdKMuZomjcETwyH9HMv5cnR9IYDBTTiXwrMWHL+W6MOz 1Wnu+aD03EdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,263,1616482800"; d="scan'208";a="552387854" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 10 Jun 2021 08:16:45 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Thu, 10 Jun 2021 08:16:44 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Thu, 10 Jun 2021 08:16:44 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Thu, 10 Jun 2021 08:16:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DsUctxzYn5n6tNhObtrHBx7/UZpxhhHTnLoLBZzzDGlTQNvKILwnTvKeNp+dzY+TKJLMhrBX56h4SARjdsTGE1EMvXwInigGdWo57K4N1ov8faVxghh9LBhccnF+opOOyxA89muoZLRnIKw/2rsaltRC8ezdowRthe/x4+XnjqgZWPADo2ELq5warF9wqu0UYh/oXE3ZBUdvmP4vEeXqjs7+OBnV1BLPBL/b+RFk69tGIX+Ll34InF0jkHACjcQR9w9WgzLRwJgp4a5LgRMJWC7wqvuPSvA7m7fVDdpZskveLIYL014i8fg1jwh34E8b76dOszexydh49+aElGywzg== 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=8IU7/xucnA9VeD1QY/eRTLTWT7rCgSJ5FAMFEAXnWL4=; b=kcophLWAcBfTM0iz7Y5fkCqA6f5Wc7sNXmHZxlSUveogJOWn8Ql0I026OrJsMNiheDHet6sWm6F94Lua08eHWqfllaJGjan/tsCLPgnwO3xGIVz2h/6gEDFb+CQU6ENhPRGX8HwqHO9T8QYMfN0aPgpa2uAtqTF0PExdRw8o8TBEbea3xmxOqx2rTjZt0SKHIhSbWd4BGbpYhHMiHFMECSsMFfLV4DVjvk7NQdZoH/5saPLCi1csD6B/qMcE+n1GBG+qOqgtkMlNVfotTSqE4Llr6EehAfrLiF/Ap1NoK+t2FVLm+mftErSl90mRqt0ltnVPC5ZBeu6LImiGglh+1g== 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=8IU7/xucnA9VeD1QY/eRTLTWT7rCgSJ5FAMFEAXnWL4=; b=d07lgjprk8FnfqXPci6qUVcvke/re6W2k3oG/SYt7k5ohYZoVab/UWcGxoX1hQyg+7wJGFrpuiAOg3vo7WOe4IGHlB8v5F/lBbwS1uy8D1ndNyeIXEVf0lq0vnZ9DbshoM2OAFVjoaFvh+VTb6U2bCECGyLt15CPPMgq8ZWJlBc= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN8PR11MB3556.namprd11.prod.outlook.com (2603:10b6:408:8d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.27; Thu, 10 Jun 2021 15:16:43 +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.4219.022; Thu, 10 Jun 2021 15:16:43 +0000 From: "Wang, Haiyue" To: "Xueming(Steven) Li" , NBU-Contact-Thomas Monjalon 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+FlHyuhQKuP6sJ62AAgAAMPRCAAwESgIAAku+Q Date: Thu, 10 Jun 2021 15:16:43 +0000 Message-ID: References: <20210413032329.25551-1-xuemingl@nvidia.com> <20210510134732.2174-1-xuemingl@nvidia.com> <2237980.2ZMkXp7bNk@thomas> In-Reply-To: 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: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.143.19] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1cdda616-09ff-4e65-7764-08d92c22c16c x-ms-traffictypediagnostic: BN8PR11MB3556: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:449; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: n//we38pRAlTch5bxXCaP2y6edn8zJerRoy+blTTSr+0efVfEYZmsHtEyrXY7HAV8QydlRd2A9A6dKtWMn3fgceM5oPYpQyHLcKslM8ARsfmdf+vUrk4UVz/I68T1DawvD7FRLNT+nY3DQGIMdhO+mjGUtOVnxLr8zIZ8ZhPmcYAQ/bbHGaN3CWlVfiWTYqj0aU/ckt8fq/itSJMG/x+lTmlP2JLK5OeNJi42qvSE+ISLRPGQpsayChmpTaopelF0VnYXz/0Z4RyyzgtWcWu2UhvKA5Llf1k9g2yuZbelBTr9jxbNTN1GPDCNB7aImMI+o5wKZd6Kq80lAXoc7fySS7NUvw2jvvL/Ax1IRjXf6U5nlQOIrR7FN7i12QWH+7gD03mVmjPrfZ2d3Y1C4tzXAPPgXym8S/gBJeTDrXM1fq0TmpV3084upuTt133GO6dGUTGLQd8a01nLfVeBC02emG1494rTQttPfdMFs2H/g/u25E4O0pGvgLiyxGo4+td4qDcURKglGVqLkxsq6SZJC95e3+bl3VAseStRbp/yALNag3WGZqB2COxykikA4vq8ExfMDTVfNHoeDmOMLHHaIwjeKu4C7S3bhYyO5D8QlZ3nb9oOMUvch4hXfiZa2sn7Odv419LNrMzMZpp0AYjxahQXb4PsdX6VJZc059RZDdNK9aGc44odwB/6r1gvBckHRYLqdVhZPLl+uuoh0EIStfGkd7sVzUcpG98ZpQMoU0= 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:(396003)(376002)(39860400002)(346002)(136003)(366004)(83380400001)(86362001)(54906003)(8676002)(110136005)(4326008)(8936002)(478600001)(966005)(122000001)(38100700002)(316002)(7696005)(2906002)(53546011)(9686003)(6506007)(55016002)(66476007)(33656002)(66556008)(76116006)(52536014)(71200400001)(66446008)(66946007)(64756008)(26005)(5660300002)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4Ku9VtHUCY2nvZ04Df9kOJDFj2NqZFUny9wYB69NxY5fgcxaJtY2f1MZK414?= =?us-ascii?Q?hwvUlWSE41ve0wKa3Uq3pyG7qrXVRktkR/O9ATljF7MNoQ1/jKT3XQWAWhtY?= =?us-ascii?Q?tApp3acgHO+zXAUpJ4P65YLqc9FlTUYHFOnpxeT7ogHSnF9eEcuLohb1jydK?= =?us-ascii?Q?7ly1MyocUxANXrrH1GVK0qJQAcSlZFFTd3k0c49ewVJ7HOz4GLGypHb43x+1?= =?us-ascii?Q?5/zSJZu2jcwEnKyPExP3DwuLr0Uux7+SjjHn0tAK06Yq4i8DyECcTaKcZtuY?= =?us-ascii?Q?eoEjDT032zhw/XZFepN3Xozz8f4j0EMbVj67yvPqvlYc/V8LvoCmQRHZULKg?= =?us-ascii?Q?BNmkm3XEEjqZ3Wpk05xtwlkIUwErcVMH+g6Rt5MNimgxvEJYMIZMuZaT7uxF?= =?us-ascii?Q?xOaQKIkCIGPTqrUXtbgqKqzC8OTISD+gVXlowIRz6D8+/bQj1sBYLyWkDn/O?= =?us-ascii?Q?5BGGj/K/LGWiqBTuhs5oRhZIs3ZAb0bVq69TeEhju6vcfxey6uNT50UdMY4k?= =?us-ascii?Q?ba7y4bk/32GnFYGTbUaeg6Aa2kSqq1YSh8BTBSpCrM6rtiSJVqkRm3IyZ4pb?= =?us-ascii?Q?6BeZYmaURr1NYUjuTiPdxIWVmRG3XGmyGDNGTBO3ND9UACXEKqivP/C8WBrO?= =?us-ascii?Q?yoJFAs3LkVBqXaorUN6IT7gjJ3G5n6pa39lNWO1Ghr+N3iCQbYrqZC+Hjfx9?= =?us-ascii?Q?ACwi6enTugGUXJbGvBYGhhIlxckTXDNPHakAJuzLSfKrzsiS4WVDbbpfUn6J?= =?us-ascii?Q?41sy0LqaVenN0fpg5uFuweiL5FvWmkc8HIdbmJpip7nlNq0hJTbcvp9d/2+0?= =?us-ascii?Q?dwHzRuK649SSsh+CNiX+24LSTsosx6nxs2oLr3WiKu23jMenikeLvjLsXXCS?= =?us-ascii?Q?et4y2kDLBtii972KNQZnuly0lWB73YoG7LfdcxJRF/9wOwnX+g3ebey5j0uM?= =?us-ascii?Q?ZAoPZk8Os3Zai2IF+gyQUegeSbOnsxIDfMWz3IOT4YhmjJKVveaty0A9Xog0?= =?us-ascii?Q?HKJW0fjCnpgeBzJJSbaBaHzh5+fjiIz9ZAXzcZ3aanAdiCoB5b9a8IaFE+im?= =?us-ascii?Q?FzXptDu+44Fuy8pNkVO1q9heMMpsB5pWQhpafPwZsakh1IZwiNnlXvVL44A0?= =?us-ascii?Q?GbhezvjVbMUXQfW3LSNrOPwwAE6RctAUYWR6obemc40YPR1n7Lps6tdS34Aa?= =?us-ascii?Q?WNGxoZz8HtrowiVXocNr3lN4RdvRTGjKXgXumisEoc5LvKlCZaAmHaOif1RZ?= =?us-ascii?Q?tiQsW8dQXfrkQl2jE/EwqFOeyFPR3XirZ6tNcPjr4V+p+GtmejoAGixcRxKL?= =?us-ascii?Q?hglYTuoA6p5xn+kWsJpzQ1ue?= 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: 1cdda616-09ff-4e65-7764-08d92c22c16c X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2021 15:16:43.3887 (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: ZCgQjx00pUPGV9Y+CMQw0UE83NUO8d6Tfh+pNx+bLicpQfDdcdSzG8zHkK5d3mQC0pTO/S0i5ghb0gmsp0XQaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3556 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" > -----Original Message----- > From: Xueming(Steven) Li > Sent: Thursday, June 10, 2021 14:30 > To: Wang, Haiyue ; NBU-Contact-Thomas Monjalon > Cc: dev@dpdk.org; Parav Pandit ; Ray Kinsella ; > andrew.rybchenko@oktetlabs.ru > Subject: RE: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus >=20 >=20 >=20 > > -----Original Message----- > > From: Wang, Haiyue > > Sent: Tuesday, June 8, 2021 4:41 PM > > To: NBU-Contact-Thomas Monjalon ; Xueming(Steven) = Li > > Cc: dev@dpdk.org; Parav Pandit ; Ray Kinsella ; > andrew.rybchenko@oktetlabs.ru > > Subject: RE: [dpdk-dev] [RFC v2] bus/auxiliary: introduce auxiliary bus > > > > 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 > > > > > > > > > > > + > > > > +/** > > > > + * Match function for the driver to decide if device can be handle= d. > > > > + * > > > > + * @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); > > > > > > 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 > > > > > > > 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 **)'= {aka 'int (*)(void *, long > unsigned int, void **)'} from incompatible > > pointer type 'int (*)(size_t, void **)' {aka 'int (*)(long unsigned in= t, 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 *= , 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; > > | ^ > > > > > >=20 > I don't mind as both suggestion works. I just want to understand what kind of error the compiler will complain abo= ut. ;-) > From usage perspective, it's straightforward for anybody to see an pointe= r field and know "that's a > pointer to a something". >=20