/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ /* * include/uapi/linux/devlink.h - Network physical device Netlink interface * Copyright (c) 2016 Mellanox Technologies. All rights reserved. * Copyright (c) 2016 Jiri Pirko <[email protected]> * * 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 2 of the License, or * (at your option) any later version. */ #ifndef _UAPI_LINUX_DEVLINK_H_ #define _UAPI_LINUX_DEVLINK_H_ #include <linux/const.h> #define DEVLINK_GENL_NAME … #define DEVLINK_GENL_VERSION … #define DEVLINK_GENL_MCGRP_CONFIG_NAME … enum devlink_command { … }; enum devlink_port_type { … }; enum devlink_sb_pool_type { … }; /* static threshold - limiting the maximum number of bytes. * dynamic threshold - limiting the maximum number of bytes * based on the currently available free space in the shared buffer pool. * In this mode, the maximum quota is calculated based * on the following formula: * max_quota = alpha / (1 + alpha) * Free_Buffer * While Free_Buffer is the amount of none-occupied buffer associated to * the relevant pool. * The value range which can be passed is 0-20 and serves * for computation of alpha by following formula: * alpha = 2 ^ (passed_value - 10) */ enum devlink_sb_threshold_type { … }; #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX … enum devlink_eswitch_mode { … }; enum devlink_eswitch_inline_mode { … }; enum devlink_eswitch_encap_mode { … }; enum devlink_port_flavour { … }; enum devlink_rate_type { … }; enum devlink_param_cmode { … }; enum devlink_param_fw_load_policy_value { … }; enum devlink_param_reset_dev_on_drv_probe_value { … }; enum { … }; /* Specify what sections of a flash component can be overwritten when * performing an update. Overwriting of firmware binary sections is always * implicitly assumed to be allowed. * * Each section must be documented in * Documentation/networking/devlink/devlink-flash.rst * */ enum devlink_flash_overwrite { … }; #define DEVLINK_FLASH_OVERWRITE_SETTINGS … #define DEVLINK_FLASH_OVERWRITE_IDENTIFIERS … #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS … enum devlink_attr_selftest_id { … }; enum devlink_selftest_status { … }; enum devlink_attr_selftest_result { … }; /** * enum devlink_trap_action - Packet trap action. * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not * sent to the CPU. * @DEVLINK_TRAP_ACTION_TRAP: The sole copy of the packet is sent to the CPU. * @DEVLINK_TRAP_ACTION_MIRROR: Packet is forwarded by the device and a copy is * sent to the CPU. */ enum devlink_trap_action { … }; /** * enum devlink_trap_type - Packet trap type. * @DEVLINK_TRAP_TYPE_DROP: Trap reason is a drop. Trapped packets are only * processed by devlink and not injected to the * kernel's Rx path. * @DEVLINK_TRAP_TYPE_EXCEPTION: Trap reason is an exception. Packet was not * forwarded as intended due to an exception * (e.g., missing neighbour entry) and trapped to * control plane for resolution. Trapped packets * are processed by devlink and injected to * the kernel's Rx path. * @DEVLINK_TRAP_TYPE_CONTROL: Packet was trapped because it is required for * the correct functioning of the control plane. * For example, an ARP request packet. Trapped * packets are injected to the kernel's Rx path, * but not reported to drop monitor. */ enum devlink_trap_type { … }; enum { … }; enum devlink_reload_action { … }; enum devlink_reload_limit { … }; #define DEVLINK_RELOAD_LIMITS_VALID_MASK … enum devlink_linecard_state { … }; enum devlink_attr { … }; /* Mapping between internal resource described by the field and system * structure */ enum devlink_dpipe_field_mapping_type { … }; /* Match type - specify the type of the match */ enum devlink_dpipe_match_type { … }; /* Action type - specify the action type */ enum devlink_dpipe_action_type { … }; enum devlink_dpipe_field_ethernet_id { … }; enum devlink_dpipe_field_ipv4_id { … }; enum devlink_dpipe_field_ipv6_id { … }; enum devlink_dpipe_header_id { … }; enum devlink_resource_unit { … }; enum devlink_port_fn_attr_cap { … }; #define DEVLINK_PORT_FN_CAP_ROCE … #define DEVLINK_PORT_FN_CAP_MIGRATABLE … #define DEVLINK_PORT_FN_CAP_IPSEC_CRYPTO … #define DEVLINK_PORT_FN_CAP_IPSEC_PACKET … enum devlink_port_function_attr { … }; enum devlink_port_fn_state { … }; /** * enum devlink_port_fn_opstate - indicates operational state of the function * @DEVLINK_PORT_FN_OPSTATE_ATTACHED: Driver is attached to the function. * For graceful tear down of the function, after inactivation of the * function, user should wait for operational state to turn DETACHED. * @DEVLINK_PORT_FN_OPSTATE_DETACHED: Driver is detached from the function. * It is safe to delete the port. */ enum devlink_port_fn_opstate { … }; #endif /* _UAPI_LINUX_DEVLINK_H_ */