From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8360991843563583001==" MIME-Version: 1.0 From: Jiang, Dave Subject: [Accel-config] Re: [PATCH v1 03/11] accel-config: Add lib functions to list mdevs and retrieve mdev properties Date: Sat, 05 Dec 2020 00:10:29 +0000 Message-ID: In-Reply-To: BYAPR11MB253532959358F74011BE0C8AEDF10@BYAPR11MB2535.namprd11.prod.outlook.com To: accel-config@lists.01.org List-ID: --===============8360991843563583001== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Thomas, Ramesh > Sent: Friday, December 4, 2020 5:00 PM > To: Jiang, Dave ; accel-config(a)lists.01.org > Cc: Luck, Tony > Subject: RE: [PATCH v1 03/11] accel-config: Add lib functions to list mde= vs and > retrieve mdev properties > = > On Fri, Dec 04, 2020 at 03:53:17PM, Dave Jiang wrote: > > > > > > > -----Original Message----- > > > From: ramesh.thomas(a)intel.com > > > Sent: Wednesday, December 2, 2020 12:31 PM > > > To: accel-config(a)lists.01.org > > > Cc: Thomas, Ramesh ; Luck, Tony > > > ; Jiang, Dave > > > Subject: [PATCH v1 03/11] accel-config: Add lib functions to list > > > mdevs and retrieve mdev properties > > > > > > From: Ramesh Thomas > > > > > > Create library functions for querrying mdev details > > > - Functions to retrieve first and next mdev in list > > > - Macro to iterate mdev list > > > - Functions to retrieve mdev uuid and type > > > > > > Signed-off-by: Ramesh Thomas > > > --- > > > accfg/lib/libaccel-config.sym | 9 +++++++++ > > > accfg/lib/libaccfg.c | 22 ++++++++++++++++++++++ > > > accfg/libaccel_config.h | 11 +++++++++++ > > > 3 files changed, 42 insertions(+) > > > > > > diff --git a/accfg/lib/libaccel-config.sym > > > b/accfg/lib/libaccel-config.sym index > > > 471e06a..a857152 100644 > > > --- a/accfg/lib/libaccel-config.sym > > > +++ b/accfg/lib/libaccel-config.sym > > > @@ -133,3 +133,12 @@ global: > > > accfg_wq_set_max_batch_size; > > > accfg_wq_set_max_transfer_size; > > > } LIBACCFG_6; > > > + > > > +LIBACCFG_8 { > > > +global: > > > +accfg_device_first_mdev; > > > +accfg_device_next_mdev; > > > +accfg_mdev_get_uuid; > > > +accfg_mdev_get_type; > > > +accfg_mdev_basenames; > > > +} LIBACCFG_7; > > > diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c index > > > 0dd1f0c..6a4648a > > > 100644 > > > --- a/accfg/lib/libaccfg.c > > > +++ b/accfg/lib/libaccfg.c > > > @@ -956,6 +956,28 @@ static void engines_init(struct accfg_device > > > *device) add_engine); } > > > > > > +ACCFG_EXPORT struct accfg_device_mdev > > > *accfg_device_first_mdev(struct > > > +accfg_device *device) { > > > > Can you line up the function like: > > ACCFG_EXPORT struct accfg_device_mdev > *accfg_device_first_mdev(struct > > accfg_device *device) { > > > > This is for the entire series. Otherwise looks ok. > = > Assuming this is also the issue with your Outlook removing newlines. > In code it is aligned like you suggest. Most likely. Disregard. You can add review tag. = > = > > > > - Dave. > > > > > > > +return list_top(&device->mdev_list, struct accfg_device_mdev, > > > +list); > > > } > > > + > > > +ACCFG_EXPORT struct accfg_device_mdev > > > *accfg_device_next_mdev(struct > > > +accfg_device_mdev *mdev) { > > > +struct accfg_device *device =3D mdev->device; > > > + > > > +return list_next(&device->mdev_list, mdev, list); } > > > + > > > +ACCFG_EXPORT void accfg_mdev_get_uuid(struct accfg_device_mdev > > > *mdev, > > > +uuid_t uuid) { > > > +uuid_copy(uuid, mdev->uuid); > > > +} > > > + > > > +ACCFG_EXPORT enum accfg_mdev_type accfg_mdev_get_type(struct > > > +accfg_device_mdev *mdev) { return mdev->type; } > > > + > > > /** > > > * accfg_device_get_first - retrieve first device in the system > > > * @ctx: context established by accfg_new diff --git > a/accfg/libaccel_config.h > > > b/accfg/libaccel_config.h index e89bd40..a55bfde 100644 > > > --- a/accfg/libaccel_config.h > > > +++ b/accfg/libaccel_config.h > > > @@ -184,6 +184,17 @@ int accfg_device_is_active(struct accfg_device > > > *device); int accfg_device_get_cmd_status(struct accfg_device > *device); > > > const char * accfg_device_get_cmd_status_str(struct accfg_device > *device); > > > > > > +struct accfg_device_mdev; > > > +struct accfg_device_mdev *accfg_device_first_mdev(struct > accfg_device > > > +*device); struct accfg_device_mdev *accfg_device_next_mdev(struct > > > +accfg_device_mdev *mdev); void accfg_mdev_get_uuid(struct > > > +accfg_device_mdev *mdev, uuid_t uuid); enum accfg_mdev_type > > > +accfg_mdev_get_type(struct accfg_device_mdev *mdev); > > > + > > > +#define accfg_device_mdev_foreach(device, mdev) \ > > > +for (mdev =3D accfg_device_first_mdev(device); \ > > > +mdev !=3D NULL; \ > > > +mdev =3D accfg_device_next_mdev(mdev)) > > > + > > > /* libaccfg function for group */ > > > struct accfg_group; > > > struct accfg_group *accfg_group_get_first(struct accfg_device *devic= e); > > > -- > > > 2.26.2 > > > = >=20 --===============8360991843563583001==--