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

[DPB] Allow BGP_NEIGHBOR YANG model with just IP as the key #7992

Merged
merged 46 commits into from
Aug 13, 2021

Conversation

venkatmahalingam
Copy link
Collaborator

@venkatmahalingam venkatmahalingam commented Jun 28, 2021

Why I did it

[DPB] BGP_NEIGHBOR yang model causing DPB errors.

How I did it

Allowed the BGP_NEIGHBOR list with just IP as the key to allow the current BGP neighbor table in the community.

How to verify it

Built the SONIC YANG models.

Which release branch to backport (provide reason below if selected)

Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
Signed-off-by: Venkatesan Mahalingam <[email protected]>
@alexrallen
Copy link
Contributor

Only dynamic port breakout.

Then I am not sure, why these yang models are not written as per config_db entries?

Not sure what you mean here, can you elaborate?

@alexrallen
Copy link
Contributor

@praveen-li The two forms of Yang model are for two different bgp daemons is what my impression is. Where each daemon takes different configuration format. What I do know is that this yang model was originally written with a different configuration format in mind than what SONiC loads by default on master right now. I am working under the assumption that we need to support both formats depending on the frr_mgmt_framework_config value.

@venkatmahalingam Its fine with me if this gets pushed as a hotfix to stabilize DPB on platforms not using the frr form of the DPB config, if its good with other maintainers. However, we do need a long-term solution for this yang model.

Signed-off-by: Venkatesan Mahalingam <[email protected]>
@@ -868,6 +868,11 @@
},
"BGP_NEIGHBOR": {
"default|192.168.1.1": {
"asn": "65200",
"holdtime": "180",
Copy link
Collaborator Author

@venkatmahalingam venkatmahalingam Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 "BGP_NEIGHBOR": {
            "default|192.168.1.1": {
                "asn": "65200",
                "holdtime": "180",
                "keepalive": "60",
                "local_addr": "10.0.0.2",
                "name":"PEER2"
            }
        },

@praveen-li These fields are present in the grouping, looks like libyang is not able to parse it, what's your suggestion? shall we remove these fields and merge the PR to unblock DPB testing? or you can fix the infra to handle the fields from grouping as well?

 Read JSON Section: SAMPLE_CONFIG_DB_JSON
sonic_yang(3):All Keys are not parsed in BGP_NEIGHBOR
dict_keys(['default|192.168.1.1'])
sonic_yang(3):exceptionList:['Value not found for neighbor in default|192.168.1.1', "'asn'"]
sonic_yang(3):Data Loading Failed:All Keys are not parsed in BGP_NEIGHBOR
dict_keys(['default|192.168.1.1'])

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@venkatmahalingam: Yeah, [current translation doesn't allow all the variation of leaf, only choice and leaf is allowed.] if you are using grouping, please add support at:
https://github.com/Azure/sonic-buildimage/blob/5acf2348ba88c69bad3300adabd58b270e5bc01f/src/sonic-yang-mgmt/sonic_yang_ext.py#L209

Also, about the other BGP_NEIGHBOR table
-- where the relevant config go, as I understand BGP_NEIGHBOR table in config_db is different.
-- which daemon processes it, does it make use of current YANG models.
-- please point to the code, which is using this BGP_NEIGHBOR yang model.

Copy link
Collaborator Author

@venkatmahalingam venkatmahalingam Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New generic BGP config models are being processed by the below frrcfgd daemon in BGP container.
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py

@praveen-li I'm not familiar with libyang infra code, can you please add support for grouping?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@venkatmahalingam: can you please point to the function or relevant line in frrcfgd.py, where it is doing config validation against yang. Also from where it reads the config i.e. source of config?.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@praveen-li There is no config validation against YANG in frrcfgd, frrcfgd simply listens for config-DB events and handles them, all configs validations are expected to handle in SONiC YANGs before pushing to config-DB.

description "Keepalive interval";
}

leaf local_addr {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make sure that local address and Peer address belongs to same address family?

Copy link
Collaborator Author

@venkatmahalingam venkatmahalingam Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see any easy way to check this, do you see easy YANG check?

@venkatmahalingam
Copy link
Collaborator Author

@praveen-li Can you look at my replies for your comments, if you are okay, can you approve this PR?

@anshuv-mfst anshuv-mfst added the YANG YANG model related changes label Jul 8, 2021
@venkatmahalingam
Copy link
Collaborator Author

@alexrallen If you don't have any more comments, please approve this PR.

Copy link
Contributor

@alexrallen alexrallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me.

With the current state of this PR it will allow Yang to accept the bgpcfgd form of CONFIG_DB neighbor entries which will fix the root cause of #7959 so given that I would support merging it.

However....

  1. The frrcfgd form is still broken and will be until our Yang implementation is updated to accept the grouping keyword per @praveen-li comment. This is an outstanding bug.
  2. We still need to intelligently differentiate between what form of BGP config the user is using via the DEVICE_METADATA table. This can be a future enhancement.

I will refactor issue #7959 to scope only for the bgpcfgd issue so it may be closed following merging this PR in recognition that the default BGP neighbor template in SONiC should now work and allow DPB to function.

However, I will also raise a new bug to ensure that the issues with the grouping keyword are tracked.

Copy link
Collaborator

@praveen-li praveen-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still do not fully understand, why there are 2 tables\Lists in Yang model, when other table is not used in any YANG validation. But I am approving it based on manual testing done by NVDIA Devs\Tests.

@venkatmahalingam
Copy link
Collaborator Author

I still do not fully understand, why there are 2 tables\Lists in Yang model, when other table is not used in any YANG validation. But I am approving it based on manual testing done by NVDIA Devs\Tests.

Let's discuss this in the next week's YANG meeting.

@venkatmahalingam
Copy link
Collaborator Author

@lguohan Please help to merge this PR.

@venkatmahalingam
Copy link
Collaborator Author

@anshuv-mfst @lguohan Please merge this PR.

@venkatmahalingam
Copy link
Collaborator Author

@anshuv-mfst Please help to merge this PR.

@dgsudharsan
Copy link
Collaborator

@anshuv-mfst Is there anything that we are still waiting on this PR? If not can you please help merge this?

@praveen-li
Copy link
Collaborator

praveen-li commented Aug 10, 2021 via email

@dgsudharsan
Copy link
Collaborator

@praveen-li I am not sure what is the criteria for merge. That's why I asked @anshuv-mfst. If we need some more approvals who should be reviewing it?

@anshuv-mfst
Copy link

Hi @shi-su - could you please review, approve and help with merge. Thanks!

@shi-su shi-su merged commit f73ffa0 into sonic-net:master Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YANG YANG model related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants