History

devlink: Add devlink reload limit option

Add reload limit to demand restrictions on reload actions. Reload limits supported: no_reset: No reset allowed, no down time allowed, no link flap and no configuration is lost. By default reload limit is unspecified and so no constraints on reload actions are required. Some combinations of action and limit are invalid. For example, driver can not reinitialize its entities without any downtime. The no_reset reload limit will have usecase in this patchset to implement restricted fw_activate on mlx5. Have the uapi parameter of reload limit ready for future support of multiselection.

Moshe Shemesh committed 6 years ago

Commit dc64cc71 parent ccdf0727 files · +119 −13Browse files

Showing the changes to include/uapi (1 of 7 files). Show all

Unified · Split

include/uapi/linux/devlink.h+14−0
@@ -311,6 +311,19 @@ enum devlink_reload_action { · 310 unmodified lines
311311 DEVLINK_RELOAD_ACTION_MAX = __DEVLINK_RELOAD_ACTION_MAX - 1
312312 };
313313
314+enum devlink_reload_limit {
315+ DEVLINK_RELOAD_LIMIT_UNSPEC, /* unspecified, no constraints */
316+ DEVLINK_RELOAD_LIMIT_NO_RESET, /* No reset allowed, no down time allowed,
317+ * no link flap and no configuration is lost.
318+ */
319+
320+ /* Add new reload limit above */
321+ __DEVLINK_RELOAD_LIMIT_MAX,
322+ DEVLINK_RELOAD_LIMIT_MAX = __DEVLINK_RELOAD_LIMIT_MAX - 1
323+};
324+
325+#define DEVLINK_RELOAD_LIMITS_VALID_MASK (BIT(__DEVLINK_RELOAD_LIMIT_MAX) - 1)
326+
314327 enum devlink_attr {
315328 /* don't change the order or add anything between, this is ABI! */
316329 DEVLINK_ATTR_UNSPEC,
@@ -505,6 +518,7 @@ enum devlink_attr { · 188 unmodified lines
505518
506519 DEVLINK_ATTR_RELOAD_ACTION, /* u8 */
507520 DEVLINK_ATTR_RELOAD_ACTIONS_PERFORMED, /* bitfield32 */
521+ DEVLINK_ATTR_RELOAD_LIMITS, /* bitfield32 */
508522
509523 /* add new attributes above here, update the policy in devlink.c */
510524