Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace keys as required by sai_deserialize_neighbor_entry() in sonic-sairedis. #247

Conversation

IGordynskyi
Copy link
Contributor

Failed to create the neighbor entry:

(Pdb++) print (obj, attrs, do_assert)
SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{"ip_address": "10.1.1.2", "rif_id": "oid:0x600000000001e", "switch_id": "oid:0x21000000000000"} ['SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS', '00:11:11:11:11:11'] True
(Pdb++) c
            )
...
        self.r.delete("GETRESPONSE_KEY_VALUE_OP_QUEUE")
    
>       assert len(status) == 3, f"SAI \"{op[1:]}\" operation failure!"
E       AssertionError: SAI "create" operation failure!

SAI headers neighbor entry definition:

/**
 * @brief Neighbor entry
 */
typedef struct _sai_neighbor_entry_t
{
    /**
     * @brief Switch ID
     *
     * @objects SAI_OBJECT_TYPE_SWITCH
     */
    sai_object_id_t switch_id;

    /**
     * @brief Router interface ID
     *
     * @objects SAI_OBJECT_TYPE_ROUTER_INTERFACE
     */
    sai_object_id_t rif_id;

    /**
     * @brief IP address
     */
    sai_ip_address_t ip_address;

} sai_neighbor_entry_t;

Redis expect the entry key in the following format:

2017-06-14.01:56:16.538038|c|SAI_OBJECT_TYPE_NEIGHBOR_ENTRY:{"ip":"10.1.1.2","rif":"oid:0x600000000001e","switch_id":"oid:0x21000000000000"}|SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS=00:11:11:11:11:11

@andriy-kokhan
Copy link
Contributor

Yeh, that's true...
https://github.com/sonic-net/sonic-sairedis/blob/master/meta/SaiSerialize.cpp#L827
Good catch! Thank you!

@andriy-kokhan andriy-kokhan merged commit 07e3c75 into opencomputeproject:main Dec 20, 2024
9 checks passed
@IGordynskyi
Copy link
Contributor Author

Yeh, that's true... https://github.com/sonic-net/sonic-sairedis/blob/master/meta/SaiSerialize.cpp#L827 Good catch! Thank you!

Always welcome!=)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants