diff --git a/fboss/agent/hw/sai/api/TamApi.h b/fboss/agent/hw/sai/api/TamApi.h index a1292fd896718..e53161f722d49 100644 --- a/fboss/agent/hw/sai/api/TamApi.h +++ b/fboss/agent/hw/sai/api/TamApi.h @@ -184,7 +184,7 @@ struct SaiTamEventTraits { Attributes::Type, Attributes::ActionList, Attributes::CollectorList, - Attributes::SwitchEventType, + std::optional, std::optional, std::optional, std::optional, diff --git a/fboss/agent/hw/sai/api/tests/TamApiTest.cpp b/fboss/agent/hw/sai/api/tests/TamApiTest.cpp index cc45aabc0f1a0..a8f75303da3b1 100644 --- a/fboss/agent/hw/sai/api/tests/TamApiTest.cpp +++ b/fboss/agent/hw/sai/api/tests/TamApiTest.cpp @@ -154,8 +154,8 @@ TEST_F(TamApiTest, TamEvent) { std::get(eventAttr) = eventActions; std::get(eventAttr) = eventCollectors; - std::get(eventAttr) = - eventTypes; + std::get>( + eventAttr) = eventTypes; std::get>(eventAttr) = deviceId; std::get>( diff --git a/fboss/agent/hw/sai/store/tests/TamStoreTest.cpp b/fboss/agent/hw/sai/store/tests/TamStoreTest.cpp index ef570028b3f83..67ddb9bef67df 100644 --- a/fboss/agent/hw/sai/store/tests/TamStoreTest.cpp +++ b/fboss/agent/hw/sai/store/tests/TamStoreTest.cpp @@ -79,8 +79,8 @@ class TamStoreTest : public SaiStoreTest { SAI_TAM_EVENT_TYPE_PACKET_DROP; std::get(result) = actions; std::get(result) = collectors; - std::get(result) = - eventTypes; + std::get>( + result) = eventTypes; std::get>(result) = deviceId; std::get>( @@ -293,8 +293,10 @@ TEST_F(TamStoreTest, tamCtors) { std::get(tamEventAhk) .value()); EXPECT_EQ( - GET_ATTR(TamEvent, SwitchEventType, eventObj.attributes()), - std::get(tamEventAhk) + GET_OPT_ATTR(TamEvent, SwitchEventType, eventObj.attributes()), + std::get>( + tamEventAhk) + .value() .value()); auto tamObj = createObj(tam); @@ -425,8 +427,10 @@ TEST_F(TamStoreTest, setObject) { GET_ATTR(TamEvent, CollectorList, event->attributes()), std::get(eventAhk).value()); EXPECT_EQ( - GET_ATTR(TamEvent, SwitchEventType, event->attributes()), - std::get(eventAhk) + GET_OPT_ATTR(TamEvent, SwitchEventType, event->attributes()), + std::get>( + eventAhk) + .value() .value()); auto tamAhk = tamTraits(event->adapterKey()); @@ -470,11 +474,11 @@ TEST_F(TamStoreTest, updateObject) { auto tam = s.get().setObject(tamAhk, tamAhk); std::vector newEvents = {4, 5, 6}; - std::get(eventAhk) = - newEvents; + std::get>( + eventAhk) = newEvents; auto updatedEvent = s.get().setObject(eventAhk, eventAhk); EXPECT_EQ( - GET_ATTR(TamEvent, SwitchEventType, updatedEvent->attributes()), + GET_OPT_ATTR(TamEvent, SwitchEventType, updatedEvent->attributes()), newEvents); std::get(transportAhk) = 10003; diff --git a/fboss/agent/hw/sai/switch/npu/tajo/SaiTamManager.cpp b/fboss/agent/hw/sai/switch/npu/tajo/SaiTamManager.cpp index 516e449752de4..7d2e7a49ff80f 100644 --- a/fboss/agent/hw/sai/switch/npu/tajo/SaiTamManager.cpp +++ b/fboss/agent/hw/sai/switch/npu/tajo/SaiTamManager.cpp @@ -76,8 +76,8 @@ SaiTamManager::SaiTamManager( std::get(eventTraits) = actions; std::get(eventTraits) = collectors; - std::get(eventTraits) = - eventTypes; + std::get>( + eventTraits) = eventTypes; auto& eventStore = saiStore_->get(); auto event = eventStore.setObject(eventTraits, eventTraits);