From: Jiang, Dave <dave.jiang at intel.com>
To: accel-config@lists.01.org
Subject: [Accel-config] Re: [PATCH v1 03/11] accel-config: Add lib functions to list mdevs and retrieve mdev properties
Date: Fri, 04 Dec 2020 23:53:17 +0000 [thread overview]
Message-ID: <4d12e84f11dd4399975cf65bbf24d80e@intel.com> (raw)
In-Reply-To: 20201202193057.299615-4-ramesh.thomas@intel.com
[-- Attachment #1: Type: text/plain, Size: 3788 bytes --]
> -----Original Message-----
> From: ramesh.thomas(a)intel.com <ramesh.thomas(a)intel.com>
> Sent: Wednesday, December 2, 2020 12:31 PM
> To: accel-config(a)lists.01.org
> Cc: Thomas, Ramesh <ramesh.thomas(a)intel.com>; Luck, Tony
> <tony.luck(a)intel.com>; Jiang, Dave <dave.jiang(a)intel.com>
> Subject: [PATCH v1 03/11] accel-config: Add lib functions to list mdevs and
> retrieve mdev properties
>
> From: Ramesh Thomas <ramesh.thomas(a)intel.com>
>
> 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 <ramesh.thomas(a)intel.com>
> ---
> 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.
- 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 = 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 = accfg_device_first_mdev(device); \
> + mdev != NULL; \
> + mdev = accfg_device_next_mdev(mdev))
> +
> /* libaccfg function for group */
> struct accfg_group;
> struct accfg_group *accfg_group_get_first(struct accfg_device *device);
> --
> 2.26.2
next reply other threads:[~2020-12-04 23:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 23:53 Jiang, Dave [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-12-04 23:59 [Accel-config] Re: [PATCH v1 03/11] accel-config: Add lib functions to list mdevs and retrieve mdev properties Thomas, Ramesh
2020-12-05 0:10 Jiang, Dave
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d12e84f11dd4399975cf65bbf24d80e@intel.com \
--to=accel-config@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.