From 8af7a10c979ae69d068b4c1a4ebc9f085a3f68c8 Mon Sep 17 00:00:00 2001 From: Vandana Varakantham Date: Mon, 8 Jan 2024 16:36:22 +0000 Subject: [PATCH] feat(eventing): add io-engine events Signed-off-by: Vandana Varakantham --- apis/events/protobuf/v1/event.proto | 16 ++++++++++++++++ apis/events/src/event_traits.rs | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/apis/events/protobuf/v1/event.proto b/apis/events/protobuf/v1/event.proto index ccd14ce..55af049 100644 --- a/apis/events/protobuf/v1/event.proto +++ b/apis/events/protobuf/v1/event.proto @@ -29,6 +29,7 @@ enum EventCategory { HighAvailability = 6; NvmePath = 7; HostInitiator = 8; + IoEngineCategory = 9; } // Event Action @@ -49,6 +50,11 @@ enum EventAction { NvmeConnect = 13; NvmeDisconnect = 14; NvmeKeepAliveTimeout = 15; + ReactorFreeze = 16; + ReactorUnfreeze = 17; + Shutdown = 18; + Start = 19; + Stop = 20; } // Event meta data @@ -101,6 +107,8 @@ message EventDetails { optional NvmePathEventDetails nvme_path_details = 5; // Host initiator event details optional HostInitiatorEventDetails host_initiator_details = 6; + // Reactor event details + optional ReactorEventDetails reactor_details = 7; } // Rebuild event details @@ -186,3 +194,11 @@ message HostInitiatorEventDetails { // Target uuid string uuid = 4; } + +// Reactor event details +message ReactorEventDetails { + // The logical core this reactor is created on + uint64 lcore = 1; + // Reactor state + string state = 2; +} diff --git a/apis/events/src/event_traits.rs b/apis/events/src/event_traits.rs index 432f441..080f8fb 100644 --- a/apis/events/src/event_traits.rs +++ b/apis/events/src/event_traits.rs @@ -1,7 +1,7 @@ use crate::event::{ Component, EventDetails, EventMessage, EventMeta, EventSource, HostInitiatorEventDetails, - NexusChildEventDetails, NvmePathEventDetails, RebuildEventDetails, RebuildStatus, - ReplicaEventDetails, SwitchOverEventDetails, SwitchOverStatus, Version, + NexusChildEventDetails, NvmePathEventDetails, ReactorEventDetails, RebuildEventDetails, + RebuildStatus, ReplicaEventDetails, SwitchOverEventDetails, SwitchOverStatus, Version, }; use chrono::{DateTime, Utc}; use once_cell::sync::OnceCell; @@ -177,6 +177,20 @@ impl EventSource { } self } + + /// Add reactor event specific data to io-engine event source. + pub fn with_reactor_details(self, lcore: u64, state: &str) -> Self { + EventSource { + event_details: Some(EventDetails { + reactor_details: Some(ReactorEventDetails { + lcore, + state: state.to_string(), + }), + ..Default::default() + }), + ..self + } + } } impl EventMessage {