Файловый менеджер - Редактировать - /var/www/html/include.zip
Ðазад
PK ! ��>AN AN libdmmp/libdmmp.hnu �[��� /* * Copyright (C) 2015 - 2017 Red Hat, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Author: Gris Ge <fge@redhat.com> * Todd Gill <tgill@redhat.com> */ #ifndef _LIB_DMMP_H_ #define _LIB_DMMP_H_ #include <stdint.h> #include <stdarg.h> #ifdef __cplusplus extern "C" { #endif #define DMMP_DLL_EXPORT __attribute__ ((visibility ("default"))) #define DMMP_DLL_LOCAL __attribute__ ((visibility ("hidden"))) #define DMMP_OK 0 #define DMMP_ERR_BUG 1 #define DMMP_ERR_NO_MEMORY 2 #define DMMP_ERR_IPC_TIMEOUT 3 #define DMMP_ERR_IPC_ERROR 4 #define DMMP_ERR_NO_DAEMON 5 #define DMMP_ERR_INCOMPATIBLE 6 #define DMMP_ERR_MPATH_BUSY 7 #define DMMP_ERR_MPATH_NOT_FOUND 8 #define DMMP_ERR_INVALID_ARGUMENT 9 #define DMMP_ERR_PERMISSION_DENY 10 /* * Use the syslog severity level as log priority */ #define DMMP_LOG_PRIORITY_ERROR 3 #define DMMP_LOG_PRIORITY_WARNING 4 #define DMMP_LOG_PRIORITY_INFO 6 #define DMMP_LOG_PRIORITY_DEBUG 7 #define DMMP_LOG_PRIORITY_DEFAULT DMMP_LOG_PRIORITY_WARNING /** * dmmp_log_priority_str() - Convert log priority to string. * * Convert log priority to string (const char *). * * @priority: * int. Log priority. * * Return: * const char *. Valid string are: * * * "ERROR" for DMMP_LOG_PRIORITY_ERROR * * * "WARN " for DMMP_LOG_PRIORITY_WARNING * * * "INFO " for DMMP_LOG_PRIORITY_INFO * * * "DEBUG" for DMMP_LOG_PRIORITY_DEBUG * * * "Invalid argument" for invalid log priority. */ DMMP_DLL_EXPORT const char *dmmp_log_priority_str(int priority); struct DMMP_DLL_EXPORT dmmp_context; struct DMMP_DLL_EXPORT dmmp_mpath; struct DMMP_DLL_EXPORT dmmp_path_group; #define DMMP_PATH_GROUP_STATUS_UNKNOWN 0 #define DMMP_PATH_GROUP_STATUS_ENABLED 1 #define DMMP_PATH_GROUP_STATUS_DISABLED 2 #define DMMP_PATH_GROUP_STATUS_ACTIVE 3 struct DMMP_DLL_EXPORT dmmp_path; #define DMMP_PATH_STATUS_UNKNOWN 0 //#define DMMP_PATH_STATUS_UNCHECKED 1 // ^ print.h does not expose this. #define DMMP_PATH_STATUS_DOWN 2 #define DMMP_PATH_STATUS_UP 3 #define DMMP_PATH_STATUS_SHAKY 4 #define DMMP_PATH_STATUS_GHOST 5 #define DMMP_PATH_STATUS_PENDING 6 #define DMMP_PATH_STATUS_TIMEOUT 7 //#define DMMP_PATH_STATUS_REMOVED 8 // ^ print.h does not expose this. #define DMMP_PATH_STATUS_DELAYED 9 /** * dmmp_strerror() - Convert error code to string. * * Convert error code (int) to string (const char *): * * * DMMP_OK -- "OK" * * * DMMP_ERR_BUG -- "BUG of libdmmp library" * * * DMMP_ERR_NO_MEMORY -- "Out of memory" * * * DMMP_ERR_IPC_TIMEOUT -- "Timeout when communicate with multipathd, * try to set bigger timeout value via dmmp_context_timeout_set ()" * * * DMMP_ERR_IPC_ERROR -- "Error when communicate with multipathd daemon" * * * DMMP_ERR_NO_DAEMON -- "The multipathd daemon not started" * * * DMMP_ERR_INCOMPATIBLE -- "The multipathd daemon version is not * compatible with current library" * * * Other invalid error number -- "Invalid argument" * * @rc: * int. Return code by libdmmp functions. When provided error code is not a * valid error code, return "Invalid argument". * * Return: * const char *. The meaning of provided error code. * */ DMMP_DLL_EXPORT const char *dmmp_strerror(int rc); /** * dmmp_context_new() - Create struct dmmp_context. * * The default logging level (DMMP_LOG_PRIORITY_DEFAULT) is * DMMP_LOG_PRIORITY_WARNING which means only warning and error message will be * forward to log handler function. The default log handler function will print * log message to STDERR, to change so, please use dmmp_context_log_func_set() * to set your own log handler, check manpage libdmmp.h(3) for detail. * * Return: * Pointer of 'struct dmmp_context'. Should be freed by * dmmp_context_free(). */ DMMP_DLL_EXPORT struct dmmp_context *dmmp_context_new(void); /** * dmmp_context_free() - Release the memory of struct dmmp_context. * * Release the memory of struct dmmp_context, but the userdata memory defined * via dmmp_context_userdata_set() will not be touched. * * @ctx: * Pointer of 'struct dmmp_context'. * Return: * void */ DMMP_DLL_EXPORT void dmmp_context_free(struct dmmp_context *ctx); /** * dmmp_context_timeout_set() - Set IPC timeout. * * By default, the IPC to multipathd daemon will timeout after 60 seconds. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * @tmo: * Timeout in milliseconds(1 seconds equal 1000 milliseconds). * 0 means infinite, function only return when error or pass. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_context_timeout_set(struct dmmp_context *ctx, unsigned int tmo); /** * dmmp_context_timeout_get() - Get IPC timeout. * * Retrieve timeout value of IPC connection to multipathd daemon. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * unsigned int. Timeout in milliseconds. */ DMMP_DLL_EXPORT unsigned int dmmp_context_timeout_get(struct dmmp_context *ctx); /** * dmmp_context_log_priority_set() - Set log priority. * * * When library generates log message, only equal or more important(less value) * message will be forwarded to log handler function. Valid log priority values * are: * * * DMMP_LOG_PRIORITY_ERROR -- 3 * * * DMMP_LOG_PRIORITY_WARNING -- 4 * * * DMMP_LOG_PRIORITY_INFO -- 5 * * * DMMP_LOG_PRIORITY_DEBUG -- 7 * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * @priority: * int, log priority. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_context_log_priority_set(struct dmmp_context *ctx, int priority); /** * dmmp_context_log_priority_get() - Get log priority. * * Retrieve current log priority. Valid log priority values are: * * * DMMP_LOG_PRIORITY_ERROR -- 3 * * * DMMP_LOG_PRIORITY_WARNING -- 4 * * * DMMP_LOG_PRIORITY_INFO -- 5 * * * DMMP_LOG_PRIORITY_DEBUG -- 7 * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * int, log priority. */ DMMP_DLL_EXPORT int dmmp_context_log_priority_get(struct dmmp_context *ctx); /** * dmmp_context_log_func_set() - Set log handler function. * * Set custom log handler. The log handler will be invoked when log message * is equal or more important(less value) than log priority setting. * Please check manpage libdmmp.h(3) for detail usage. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * @log_func: * Pointer of log handler function. If set to NULL, all log will be * ignored. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_context_log_func_set (struct dmmp_context *ctx, void (*log_func) (struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, va_list args)); /** * dmmp_context_userdata_set() - Set user data pointer. * * Store user data pointer into 'struct dmmp_context'. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * @userdata: * Pointer of user defined data. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_context_userdata_set(struct dmmp_context *ctx, void *userdata); /** * dmmp_context_userdata_get() - Get user data pointer. * * Retrieve user data pointer from 'struct dmmp_context'. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * void *. Pointer of user defined data. */ DMMP_DLL_EXPORT void *dmmp_context_userdata_get(struct dmmp_context *ctx); /** * dmmp_mpath_array_get() - Query all existing multipath devices. * * Query all existing multipath devices and store them into a pointer array. * The memory of 'dmmp_mps' should be freed via dmmp_mpath_array_free(). * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * @dmmp_mps: * Output pointer array of 'struct dmmp_mpath'. * If this pointer is NULL, your program will be terminated by assert. * @dmmp_mp_count: * Output pointer of uint32_t. Hold the size of 'dmmp_mps' pointer array. * If this pointer is NULL, your program will be terminated by assert. * * Return: * int. Valid error codes are: * * * DMMP_OK * * * DMMP_ERR_BUG * * * DMMP_ERR_NO_MEMORY * * * DMMP_ERR_NO_DAEMON * * * DMMP_ERR_INCONSISTENT_DATA * * Error number could be converted to string by dmmp_strerror(). */ DMMP_DLL_EXPORT int dmmp_mpath_array_get(struct dmmp_context *ctx, struct dmmp_mpath ***dmmp_mps, uint32_t *dmmp_mp_count); /** * dmmp_mpath_array_free() - Free 'struct dmmp_mpath' pointer array. * * Free the 'dmmp_mps' pointer array generated by dmmp_mpath_array_get(). * If provided 'dmmp_mps' pointer is NULL or dmmp_mp_count == 0, do nothing. * * @dmmp_mps: * Pointer of 'struct dmmp_mpath' array. * @dmmp_mp_count: * uint32_t, the size of 'dmmp_mps' pointer array. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_mpath_array_free(struct dmmp_mpath **dmmp_mps, uint32_t dmmp_mp_count); /** * dmmp_mpath_wwid_get() - Retrieve WWID of certain mpath. * * @dmmp_mp: * Pointer of 'struct dmmp_mpath'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * const char *. No need to free this memory, the resources will get * freed when dmmp_mpath_array_free(). */ DMMP_DLL_EXPORT const char *dmmp_mpath_wwid_get(struct dmmp_mpath *dmmp_mp); /** * dmmp_mpath_name_get() - Retrieve name(alias) of certain mpath. * * Retrieve the name (also known as alias) of certain mpath. * When the config 'user_friendly_names' been set 'no', the name will be * identical to WWID retrieved by dmmp_mpath_wwid_get(). * * @dmmp_mp: * Pointer of 'struct dmmp_mpath'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * const char *. No need to free this memory, the resources will get * freed when dmmp_mpath_array_free(). */ DMMP_DLL_EXPORT const char *dmmp_mpath_name_get(struct dmmp_mpath *dmmp_mp); /** * dmmp_mpath_kdev_name_get() - Retrieve kernel DEVNAME of certain mpath. * * Retrieve DEVNAME name used by kernel uevent of specified mpath. * For example: 'dm-1'. * * @dmmp_mp: * Pointer of 'struct dmmp_mpath'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * const char *. No need to free this memory, the resources will get * freed when dmmp_mpath_array_free(). */ DMMP_DLL_EXPORT const char *dmmp_mpath_kdev_name_get (struct dmmp_mpath *dmmp_mp); /** * dmmp_path_group_array_get() - Retrieve path groups pointer array. * * Retrieve the path groups of certain mpath. * * The memory of output pointer array is hold by 'struct dmmp_mpath', no * need to free this memory, the resources will got freed when * dmmp_mpath_array_free(). * * @dmmp_mp: * Pointer of 'struct dmmp_mpath'. * If this pointer is NULL, your program will be terminated by assert. * @dmmp_pgs: * Output pointer of 'struct dmmp_path_group' pointer array. * If this pointer is NULL, your program will be terminated by assert. * @dmmp_pg_count: * Output pointer of uint32_t. Hold the size of 'dmmp_pgs' pointer array. * If this pointer is NULL, your program will be terminated by assert. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_path_group_array_get (struct dmmp_mpath *dmmp_mp, struct dmmp_path_group ***dmmp_pgs, uint32_t *dmmp_pg_count); /** * dmmp_path_group_id_get() - Retrieve path group ID. * * Retrieve the path group ID which could be used to switch active path group * via command: * * multipathd -k'switch multipath mpathb group $id' * * @dmmp_pg: * Pointer of 'struct dmmp_path_group'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * uint32_t. */ DMMP_DLL_EXPORT uint32_t dmmp_path_group_id_get (struct dmmp_path_group *dmmp_pg); /** * dmmp_path_group_priority_get() - Retrieve path group priority. * * The enabled path group with highest priority will be next active path group * if active path group down. * * @dmmp_pg: * Pointer of 'struct dmmp_path_group'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * uint32_t. */ DMMP_DLL_EXPORT uint32_t dmmp_path_group_priority_get (struct dmmp_path_group *dmmp_pg); /** * dmmp_path_group_status_get() - Retrieve path group status. * * The valid path group statuses are: * * * DMMP_PATH_GROUP_STATUS_UNKNOWN * * * DMMP_PATH_GROUP_STATUS_ENABLED -- standby to be active * * * DMMP_PATH_GROUP_STATUS_DISABLED -- disabled due to all path down * * * DMMP_PATH_GROUP_STATUS_ACTIVE -- selected to handle I/O * * @dmmp_pg: * Pointer of 'struct dmmp_path_group'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * uint32_t. */ DMMP_DLL_EXPORT uint32_t dmmp_path_group_status_get (struct dmmp_path_group *dmmp_pg); /** * dmmp_path_group_status_str() - Convert path group status to string. * * Convert path group status uint32_t to string (const char *). * * @pg_status: * uint32_t. Path group status. * When provided value is not a valid path group status, return "Invalid * argument". * * Return: * const char *. Valid string are: * * * "Invalid argument" * * * "undef" * * * "enabled" * * * "disabled" * * * "active" */ DMMP_DLL_EXPORT const char *dmmp_path_group_status_str(uint32_t pg_status); /** * dmmp_path_group_selector_get() - Retrieve path group selector. * * Path group selector determine which path in active path group will be * use to next I/O. * * @dmmp_pg: * Pointer of 'struct dmmp_path_group'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * const char *. */ DMMP_DLL_EXPORT const char *dmmp_path_group_selector_get (struct dmmp_path_group *dmmp_pg); /** * dmmp_path_array_get() - Retrieve path pointer array. * * The memory of output pointer array is hold by 'struct dmmp_mpath', no * need to free this memory, the resources will got freed when * dmmp_mpath_array_free(). * * @dmmp_pg: * Pointer of 'struct dmmp_path_group'. * If this pointer is NULL, your program will be terminated by assert. * @dmmp_ps: * Output pointer of 'struct dmmp_path' pointer array. * If this pointer is NULL, your program will be terminated by assert. * @dmmp_p_count: * Output pointer of uint32_t. Hold the size of 'dmmp_ps' pointer array. * If this pointer is NULL, your program will be terminated by assert. * * Return: * void */ DMMP_DLL_EXPORT void dmmp_path_array_get(struct dmmp_path_group *dmmp_pg, struct dmmp_path ***dmmp_ps, uint32_t *dmmp_p_count); /** * dmmp_path_blk_name_get() - Retrieve block name. * * Retrieve block name of certain path. The example of block names are "sda", * "nvme0n1". * * @dmmp_p: * Pointer of 'struct dmmp_path'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * const char *. No need to free this memory, the resources will get * freed when dmmp_mpath_array_free(). */ DMMP_DLL_EXPORT const char *dmmp_path_blk_name_get(struct dmmp_path *dmmp_p); /** * dmmp_path_status_get() - Retrieve the path status. * * The valid path statuses are: * * * DMMP_PATH_STATUS_UNKNOWN * * * DMMP_PATH_STATUS_DOWN * * Path is down and you shouldn't try to send commands to it. * * * DMMP_PATH_STATUS_UP * * Path is up and I/O can be sent to it. * * * DMMP_PATH_STATUS_SHAKY * * Only emc_clariion checker when path not available for "normal" * operations. * * * DMMP_PATH_STATUS_GHOST * * Only hp_sw and rdac checkers. Indicates a "passive/standby" * path on active/passive HP arrays. These paths will return valid * answers to certain SCSI commands (tur, read_capacity, inquiry, * start_stop), but will fail I/O commands. The path needs an * initialization command to be sent to it in order for I/Os to * succeed. * * * DMMP_PATH_STATUS_PENDING * * Available for all async checkers when a check IO is in flight. * * * DMMP_PATH_STATUS_TIMEOUT * * Only tur checker when command timed out. * * * DMMP_PATH_STATUS_DELAYED * * If a path fails after being up for less than delay_watch_checks checks, * when it comes back up again, it will not be marked as up until it has * been up for delay_wait_checks checks. During this time, it is marked as * "delayed". * * @dmmp_p: * Pointer of 'struct dmmp_path'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * uint32_t. */ DMMP_DLL_EXPORT uint32_t dmmp_path_status_get(struct dmmp_path *dmmp_p); /** * dmmp_path_status_str() - Convert path status to string. * * Convert path status uint32_t to string (const char *): * * * DMMP_PATH_STATUS_UNKNOWN -- "undef" * * * DMMP_PATH_STATUS_DOWN -- "faulty" * * * DMMP_PATH_STATUS_UP -- "ready" * * * DMMP_PATH_STATUS_SHAKY -- "shaky" * * * DMMP_PATH_STATUS_GHOST -- "ghost" * * * DMMP_PATH_STATUS_PENDING -- "pending" * * * DMMP_PATH_STATUS_TIMEOUT -- "timeout" * * * DMMP_PATH_STATUS_REMOVED -- "removed" * * * DMMP_PATH_STATUS_DELAYED -- "delayed" * * @path_status: * uint32_t. Path status. * When provided value is not a valid path status, return * "Invalid argument". * * Return: * const char *. The meaning of status value. */ DMMP_DLL_EXPORT const char *dmmp_path_status_str(uint32_t path_status); /** * dmmp_flush_mpath() - Flush specified multipath device map if unused. * * Flush a multipath device map specified as parameter, if unused. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * @mpath_name: * const char *. The name of multipath device map. * * Return: * int. Valid error codes are: * * * DMMP_OK * * * DMMP_ERR_BUG * * * DMMP_ERR_NO_MEMORY * * * DMMP_ERR_NO_DAEMON * * * DMMP_ERR_MPATH_BUSY * * * DMMP_ERR_MPATH_NOT_FOUND * * * DMMP_ERR_INVALID_ARGUMENT * * * DMMP_ERR_PERMISSION_DENY * * Error number could be converted to string by dmmp_strerror(). */ DMMP_DLL_EXPORT int dmmp_flush_mpath(struct dmmp_context *ctx, const char *mpath_name); /** * dmmp_reconfig() - Instruct multipathd daemon to do reconfiguration. * * Instruct multipathd daemon to do reconfiguration. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * int. Valid error codes are: * * * DMMP_OK * * * DMMP_ERR_BUG * * * DMMP_ERR_NO_MEMORY * * * DMMP_ERR_NO_DAEMON * * * DMMP_ERR_PERMISSION_DENY * * Error number could be converted to string by dmmp_strerror(). */ DMMP_DLL_EXPORT int dmmp_reconfig(struct dmmp_context *ctx); /** * dmmp_last_error_msg() - Retrieves the last error message. * * Retrieves the last error message. * * @ctx: * Pointer of 'struct dmmp_context'. * If this pointer is NULL, your program will be terminated by assert. * * Return: * const char *. No need to free this memory, the resources will get * freed when dmmp_context_free(). */ DMMP_DLL_EXPORT const char *dmmp_last_error_msg(struct dmmp_context *ctx); #ifdef __cplusplus } /* End of extern "C" */ #endif #endif /* End of _LIB_DMMP_H_ */ PK ! 9�Q mntent.hnu �[��� /* Utilities for reading/writing fstab, mtab, etc. Copyright (C) 1995-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #ifndef _MNTENT_H #define _MNTENT_H 1 #include <features.h> #include <paths.h> #include <bits/types/FILE.h> /* File listing canonical interesting mount points. */ #define MNTTAB _PATH_MNTTAB /* Deprecated alias. */ /* File listing currently active mount points. */ #define MOUNTED _PATH_MOUNTED /* Deprecated alias. */ /* General filesystem types. */ #define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */ #define MNTTYPE_NFS "nfs" /* Network file system. */ #define MNTTYPE_SWAP "swap" /* Swap device. */ /* Generic mount options. */ #define MNTOPT_DEFAULTS "defaults" /* Use all default options. */ #define MNTOPT_RO "ro" /* Read only. */ #define MNTOPT_RW "rw" /* Read/write. */ #define MNTOPT_SUID "suid" /* Set uid allowed. */ #define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */ #define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */ __BEGIN_DECLS /* Structure describing a mount table entry. */ struct mntent { char *mnt_fsname; /* Device or server for filesystem. */ char *mnt_dir; /* Directory mounted on. */ char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */ char *mnt_opts; /* Comma-separated options for fs. */ int mnt_freq; /* Dump frequency (in days). */ int mnt_passno; /* Pass number for `fsck'. */ }; /* Prepare to begin reading and/or writing mount table entries from the beginning of FILE. MODE is as for `fopen'. */ extern FILE *setmntent (const char *__file, const char *__mode) __THROW; /* Read one mount table entry from STREAM. Returns a pointer to storage reused on the next call, or null for EOF or error (use feof/ferror to check). */ extern struct mntent *getmntent (FILE *__stream) __THROW; #ifdef __USE_MISC /* Reentrant version of the above function. */ extern struct mntent *getmntent_r (FILE *__restrict __stream, struct mntent *__restrict __result, char *__restrict __buffer, int __bufsize) __THROW; #endif /* Write the mount table entry described by MNT to STREAM. Return zero on success, nonzero on failure. */ extern int addmntent (FILE *__restrict __stream, const struct mntent *__restrict __mnt) __THROW; /* Close a stream opened with `setmntent'. */ extern int endmntent (FILE *__stream) __THROW; /* Search MNT->mnt_opts for an option matching OPT. Returns the address of the substring, or null if none found. */ extern char *hasmntopt (const struct mntent *__mnt, const char *__opt) __THROW; __END_DECLS #endif /* mntent.h */ PK ! ��e� � mqueue.hnu �[��� /* Copyright (C) 2004-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #ifndef _MQUEUE_H #define _MQUEUE_H 1 #include <features.h> #include <sys/types.h> #include <fcntl.h> #include <bits/types/sigevent_t.h> #include <bits/types/struct_timespec.h> /* Get the definition of mqd_t and struct mq_attr. */ #include <bits/mqueue.h> __BEGIN_DECLS /* Establish connection between a process and a message queue NAME and return message queue descriptor or (mqd_t) -1 on error. OFLAG determines the type of access used. If O_CREAT is on OFLAG, the third argument is taken as a `mode_t', the mode of the created message queue, and the fourth argument is taken as `struct mq_attr *', pointer to message queue attributes. If the fourth argument is NULL, default attributes are used. */ extern mqd_t mq_open (const char *__name, int __oflag, ...) __THROW __nonnull ((1)); /* Removes the association between message queue descriptor MQDES and its message queue. */ extern int mq_close (mqd_t __mqdes) __THROW; /* Query status and attributes of message queue MQDES. */ extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) __THROW __nonnull ((2)); /* Set attributes associated with message queue MQDES and if OMQSTAT is not NULL also query its old attributes. */ extern int mq_setattr (mqd_t __mqdes, const struct mq_attr *__restrict __mqstat, struct mq_attr *__restrict __omqstat) __THROW __nonnull ((2)); /* Remove message queue named NAME. */ extern int mq_unlink (const char *__name) __THROW __nonnull ((1)); /* Register notification issued upon message arrival to an empty message queue MQDES. */ extern int mq_notify (mqd_t __mqdes, const struct sigevent *__notification) __THROW; /* Receive the oldest from highest priority messages in message queue MQDES. */ extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len, unsigned int *__msg_prio) __nonnull ((2)); /* Add message pointed by MSG_PTR to message queue MQDES. */ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio) __nonnull ((2)); #ifdef __USE_XOPEN2K # ifndef __USE_TIME_BITS64 /* Receive the oldest from highest priority messages in message queue MQDES, stop waiting if ABS_TIMEOUT expires. */ extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, size_t __msg_len, unsigned int *__restrict __msg_prio, const struct timespec *__restrict __abs_timeout) __nonnull ((2, 5)); /* Add message pointed by MSG_PTR to message queue MQDES, stop blocking on full message queue if ABS_TIMEOUT expires. */ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio, const struct timespec *__abs_timeout) __nonnull ((2, 5)); # else # ifdef __REDIRECT extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes, char *__restrict __msg_ptr, size_t __msg_len, unsigned int *__restrict __msg_prio, const struct timespec *__restrict __abs_timeout), __mq_timedreceive_time64) __nonnull ((2, 5)); extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio, const struct timespec *__abs_timeout), __mq_timedsend_time64) __nonnull ((2, 5)); # else # define mq_timedreceive __mq_timedreceive_time64 # define mq_timedsend __mq_timedsend_time64 # endif # endif #endif /* Define some inlines helping to catch common problems. */ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function \ && defined __va_arg_pack_len # include <bits/mqueue2.h> #endif __END_DECLS #endif /* mqueue.h */ PK ! ��U� � alloca.hnu �[��� /* Copyright (C) 1992-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #ifndef _ALLOCA_H #define _ALLOCA_H 1 #include <features.h> #define __need_size_t #include <stddef.h> __BEGIN_DECLS /* Remove any previous definition. */ #undef alloca /* Allocate a block that will be freed when the calling function exits. */ extern void *alloca (size_t __size) __THROW; #ifdef __GNUC__ # define alloca(size) __builtin_alloca (size) #endif /* GCC. */ __END_DECLS #endif /* alloca.h */ PK ! m�ӆ-6 -6 rdma/mlx5-abi.hnu �[��� /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ /* * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef MLX5_ABI_USER_H #define MLX5_ABI_USER_H #include <linux/types.h> #include <linux/if_ether.h> /* For ETH_ALEN. */ #include <rdma/ib_user_ioctl_verbs.h> enum { MLX5_QP_FLAG_SIGNATURE = 1 << 0, MLX5_QP_FLAG_SCATTER_CQE = 1 << 1, MLX5_QP_FLAG_TUNNEL_OFFLOADS = 1 << 2, MLX5_QP_FLAG_BFREG_INDEX = 1 << 3, MLX5_QP_FLAG_TYPE_DCT = 1 << 4, MLX5_QP_FLAG_TYPE_DCI = 1 << 5, MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC = 1 << 6, MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC = 1 << 7, MLX5_QP_FLAG_ALLOW_SCATTER_CQE = 1 << 8, MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE = 1 << 9, MLX5_QP_FLAG_UAR_PAGE_INDEX = 1 << 10, MLX5_QP_FLAG_DCI_STREAM = 1 << 11, }; enum { MLX5_SRQ_FLAG_SIGNATURE = 1 << 0, }; enum { MLX5_WQ_FLAG_SIGNATURE = 1 << 0, }; /* Increment this value if any changes that break userspace ABI * compatibility are made. */ #define MLX5_IB_UVERBS_ABI_VERSION 1 /* Make sure that all structs defined in this file remain laid out so * that they pack the same way on 32-bit and 64-bit architectures (to * avoid incompatibility between 32-bit userspace and 64-bit kernels). * In particular do not use pointer types -- pass pointers in __u64 * instead. */ struct mlx5_ib_alloc_ucontext_req { __u32 total_num_bfregs; __u32 num_low_latency_bfregs; }; enum mlx5_lib_caps { MLX5_LIB_CAP_4K_UAR = (__u64)1 << 0, MLX5_LIB_CAP_DYN_UAR = (__u64)1 << 1, }; enum mlx5_ib_alloc_uctx_v2_flags { MLX5_IB_ALLOC_UCTX_DEVX = 1 << 0, }; struct mlx5_ib_alloc_ucontext_req_v2 { __u32 total_num_bfregs; __u32 num_low_latency_bfregs; __u32 flags; __u32 comp_mask; __u8 max_cqe_version; __u8 reserved0; __u16 reserved1; __u32 reserved2; __aligned_u64 lib_caps; }; enum mlx5_ib_alloc_ucontext_resp_mask { MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0, MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY = 1UL << 1, MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE = 1UL << 2, MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_SQD2RTS = 1UL << 3, MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_REAL_TIME_TS = 1UL << 4, MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_MKEY_UPDATE_TAG = 1UL << 5, }; enum mlx5_user_cmds_supp_uhw { MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE = 1 << 0, MLX5_USER_CMDS_SUPP_UHW_CREATE_AH = 1 << 1, }; /* The eth_min_inline response value is set to off-by-one vs the FW * returned value to allow user-space to deal with older kernels. */ enum mlx5_user_inline_mode { MLX5_USER_INLINE_MODE_NA, MLX5_USER_INLINE_MODE_NONE, MLX5_USER_INLINE_MODE_L2, MLX5_USER_INLINE_MODE_IP, MLX5_USER_INLINE_MODE_TCP_UDP, }; enum { MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM = 1 << 0, MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_REQ_METADATA = 1 << 1, MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_SPI_STEERING = 1 << 2, MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_FULL_OFFLOAD = 1 << 3, MLX5_USER_ALLOC_UCONTEXT_FLOW_ACTION_FLAGS_ESP_AES_GCM_TX_IV_IS_ESN = 1 << 4, }; struct mlx5_ib_alloc_ucontext_resp { __u32 qp_tab_size; __u32 bf_reg_size; __u32 tot_bfregs; __u32 cache_line_size; __u16 max_sq_desc_sz; __u16 max_rq_desc_sz; __u32 max_send_wqebb; __u32 max_recv_wr; __u32 max_srq_recv_wr; __u16 num_ports; __u16 flow_action_flags; __u32 comp_mask; __u32 response_length; __u8 cqe_version; __u8 cmds_supp_uhw; __u8 eth_min_inline; __u8 clock_info_versions; __aligned_u64 hca_core_clock_offset; __u32 log_uar_size; __u32 num_uars_per_page; __u32 num_dyn_bfregs; __u32 dump_fill_mkey; }; struct mlx5_ib_alloc_pd_resp { __u32 pdn; }; struct mlx5_ib_tso_caps { __u32 max_tso; /* Maximum tso payload size in bytes */ /* Corresponding bit will be set if qp type from * 'enum ib_qp_type' is supported, e.g. * supported_qpts |= 1 << IB_QPT_UD */ __u32 supported_qpts; }; struct mlx5_ib_rss_caps { __aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */ __u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */ __u8 reserved[7]; }; enum mlx5_ib_cqe_comp_res_format { MLX5_IB_CQE_RES_FORMAT_HASH = 1 << 0, MLX5_IB_CQE_RES_FORMAT_CSUM = 1 << 1, MLX5_IB_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2, }; struct mlx5_ib_cqe_comp_caps { __u32 max_num; __u32 supported_format; /* enum mlx5_ib_cqe_comp_res_format */ }; enum mlx5_ib_packet_pacing_cap_flags { MLX5_IB_PP_SUPPORT_BURST = 1 << 0, }; struct mlx5_packet_pacing_caps { __u32 qp_rate_limit_min; __u32 qp_rate_limit_max; /* In kpbs */ /* Corresponding bit will be set if qp type from * 'enum ib_qp_type' is supported, e.g. * supported_qpts |= 1 << IB_QPT_RAW_PACKET */ __u32 supported_qpts; __u8 cap_flags; /* enum mlx5_ib_packet_pacing_cap_flags */ __u8 reserved[3]; }; enum mlx5_ib_mpw_caps { MPW_RESERVED = 1 << 0, MLX5_IB_ALLOW_MPW = 1 << 1, MLX5_IB_SUPPORT_EMPW = 1 << 2, }; enum mlx5_ib_sw_parsing_offloads { MLX5_IB_SW_PARSING = 1 << 0, MLX5_IB_SW_PARSING_CSUM = 1 << 1, MLX5_IB_SW_PARSING_LSO = 1 << 2, }; struct mlx5_ib_sw_parsing_caps { __u32 sw_parsing_offloads; /* enum mlx5_ib_sw_parsing_offloads */ /* Corresponding bit will be set if qp type from * 'enum ib_qp_type' is supported, e.g. * supported_qpts |= 1 << IB_QPT_RAW_PACKET */ __u32 supported_qpts; }; struct mlx5_ib_striding_rq_caps { __u32 min_single_stride_log_num_of_bytes; __u32 max_single_stride_log_num_of_bytes; __u32 min_single_wqe_log_num_of_strides; __u32 max_single_wqe_log_num_of_strides; /* Corresponding bit will be set if qp type from * 'enum ib_qp_type' is supported, e.g. * supported_qpts |= 1 << IB_QPT_RAW_PACKET */ __u32 supported_qpts; __u32 reserved; }; struct mlx5_ib_dci_streams_caps { __u8 max_log_num_concurent; __u8 max_log_num_errored; }; enum mlx5_ib_query_dev_resp_flags { /* Support 128B CQE compression */ MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_COMP = 1 << 0, MLX5_IB_QUERY_DEV_RESP_FLAGS_CQE_128B_PAD = 1 << 1, MLX5_IB_QUERY_DEV_RESP_PACKET_BASED_CREDIT_MODE = 1 << 2, MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT = 1 << 3, }; enum mlx5_ib_tunnel_offloads { MLX5_IB_TUNNELED_OFFLOADS_VXLAN = 1 << 0, MLX5_IB_TUNNELED_OFFLOADS_GRE = 1 << 1, MLX5_IB_TUNNELED_OFFLOADS_GENEVE = 1 << 2, MLX5_IB_TUNNELED_OFFLOADS_MPLS_GRE = 1 << 3, MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP = 1 << 4, }; struct mlx5_ib_query_device_resp { __u32 comp_mask; __u32 response_length; struct mlx5_ib_tso_caps tso_caps; struct mlx5_ib_rss_caps rss_caps; struct mlx5_ib_cqe_comp_caps cqe_comp_caps; struct mlx5_packet_pacing_caps packet_pacing_caps; __u32 mlx5_ib_support_multi_pkt_send_wqes; __u32 flags; /* Use enum mlx5_ib_query_dev_resp_flags */ struct mlx5_ib_sw_parsing_caps sw_parsing_caps; struct mlx5_ib_striding_rq_caps striding_rq_caps; __u32 tunnel_offloads_caps; /* enum mlx5_ib_tunnel_offloads */ struct mlx5_ib_dci_streams_caps dci_streams_caps; __u16 reserved; }; enum mlx5_ib_create_cq_flags { MLX5_IB_CREATE_CQ_FLAGS_CQE_128B_PAD = 1 << 0, MLX5_IB_CREATE_CQ_FLAGS_UAR_PAGE_INDEX = 1 << 1, MLX5_IB_CREATE_CQ_FLAGS_REAL_TIME_TS = 1 << 2, }; struct mlx5_ib_create_cq { __aligned_u64 buf_addr; __aligned_u64 db_addr; __u32 cqe_size; __u8 cqe_comp_en; __u8 cqe_comp_res_format; __u16 flags; __u16 uar_page_index; __u16 reserved0; __u32 reserved1; }; struct mlx5_ib_create_cq_resp { __u32 cqn; __u32 reserved; }; struct mlx5_ib_resize_cq { __aligned_u64 buf_addr; __u16 cqe_size; __u16 reserved0; __u32 reserved1; }; struct mlx5_ib_create_srq { __aligned_u64 buf_addr; __aligned_u64 db_addr; __u32 flags; __u32 reserved0; /* explicit padding (optional on i386) */ __u32 uidx; __u32 reserved1; }; struct mlx5_ib_create_srq_resp { __u32 srqn; __u32 reserved; }; struct mlx5_ib_create_qp_dci_streams { __u8 log_num_concurent; __u8 log_num_errored; }; struct mlx5_ib_create_qp { __aligned_u64 buf_addr; __aligned_u64 db_addr; __u32 sq_wqe_count; __u32 rq_wqe_count; __u32 rq_wqe_shift; __u32 flags; __u32 uidx; __u32 bfreg_index; union { __aligned_u64 sq_buf_addr; __aligned_u64 access_key; }; __u32 ece_options; struct mlx5_ib_create_qp_dci_streams dci_streams; __u16 reserved; }; /* RX Hash function flags */ enum mlx5_rx_hash_function_flags { MLX5_RX_HASH_FUNC_TOEPLITZ = 1 << 0, }; /* * RX Hash flags, these flags allows to set which incoming packet's field should * participates in RX Hash. Each flag represent certain packet's field, * when the flag is set the field that is represented by the flag will * participate in RX Hash calculation. * Note: *IPV4 and *IPV6 flags can't be enabled together on the same QP * and *TCP and *UDP flags can't be enabled together on the same QP. */ enum mlx5_rx_hash_fields { MLX5_RX_HASH_SRC_IPV4 = 1 << 0, MLX5_RX_HASH_DST_IPV4 = 1 << 1, MLX5_RX_HASH_SRC_IPV6 = 1 << 2, MLX5_RX_HASH_DST_IPV6 = 1 << 3, MLX5_RX_HASH_SRC_PORT_TCP = 1 << 4, MLX5_RX_HASH_DST_PORT_TCP = 1 << 5, MLX5_RX_HASH_SRC_PORT_UDP = 1 << 6, MLX5_RX_HASH_DST_PORT_UDP = 1 << 7, MLX5_RX_HASH_IPSEC_SPI = 1 << 8, /* Save bits for future fields */ MLX5_RX_HASH_INNER = (1UL << 31), }; struct mlx5_ib_create_qp_rss { __aligned_u64 rx_hash_fields_mask; /* enum mlx5_rx_hash_fields */ __u8 rx_hash_function; /* enum mlx5_rx_hash_function_flags */ __u8 rx_key_len; /* valid only for Toeplitz */ __u8 reserved[6]; __u8 rx_hash_key[128]; /* valid only for Toeplitz */ __u32 comp_mask; __u32 flags; }; enum mlx5_ib_create_qp_resp_mask { MLX5_IB_CREATE_QP_RESP_MASK_TIRN = 1UL << 0, MLX5_IB_CREATE_QP_RESP_MASK_TISN = 1UL << 1, MLX5_IB_CREATE_QP_RESP_MASK_RQN = 1UL << 2, MLX5_IB_CREATE_QP_RESP_MASK_SQN = 1UL << 3, MLX5_IB_CREATE_QP_RESP_MASK_TIR_ICM_ADDR = 1UL << 4, }; struct mlx5_ib_create_qp_resp { __u32 bfreg_index; __u32 ece_options; __u32 comp_mask; __u32 tirn; __u32 tisn; __u32 rqn; __u32 sqn; __u32 reserved1; __u64 tir_icm_addr; }; struct mlx5_ib_alloc_mw { __u32 comp_mask; __u8 num_klms; __u8 reserved1; __u16 reserved2; }; enum mlx5_ib_create_wq_mask { MLX5_IB_CREATE_WQ_STRIDING_RQ = (1 << 0), }; struct mlx5_ib_create_wq { __aligned_u64 buf_addr; __aligned_u64 db_addr; __u32 rq_wqe_count; __u32 rq_wqe_shift; __u32 user_index; __u32 flags; __u32 comp_mask; __u32 single_stride_log_num_of_bytes; __u32 single_wqe_log_num_of_strides; __u32 two_byte_shift_en; }; struct mlx5_ib_create_ah_resp { __u32 response_length; __u8 dmac[ETH_ALEN]; __u8 reserved[6]; }; struct mlx5_ib_burst_info { __u32 max_burst_sz; __u16 typical_pkt_sz; __u16 reserved; }; struct mlx5_ib_modify_qp { __u32 comp_mask; struct mlx5_ib_burst_info burst_info; __u32 ece_options; }; struct mlx5_ib_modify_qp_resp { __u32 response_length; __u32 dctn; __u32 ece_options; __u32 reserved; }; struct mlx5_ib_create_wq_resp { __u32 response_length; __u32 reserved; }; struct mlx5_ib_create_rwq_ind_tbl_resp { __u32 response_length; __u32 reserved; }; struct mlx5_ib_modify_wq { __u32 comp_mask; __u32 reserved; }; struct mlx5_ib_clock_info { __u32 sign; __u32 resv; __aligned_u64 nsec; __aligned_u64 cycles; __aligned_u64 frac; __u32 mult; __u32 shift; __aligned_u64 mask; __aligned_u64 overflow_period; }; enum mlx5_ib_mmap_cmd { MLX5_IB_MMAP_REGULAR_PAGE = 0, MLX5_IB_MMAP_GET_CONTIGUOUS_PAGES = 1, MLX5_IB_MMAP_WC_PAGE = 2, MLX5_IB_MMAP_NC_PAGE = 3, /* 5 is chosen in order to be compatible with old versions of libmlx5 */ MLX5_IB_MMAP_CORE_CLOCK = 5, MLX5_IB_MMAP_ALLOC_WC = 6, MLX5_IB_MMAP_CLOCK_INFO = 7, MLX5_IB_MMAP_DEVICE_MEM = 8, }; enum { MLX5_IB_CLOCK_INFO_KERNEL_UPDATING = 1, }; /* Bit indexes for the mlx5_alloc_ucontext_resp.clock_info_versions bitmap */ enum { MLX5_IB_CLOCK_INFO_V1 = 0, }; struct mlx5_ib_flow_counters_desc { __u32 description; __u32 index; }; struct mlx5_ib_flow_counters_data { RDMA_UAPI_PTR(struct mlx5_ib_flow_counters_desc *, counters_data); __u32 ncounters; __u32 reserved; }; struct mlx5_ib_create_flow { __u32 ncounters_data; __u32 reserved; /* * Following are counters data based on ncounters_data, each * entry in the data[] should match a corresponding counter object * that was pointed by a counters spec upon the flow creation */ struct mlx5_ib_flow_counters_data data[]; }; #endif /* MLX5_ABI_USER_H */ PK ! �:��� � rdma/efa-abi.hnu �[��� /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ /* * Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All rights reserved. */ #ifndef EFA_ABI_USER_H #define EFA_ABI_USER_H #include <linux/types.h> /* * Increment this value if any changes that break userspace ABI * compatibility are made. */ #define EFA_UVERBS_ABI_VERSION 1 /* * Keep structs aligned to 8 bytes. * Keep reserved fields as arrays of __u8 named reserved_XXX where XXX is the * hex bit offset of the field. */ enum { EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH = 1 << 0, EFA_ALLOC_UCONTEXT_CMD_COMP_MIN_SQ_WR = 1 << 1, }; struct efa_ibv_alloc_ucontext_cmd { __u32 comp_mask; __u8 reserved_20[4]; }; enum efa_ibv_user_cmds_supp_udata { EFA_USER_CMDS_SUPP_UDATA_QUERY_DEVICE = 1 << 0, EFA_USER_CMDS_SUPP_UDATA_CREATE_AH = 1 << 1, }; struct efa_ibv_alloc_ucontext_resp { __u32 comp_mask; __u32 cmds_supp_udata_mask; __u16 sub_cqs_per_cq; __u16 inline_buf_size; __u32 max_llq_size; /* bytes */ __u16 max_tx_batch; /* units of 64 bytes */ __u16 min_sq_wr; __u8 reserved_a0[4]; }; struct efa_ibv_alloc_pd_resp { __u32 comp_mask; __u16 pdn; __u8 reserved_30[2]; }; struct efa_ibv_create_cq { __u32 comp_mask; __u32 cq_entry_size; __u16 num_sub_cqs; __u8 reserved_50[6]; }; struct efa_ibv_create_cq_resp { __u32 comp_mask; __u8 reserved_20[4]; __aligned_u64 q_mmap_key; __aligned_u64 q_mmap_size; __u16 cq_idx; __u8 reserved_d0[6]; }; enum { EFA_QP_DRIVER_TYPE_SRD = 0, }; struct efa_ibv_create_qp { __u32 comp_mask; __u32 rq_ring_size; /* bytes */ __u32 sq_ring_size; /* bytes */ __u32 driver_qp_type; }; struct efa_ibv_create_qp_resp { __u32 comp_mask; /* the offset inside the page of the rq db */ __u32 rq_db_offset; /* the offset inside the page of the sq db */ __u32 sq_db_offset; /* the offset inside the page of descriptors buffer */ __u32 llq_desc_offset; __aligned_u64 rq_mmap_key; __aligned_u64 rq_mmap_size; __aligned_u64 rq_db_mmap_key; __aligned_u64 sq_db_mmap_key; __aligned_u64 llq_desc_mmap_key; __u16 send_sub_cq_idx; __u16 recv_sub_cq_idx; __u8 reserved_1e0[4]; }; struct efa_ibv_create_ah_resp { __u32 comp_mask; __u16 efa_address_handle; __u8 reserved_30[2]; }; enum { EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0, EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1, }; struct efa_ibv_ex_query_device_resp { __u32 comp_mask; __u32 max_sq_wr; __u32 max_rq_wr; __u16 max_sq_sge; __u16 max_rq_sge; __u32 max_rdma_size; __u32 device_caps; }; #endif /* EFA_ABI_USER_H */ PK ! �(Tr� � rdma/mthca-abi.hnu �[��� /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ /* * Copyright (c) 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef MTHCA_ABI_USER_H #define MTHCA_ABI_USER_H #include <linux/types.h> /* * Increment this value if any changes that break userspace ABI * compatibility are made. */ #define MTHCA_UVERBS_ABI_VERSION 1 /* * Make sure that all structs defined in this file remain laid out so * that they pack the same way on 32-bit and 64-bit architectures (to * avoid incompatibility between 32-bit userspace and 64-bit kernels). * In particular do not use pointer types -- pass pointers in __u64 * instead. */ struct mthca_alloc_ucontext_resp { __u32 qp_tab_size; __u32 uarc_size; }; struct mthca_alloc_pd_resp { __u32 pdn; __u32 reserved; }; /* * Mark the memory region with a DMA attribute that causes * in-flight DMA to be flushed when the region is written to: */ #define MTHCA_MR_DMASYNC 0x1 struct mthca_reg_mr { __u32 mr_attrs; __u32 reserved; }; struct mthca_create_cq { __u32 lkey; __u32 pdn; __aligned_u64 arm_db_page; __aligned_u64 set_db_page; __u32 arm_db_index; __u32 set_db_index; }; struct mthca_create_cq_resp { __u32 cqn; __u32 reserved; }; struct mthca_resize_cq { __u32 lkey; __u32 reserved; }; struct mthca_create_srq { __u32 lkey; __u32 db_index; __aligned_u64 db_page; }; struct mthca_create_srq_resp { __u32 srqn; __u32 reserved; }; struct mthca_create_qp { __u32 lkey; __u32 reserved; __aligned_u64 sq_db_page; __aligned_u64 rq_db_page; __u32 sq_db_index; __u32 rq_db_index; }; #endif /* MTHCA_ABI_USER_H */ PK ! �[lw�'