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 79DB6A0C51; Thu, 10 Jun 2021 08:29:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67E6340FDF; Thu, 10 Jun 2021 08:29:38 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by mails.dpdk.org (Postfix) with ESMTP id 93B7B40F35 for ; Thu, 10 Jun 2021 08:29:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bzxDapz+YjAsurc2H+NhLhf5n9l5vDnq27dPX4fVC7XLEWgsmX85xofhIpYPUJg+MPzb1r18kTHFCSKB4JpoDLTPdSC9HE7ba/2hDGanxixTwkigUp9fkvyVFge1q7eWMki9f8EiJh8ztcw7DeHoOry1ntO0evxLM2hYJ7teeXDnratRPE9/ZxmQwKBNlgVVeqcSNEgz7JgUftvOYMQWJcZSYDnsWA9vA8tsYid8isKM83zkogrHGT+rbbsh4n8vvTtPNUt8zhFzQaQKoWDotKFb0Hnl6D7c/ogqwELqzOPw6+tKPD7b6p5G81Cvxke2V2PCgeyC7mRI+tTViO4Bkw== 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=Jn0qOkVZJ7p8G9o6ZYhtaWiCUNnty4+4XENT7/S9ov8=; b=aTswT7Au3tYeqVGSiJCSq3yV2J1WNiAckSWQy/JZSjfkI9YODzxqIGtWmUUIZvtHsH4oEoBvJ3drBZbGX/PrL1mjzb1wvO/oGTN+hoxunHD7jIvJFI10tbG2Tix6Yc3USE7r6/LYxBmw8ssrpojaHGWMMDPfPf0zRz/Lr3ECUQUA613RCrYDKaYDL63ZvPT7dkvBgFT+mBOStgu6IltDiATI4spweYh+w0xfvHP/RFUSkCiKHaRaQHIzDQAQ44H+xPU1exQ2CtWe82hTp/C96sprT0QKxlJ0oN8PvhE79Ds8wg9p+k8dDKTKRHNzTNaTzSZPkZmDwTILRahElQ+upg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jn0qOkVZJ7p8G9o6ZYhtaWiCUNnty4+4XENT7/S9ov8=; b=XOjWOCTzWM4WF4YuwbP/NQDH+jBIaM9jYxzKWbr0aB7UWOSXtYdxor6rXXDkQSOCcs07gf0wrJNhBk2Cp+LqvZDutQjAMiW7TG3fRkEt/IepAl0huwdyOl+p+xJGhF3TXrf2TCdZIT+4GgS+Vp5Y35NMSHS8qPbf+5OXF4a5hGLSuttLpxkjHjC4Iuk+j3mz11qqujAe3dvv/ZAUwgM5odePna2cFYat/+MwDOVrKVRuwulzW4bu32EvFOlV6AmYj3ToYN6FfTeM54ZlaWbk+e4ZJqnFdcSYqeYEd1B7QVL4Ey+AcITQFGd96rMbOuBysy9zh/SAgQhNNC7feeVZtw== Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39a::17) by DM4PR12MB5150.namprd12.prod.outlook.com (2603:10b6:5:391::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Thu, 10 Jun 2021 06:29:35 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::ac75:9b9a:a03f:1676]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::ac75:9b9a:a03f:1676%3]) with mapi id 15.20.4219.022; Thu, 10 Jun 2021 06:29:35 +0000 From: "Xueming(Steven) Li" To: "Wang, Haiyue" , 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: AQHXRaMW2n3Bl9LNrkiHlYEQ1JP48qsJ62AAgAANeYCAAv6A0A== Date: Thu, 10 Jun 2021 06:29:35 +0000 Message-ID: References: <20210413032329.25551-1-xuemingl@nvidia.com> <20210510134732.2174-1-xuemingl@nvidia.com> <2237980.2ZMkXp7bNk@thomas> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [223.104.211.130] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8e4e9b84-70d3-4e26-100d-08d92bd91d85 x-ms-traffictypediagnostic: DM4PR12MB5150: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True 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: xH5vrtDxYwiiWdp4/UQAqS/I1M0WJyfhxNZxDnKTIe8sPp8kTFVYpN0mxOT4oJxm39+3tKQJTZlCY2yGESypYvi2klhjO8OuIzGkWWNcifgaHcqLfO70Ud3wQO+s6Zr3QadxEyywqr4mOAtWEYGJNTojVMlWYbWJFcqxOc3GvoOLPMyq4S15IF89jq26sL/8eY6cnZyJHBpW+16z6La8p/JwIyH8DdNRAugv1/Bk5/owiuk8+yvutydQCrOoGSbk6wDvkwj4AVPi8gIFJNb2qwe/v54ULxhGTCBUs8bzFbAWTh2Th6B7wCQ8E95nw2pzazHJ5UMIb8yldKsLRtPMMjgHNCZhBBpUiiCBba6mNciSHxrife4fOs+/5NXH072jkeTBcc1Mgs1ekOjmbX9UPUb7REecRyGP64jOMQLWl090MC+9vxMs/k/3j4Ob4Gq47lf5l0kgHKNuparqRny/+8ux6hhFpXaEN6sNnu+gySNwGYd7lMpsaQGmRrmaO0D3gwPHKs2ZCppriKtMtIBkmKOSnJW2DPqqdty+pYQR6GizodFPFXo3RoAc8somQbvmjhgS7j6cbcBuNCUg/Ts7LsoFiQr+PlfAfn56j4RpXHih6QpDzPOG0Sa64KWnrTB9Wu3khxZWFXHTUehMbQGdfXAVURSkpnYYljfTgBX0vcHiGeNjaet/7j3Z0Vb+oRzVkTwMTRYsADjgFSGhE1F9vqCtYkNKL9pJjSM0jh0i7V8= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(33656002)(53546011)(52536014)(4326008)(83380400001)(5660300002)(7696005)(26005)(2906002)(6506007)(86362001)(55016002)(71200400001)(9686003)(966005)(8936002)(66446008)(64756008)(186003)(66556008)(122000001)(76116006)(316002)(66476007)(8676002)(66946007)(38100700002)(110136005)(478600001)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?l0gEWczgYMybFlcU3wCnNQ7Tu1X+ExYsfhELiXB9CQduFpBAMmO8GuiFcG/c?= =?us-ascii?Q?ED0kESeq8M/zk3PUowK47rKALg3FpKTQZnpcEVMhGvSLnBVjpLJviGFJY5zX?= =?us-ascii?Q?xnQh68I3BJVACuTq8++ujWc9lfmyI7TYxMUGkUoZCzhGM7Rn1D0XkhWVpDE8?= =?us-ascii?Q?VQhS537Lrz9zVk9yypD8WjZebnZSdCuUol8UOIaVuUTKS32c+T4Ay4gNE9Y2?= =?us-ascii?Q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vYBvzHdsrNn5matNh12gGy/?= =?us-ascii?Q?Bj/EKn7eIc0SLxdxPJqZycuACYibvtDodZQ0I8+pehcs/sC7vrtPG7ZBsTkR?= =?us-ascii?Q?OKx7KSuagKgyRTGx8mB4qls0RQF0t2IxdUh+s1nYVHuQS8Qxat6dA9+FtDOg?= =?us-ascii?Q?mXSnpdyIK3JWWsFcLQTwgxIkVjBGCWxEnWaIiIXUKJeZ0aOdihW/+JOevW46?= =?us-ascii?Q?3F6q5E7sqe5qULIQfGlKSkl7?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e4e9b84-70d3-4e26-100d-08d92bd91d85 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2021 06:29:35.1747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xaO8Odz851dNmfK9BZfzp8Cv3AYd7B/KwsyPRlvAKcaWKhzCzURUZCg0IUdQ7FYVcvu5ZnPwHVF5HwVahef5Hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5150 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: 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 >=20 > Hi Andrew, >=20 > > -----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 >=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); > > > > 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 ? ;-) >=20 > 1. w/o pointer >=20 > #include >=20 > typedef int (gpu_malloc_t)(void *dev, size_t size, void **ptr); >=20 > static gpu_malloc_t *mlx5_gpu_malloc_fn; >=20 > static int > mlx5_gpu_malloc(size_t size, void **ptr) { > return 0; > } >=20 > int main() > { > mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; >=20 > mlx5_gpu_malloc_fn(NULL, 0, NULL); >=20 > return 0; > } >=20 >=20 > 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 int,= void **)'} [-Wincompatible-pointer-types] > 15 | mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; > | ^ >=20 >=20 >=20 > 2. w pointer >=20 > #include >=20 > typedef int (*gpu_malloc_t)(void *dev, size_t size, void **ptr); >=20 > static gpu_malloc_t mlx5_gpu_malloc_fn; >=20 > static int > mlx5_gpu_malloc(size_t size, void **ptr) { > return 0; > } >=20 > int main() > { > mlx5_gpu_malloc_fn =3D mlx5_gpu_malloc; >=20 > mlx5_gpu_malloc_fn(NULL, 0, NULL); >=20 > return 0; > } >=20 > 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. >From usage perspective, it's straightforward for anybody to see an pointer = field and know "that's a pointer to a something".