CPU set management functions. More...
Data Structures | |
| struct | spdk_cpuset |
| List of CPUs. More... | |
Macros | |
| #define | SPDK_CPUSET_SIZE 1024 |
Functions | |
| struct spdk_cpuset * | spdk_cpuset_alloc (void) |
| Allocate CPU set object. | |
| void | spdk_cpuset_free (struct spdk_cpuset *set) |
| Free allocated CPU set. | |
| bool | spdk_cpuset_equal (const struct spdk_cpuset *set1, const struct spdk_cpuset *set2) |
| Compare two CPU sets. | |
| void | spdk_cpuset_copy (struct spdk_cpuset *dst, const struct spdk_cpuset *src) |
| Copy the content of CPU set to another. | |
| void | spdk_cpuset_and (struct spdk_cpuset *dst, const struct spdk_cpuset *src) |
| Perform AND operation on two CPU sets. | |
| void | spdk_cpuset_or (struct spdk_cpuset *dst, const struct spdk_cpuset *src) |
| Perform OR operation on two CPU sets. | |
| void | spdk_cpuset_xor (struct spdk_cpuset *dst, const struct spdk_cpuset *src) |
| Perform XOR operation on two CPU sets. | |
| void | spdk_cpuset_negate (struct spdk_cpuset *set) |
| Negate all CPUs in CPU set. | |
| void | spdk_cpuset_zero (struct spdk_cpuset *set) |
| Clear all CPUs in CPU set. | |
| void | spdk_cpuset_set_cpu (struct spdk_cpuset *set, uint32_t cpu, bool state) |
| Set or clear CPU state in CPU set. | |
| bool | spdk_cpuset_get_cpu (const struct spdk_cpuset *set, uint32_t cpu) |
| Get the state of CPU in CPU set. | |
| void | spdk_cpuset_for_each_cpu (const struct spdk_cpuset *set, void(*fn)(void *ctx, uint32_t cpu), void *ctx) |
| Call the specified function for each set cpu in the specified cpuset. | |
| uint32_t | spdk_cpuset_count (const struct spdk_cpuset *set) |
| Get the number of CPUs that are set in CPU set. | |
| const char * | spdk_cpuset_fmt (struct spdk_cpuset *set) |
| Convert a CPU set to hex string. | |
| int | spdk_cpuset_parse (struct spdk_cpuset *set, const char *mask) |
| Convert a string containing a CPU core mask into a CPU set. | |
CPU set management functions.
| struct spdk_cpuset * spdk_cpuset_alloc | ( | void | ) |
Allocate CPU set object.
| void spdk_cpuset_and | ( | struct spdk_cpuset * | dst, |
| const struct spdk_cpuset * | src ) |
Perform AND operation on two CPU sets.
The result is stored in dst.
| dst | First argument of operation. This value also stores the result of operation. |
| src | Second argument of operation. |
| void spdk_cpuset_copy | ( | struct spdk_cpuset * | dst, |
| const struct spdk_cpuset * | src ) |
Copy the content of CPU set to another.
| dst | Destination CPU set |
| src | Source CPU set |
| uint32_t spdk_cpuset_count | ( | const struct spdk_cpuset * | set | ) |
Get the number of CPUs that are set in CPU set.
| set | CPU set object. |
| bool spdk_cpuset_equal | ( | const struct spdk_cpuset * | set1, |
| const struct spdk_cpuset * | set2 ) |
Compare two CPU sets.
| set1 | CPU set1. |
| set2 | CPU set2. |
| const char * spdk_cpuset_fmt | ( | struct spdk_cpuset * | set | ) |
Convert a CPU set to hex string.
| set | CPU set. |
| void spdk_cpuset_for_each_cpu | ( | const struct spdk_cpuset * | set, |
| void(*)(void *ctx, uint32_t cpu) | fn, | ||
| void * | ctx ) |
Call the specified function for each set cpu in the specified cpuset.
| set | The cpuset to iterate |
| fn | The function to call for each set cpu |
| ctx | Context pointer to pass to fn |
| void spdk_cpuset_free | ( | struct spdk_cpuset * | set | ) |
Free allocated CPU set.
| set | CPU set to be freed. |
| bool spdk_cpuset_get_cpu | ( | const struct spdk_cpuset * | set, |
| uint32_t | cpu ) |
Get the state of CPU in CPU set.
| set | CPU set object. |
| cpu | CPU index. |
| void spdk_cpuset_negate | ( | struct spdk_cpuset * | set | ) |
Negate all CPUs in CPU set.
| set | CPU set to be negated. This value also stores the result of operation. |
| void spdk_cpuset_or | ( | struct spdk_cpuset * | dst, |
| const struct spdk_cpuset * | src ) |
Perform OR operation on two CPU sets.
The result is stored in dst.
| dst | First argument of operation. This value also stores the result of operation. |
| src | Second argument of operation. |
| int spdk_cpuset_parse | ( | struct spdk_cpuset * | set, |
| const char * | mask ) |
Convert a string containing a CPU core mask into a CPU set.
| set | CPU set. |
| mask | String defining CPU set. By default hexadecimal value is used or as CPU list enclosed in square brackets defined as: 'c1[-c2][,c3[-c4],...]'. When hexadecimal value is passed, any commas will be ignored, to allow using this function with masks generated by Linux kernel in sysfs. |
| void spdk_cpuset_set_cpu | ( | struct spdk_cpuset * | set, |
| uint32_t | cpu, | ||
| bool | state ) |
Set or clear CPU state in CPU set.
| set | CPU set object. |
| cpu | CPU index to be set or cleared. |
| state | true to set cpu, false to clear. |
| void spdk_cpuset_xor | ( | struct spdk_cpuset * | dst, |
| const struct spdk_cpuset * | src ) |
Perform XOR operation on two CPU sets.
The result is stored in dst.
| dst | First argument of operation. This value also stores the result of operation. |
| src | Second argument of operation. |
| void spdk_cpuset_zero | ( | struct spdk_cpuset * | set | ) |
Clear all CPUs in CPU set.
| set | CPU set to be cleared. |