All of lore.kernel.org
 help / color / mirror / Atom feed
* [Accel-config] [RFC] Provide library API to read and write raw sysfs attributes
@ 2022-02-04 19:15 Ramesh Thomas
  0 siblings, 0 replies; only message in thread
From: Ramesh Thomas @ 2022-02-04 19:15 UTC (permalink / raw)
  To: accel-config

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

I am thinking of providing some generic functions to read and write 
sysfs attributes without much processing. This will be useful where raw 
reads and writes are required e.g. listing values of attributes or 
initializing attributes in a loop. This will open up possibilities of 
advanced use cases where user can do custom batch configurations in 
addition to the load and save configuration option.

There will be a get and set function for devices, groups, wqs and 
engines as follows

/* structure to read and write attributes from sysfs */
struct accfg_sysfs_attr {
         char attr[MAX_PARAM_LEN];
};

int accfg_get_device_attr(struct accfg_device *device, const char 
*attr_name,
                 struct *accfg_sysfs_attr);
int accfg_set_device_attr(struct accfg_device *device, const char 
*attr_name,
                 struct *accfg_sysfs_attr);

int accfg_get_group_attr(struct accfg_group *group, const char *attr_name,
                 struct *accfg_sysfs_attr);
int accfg_set_group_attr(struct accfg_group *group, const char *attr_name,
                 struct *accfg_sysfs_attr);

similarly for wqs and engines.

Let me know if you see any issue or other suggestions.

Thanks,
Ramesh

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-04 19:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 19:15 [Accel-config] [RFC] Provide library API to read and write raw sysfs attributes Ramesh Thomas

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.