Skip to content

Commit

Permalink
add attr condition and fix sanitycheck issue
Browse files Browse the repository at this point in the history
Signed-off-by: Baorong Liu <[email protected]>
  • Loading branch information
baorliu committed Jan 9, 2025
1 parent a11f20c commit 64f3a5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions inc/saibfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ typedef enum _sai_bfd_session_attr_t
* @type sai_object_id_t
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_VIRTUAL_ROUTER
* @condition SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID == true
* @condition SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID == true and SAI_BFD_SESSION_ATTR_USE_NEXT_HOP == false
*/
SAI_BFD_SESSION_ATTR_VIRTUAL_ROUTER,

Expand Down Expand Up @@ -536,10 +536,10 @@ typedef enum _sai_bfd_session_attr_t
* @brief Next Hop ID for single hop BFD session
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_NEXT_HOP
* @allownull true
* @default SAI_NULL_OBJECT_ID
* @condition SAI_BFD_SESSION_ATTR_USE_NEXT_HOP == true
*/
SAI_BFD_SESSION_ATTR_NEXT_HOP_ID,

Expand Down
4 changes: 2 additions & 2 deletions meta/saisanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -3133,11 +3133,11 @@ void check_attr_condition_met(
* SAI_PORT_ATTR_MEDIA_TYPE.
*/

attrs[idx].id ^= (uint32_t)(-1);
attrs[idx].value.s32 ^= (int32_t)(-1);

META_ASSERT_FALSE(sai_metadata_is_condition_met(md, count, attrs), "condition should be met");

attrs[idx].id ^= (uint32_t)(-1);
attrs[idx].value.s32 ^= (int32_t)(-1);
}
}
else if (md->conditiontype == SAI_ATTR_CONDITION_TYPE_MIXED)
Expand Down

0 comments on commit 64f3a5e

Please sign in to comment.