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 58F68A0562; Wed, 14 Apr 2021 17:49:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E1081618C8; Wed, 14 Apr 2021 17:49:35 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2082.outbound.protection.outlook.com [40.107.220.82]) by mails.dpdk.org (Postfix) with ESMTP id 755824013F for ; Wed, 14 Apr 2021 17:49:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vlc6A3zsyJBbGP/Eprthd4MrRAmF0Byhy6xs02O3Qk9cZ8l3GLtWSaCvjx9jZ1YdbRrN6nS15i1Dt+6uiYhU0F1fxiRTjULlX+IMVzOKJFUT7yIUTQFd/ahdY8sMuQnEtOmq+A0DoZz7BXDacfsO9jA7v3RDa1Oidd78uAz+UB3WyaHiAGg6k/8iED5H2nTuntunQVbbp/fx41FJhCD+z5ciCIU5Qax7KM5TGqwqp1dh44bBq0rC1OyoeDTVSqlzhsTg7xD8Gbw6SGWDs3ox0LzWM5ZSWpfzZ7xcm7zCpUtMz9Ui5FM7HWthjznNCjoCWeHKZvj6G/HmeaTPHrKK3w== 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=Gcm4Md0e12QZC/jVnBgreYOQ1W5lSNPB+iDvaewkHQU=; b=iAnsrXaNVKGj/VXWvTwEAVTHRtBDjzTlvlwmeikqRgXQFi0JT+cFct0GthGgpi8xMjfqrHHy5nndP78fuR0Q/3UaprKPaAaOP2XiEqafU4mQklGOiK+ZRLA2CXSKM0D//xlVsa7uvQ17x6Zj6NexcLvrcfWzB4gwDOJWyQr34eqtJMz0Ty2VGAe98wOBQvdjgBsTchpBbu9/pN0XttDNqYt6glrWO1kK8LujL/fQACjeIA77ZGD5QxwpgVkMmA3FkzrKkuNc+oPF48VquhuVI/tOc9Cmxv8aHOLm7PDOZBbXTRkP9hDf0CPvqdZ9GbZ4TGW2ltJQhyDBUUESySwAlg== 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=Gcm4Md0e12QZC/jVnBgreYOQ1W5lSNPB+iDvaewkHQU=; b=tDpO9g50SXiQdKCD7FoKsSrNr1SuFfK27EukZuxQBUGMeM7JVbIaH8aTf/G9vXxDB5Csb8Snw8T4xWLuhtAU7zw6dQmX+1npuPpZxoTP+GmsncMycG6INiVqUc8tz2mZkf1EwJbdeFUl3bLojXXBy4/XpeP2wRc30vdRAw7HKVV24/8JpJcIK8OUbZAh64wkUX8G0BAMX6pzRP1Xv6MAGsEuQ6CPwF1/4zS/RKTaTGWNWw1b2XDJH+IWgoLltp0z+SpJBbBMjBPHCDqLPhyrvCmL16iIaVLi+L9vwCEQWBlovBuO+ACqm+jNzlg7bk5Qmh/8aoNtLxqFtOPQ14AF4g== Received: from BY5PR12MB4324.namprd12.prod.outlook.com (2603:10b6:a03:209::10) by BYAPR12MB2935.namprd12.prod.outlook.com (2603:10b6:a03:131::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.20; Wed, 14 Apr 2021 15:49:32 +0000 Received: from BY5PR12MB4324.namprd12.prod.outlook.com ([fe80::b919:53f4:6757:331c]) by BY5PR12MB4324.namprd12.prod.outlook.com ([fe80::b919:53f4:6757:331c%5]) with mapi id 15.20.4020.023; Wed, 14 Apr 2021 15:49:32 +0000 From: "Xueming(Steven) Li" To: NBU-Contact-Thomas Monjalon , "Wang, Haiyue" CC: "dev@dpdk.org" , Asaf Penso , Parav Pandit , Ray Kinsella Thread-Topic: [dpdk-dev] [PATCH v1] bus/auxiliary: introduce auxiliary bus Thread-Index: AQHXMBR7KefWjHt1PkOf7D5G3ZHCMaqzVCeAgABY9ICAAH3L8A== Date: Wed, 14 Apr 2021 15:49:31 +0000 Message-ID: References: <20210311130113.31382-1-xuemingl@nvidia.com> <20210413032329.25551-1-xuemingl@nvidia.com> <1710155.qeZJibJ7ot@thomas> In-Reply-To: <1710155.qeZJibJ7ot@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [180.162.52.50] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 59f955f8-5667-4017-3340-08d8ff5ce53f x-ms-traffictypediagnostic: BYAPR12MB2935: 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:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: liEGlqW4Uj7I3HsgiZIo6y5u/9yzUHkky1nrBQFMb19yAk9AOJBYU3qsNFroGGj8LUqSGvGx3HxHOk2lBLA9lkLQGi4jw4wolmNcesVBkgmjtrN2usDuv8WTodah2vNAZMd8UuNWtZDxcgbSEmOruv5Ly+Q0/oOUx3xVysy6xAvgoxWC2RSBl0Bp65bBbAyOBROBzhRn0z76f5lGoJP4AgZrb/P5MfSQ9e+g1eidRF91JFSUD0ZppzmeFR8YTq6VDWSnXmGHIXbgm1O7YzKo0iVJKqV6lrJB+sbKwKl0jiHVwhaw9JOcVxATbJhADH5iSZ8ouY+apGjlJhfWsd7qmrdyV7Vo4/MxAjJk59bc+tqulZrXZAETQ5ycpmLZcC3QibA71AXkFkqv2C16C2cMJZ1RoWbXRbZUexvh+0JUEApBl0mpCthGCxmv8J29J/gJp9qPnqMXNXzafu/EYBMdB5jV+NoxnRfwrBPa4tAbZiIS34tFGOzIGi8C2v4Ikn7bAmYkL3LsEqZdf1MCRu5g+TDaKxz6BxoHhEj/KRjGFIzDKWr13mjEK84ckk7GuugTuGKSarJAR0sLHC530z4ATI6ZxJcPzZBlO0MIU81zwHg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4324.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(396003)(366004)(39860400002)(346002)(66446008)(6506007)(8676002)(9686003)(5660300002)(83380400001)(53546011)(478600001)(2906002)(64756008)(316002)(7696005)(186003)(71200400001)(122000001)(54906003)(110136005)(33656002)(66946007)(26005)(66476007)(55016002)(8936002)(4326008)(38100700002)(86362001)(66556008)(52536014)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?61MSnwth0de1TOJ8nBkHuzJ57dajyaya3KZbflweWTVd6xtMhFpNb0782sHI?= =?us-ascii?Q?oBLZZ/qj4jhiSnvj2qm2aMjWCz+ZwBYY3g87+8KP9UGaGxh/Kzz1bHVqMEKj?= =?us-ascii?Q?g6rJx9PV2IOk7Gxy2JOwZbG9WiEtbkLm87tdiTiEEFSfFK6mMUvEUYPElpgz?= =?us-ascii?Q?zbHIFeQYg912BrAf5teIqK4bG6EWmaT9GUEb7V5bJC1khwEW12qlCJjj3tcG?= =?us-ascii?Q?DFBSRIC/tx6Sl8i2sQncaF1f6X5vVCmdeDlEWTdCVyov2CRtM2jhM4MQrJ26?= =?us-ascii?Q?8NVRdIImm5N/URfwRK5URHyiIu3pSZ8TVsmLHcOCKUFHs80xZZ1wQGQAaZPl?= =?us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T4JEDwfUAZjHJ1hi?= =?us-ascii?Q?ahaH+zDnLY/BVdBjSUe1gCbY7cEFHgLF4h5KiUfV6fbKeNSsol37WOzHebS2?= =?us-ascii?Q?JU5G4hqIat8wr6FPqBwvy1bA?= 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: BY5PR12MB4324.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59f955f8-5667-4017-3340-08d8ff5ce53f X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2021 15:49:31.9142 (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: 5vt8801BL0WnbpXg56cPbh3oZ9dOWPoE4hNPLtS6QkU1SoZQOacjdjvkDmhMO/WV9CHWD082Ad4KmsZt0EO8xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2935 Subject: Re: [dpdk-dev] [PATCH v1] 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: Thomas Monjalon > Sent: Wednesday, April 14, 2021 4:18 PM > To: Xueming(Steven) Li ; Wang, Haiyue > Cc: dev@dpdk.org; Asaf Penso ; Parav Pandit ; Ray Kinsella > Subject: Re: [dpdk-dev] [PATCH v1] bus/auxiliary: introduce auxiliary bus >=20 > 14/04/2021 04:59, Wang, Haiyue: > > From: Xueming Li > [...] > > > +void > > > +auxiliary_on_scan(struct rte_auxiliary_device *dev) { > > > + struct rte_devargs *devargs; > > > + > > > + devargs =3D auxiliary_devargs_lookup(dev->name); > > > + dev->device.devargs =3D devargs; > > > > Can be simple as: > > > > dev->device.devargs =3D auxiliary_devargs_lookup(dev->name); > > > > > +} > > > + > > > +/* > > > + * Match the auxiliary Driver and Device using driver function. > > > + */ > > > +bool > > > +auxiliary_match(const struct rte_auxiliary_driver *auxiliary_drv, > > > + const struct rte_auxiliary_device *auxiliary_dev) > > > > How about these auxiliary variable name style ? > > > > const struct rte_auxiliary_driver *aux_drv, const struct > > rte_auxiliary_device *aux_dev >=20 > +1 >=20 > [...] > > > +static int > > > +rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *dr, > > > + struct rte_auxiliary_device *dev) { > > > + int ret; > > > + enum rte_iova_mode iova_mode; > > > + > > > > RCT style ? > > enum rte_iova_mode iova_mode; > > int ret; >=20 > I don't see the benefit of reverse christmas tree. >=20 > > > + if ((dr->drv_flags & RTE_AUXILIARY_DRV_NEED_IOVA_AS_VA) > 0 && > > > > '(dr->drv_flags & RTE_AUXILIARY_DRV_NEED_IOVA_AS_VA)' should work, no n= eed '> 0' >=20 > Yes it's acceptable to consider bit testing as a boolean. >=20 > [...] > > > +static int > > > +auxiliary_dma_map(struct rte_device *dev, void *addr, uint64_t > > > +iova, size_t len) { > > > + struct rte_auxiliary_device *adev =3D RTE_DEV_TO_AUXILIARY(dev); > > > > How about to use 'aux_dev', instead of 'adev' ? > > > > > + > > > + if (!adev || !adev->driver) { > > > > ' RTE_DEV_TO_AUXILIARY' is container of 'dev', so it should check 'dev > > !=3D NULL', not '!adev'. ; -) >=20 > Yes and should be explicit NULL comparison. >=20 > [...] > > > --- /dev/null > > > +++ b/drivers/bus/auxiliary/linux/auxiliary.c > > ^ > > | > > Seems no need to add one more directory 'linux' layer, as the meson sai= d "linux only". >=20 > I disagree. > Linux sub-directory is more explicit. > And who knows? There could be an implementation on other OSes in future. This reminds me to change meson, allows bus always available to avoid compi= lation error, also need to add stubs with __rte_weak for all functions in common file. >=20 >=20