Skip to content

Commit 64f3a5e

Browse files
committed
add attr condition and fix sanitycheck issue
Signed-off-by: Baorong Liu <[email protected]>
1 parent a11f20c commit 64f3a5e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

inc/saibfd.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ typedef enum _sai_bfd_session_attr_t
164164
* @type sai_object_id_t
165165
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
166166
* @objects SAI_OBJECT_TYPE_VIRTUAL_ROUTER
167-
* @condition SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID == true
167+
* @condition SAI_BFD_SESSION_ATTR_HW_LOOKUP_VALID == true and SAI_BFD_SESSION_ATTR_USE_NEXT_HOP == false
168168
*/
169169
SAI_BFD_SESSION_ATTR_VIRTUAL_ROUTER,
170170

@@ -536,10 +536,10 @@ typedef enum _sai_bfd_session_attr_t
536536
* @brief Next Hop ID for single hop BFD session
537537
*
538538
* @type sai_object_id_t
539-
* @flags CREATE_AND_SET
539+
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
540540
* @objects SAI_OBJECT_TYPE_NEXT_HOP
541541
* @allownull true
542-
* @default SAI_NULL_OBJECT_ID
542+
* @condition SAI_BFD_SESSION_ATTR_USE_NEXT_HOP == true
543543
*/
544544
SAI_BFD_SESSION_ATTR_NEXT_HOP_ID,
545545

meta/saisanitycheck.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,11 +3133,11 @@ void check_attr_condition_met(
31333133
* SAI_PORT_ATTR_MEDIA_TYPE.
31343134
*/
31353135

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

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

3140-
attrs[idx].id ^= (uint32_t)(-1);
3140+
attrs[idx].value.s32 ^= (int32_t)(-1);
31413141
}
31423142
}
31433143
else if (md->conditiontype == SAI_ATTR_CONDITION_TYPE_MIXED)

0 commit comments

Comments
 (0)