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

[subnet_decap] Use new tunnel&&decap term db schema and add subnet decap tunnel to ipinip.json #18752

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

lolyu
Copy link
Contributor

@lolyu lolyu commented Apr 23, 2024

Why I did it

Enable ipinip.json.j2 to use the new DB schema to create decap tunnel and decap terms.

This depends on: sonic-net/sonic-swss#3117

Signed-off-by: Longxiang Lyu lolv@microsoft.com

Work item tracking
  • Microsoft ADO (number only): 27768450

How I did it

Use TUNNEL_DECAP_TERM_TABLE to create decap rules.

How to verify it

UT and verify on testbed together with sonic-net/sonic-swss#3117.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@lolyu lolyu requested a review from lguohan as a code owner April 23, 2024 03:49
@lolyu lolyu requested a review from bingwang-ms April 23, 2024 03:50
@lolyu lolyu force-pushed the subnet_decap_ipinip_template branch from 2e22e18 to bc0b2c5 Compare April 23, 2024 09:02
@lguohan
Copy link
Collaborator

lguohan commented May 13, 2024

please specify dependency so that we know when to merge.

@@ -56,15 +55,24 @@
"ttl_mode":"pipe"
},
"OP": "SET"
}
}{% if ipv4_addresses %},
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see {% endif %} for this if condition.

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like if we don't have ipv4_addresses, and only have ipv6_loopback_addresses, the , is also required.

Copy link
Contributor Author

@lolyu lolyu May 17, 2024

Choose a reason for hiding this comment

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

I don't see {% endif %} for this if condition.

Please check LINE#59, this check condition adds the , only if there are IPv4 decap terms.

Copy link
Contributor Author

@lolyu lolyu May 17, 2024

Choose a reason for hiding this comment

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

I feel like if we don't have ipv4_addresses, and only have ipv6_loopback_addresses, the , is also required.

If we don't have ipv4_addresses, LINE#45 ~ LINE#69 will be skipped, and we will only have IPv6 tunnel && decap terms, there is no need to add the , as the IPv5 tunnel now comes to the begining.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the else at Line#59 to close the if at Line#45?

{% endif %}
{% endfor %}
{% endif %}
{% if ipv4_loopback_addresses and ipv6_loopback_addresses %},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ipv4_loopback_addresses needs to be checked here?

Copy link
Contributor Author

@lolyu lolyu May 17, 2024

Choose a reason for hiding this comment

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

Let me list out all possible conditions:
if ipv4_loopback_addresses is empty, ipv6_loopback_addresses is empty: no tunnel && decap terms will be created, no need to add ,.
if ipv4_loopback_addresses is not empty, ipv6_loopback_addresses is empty: only IPv4 tunnel && decap terms will be created, no need to add ,.
if ipv4_loopback_addresses is empty, ipv6_loopback_addresses is not empty: only IPv6 tunnel && decap terms will be created, no need to add ,.
if ipv4_loopback_addresses is not empty, ipv6_loopback_addresses is not empty: both IPv4&&IPv6 tunnel && decap terms will be created, , will be added to inter-connect those two parts.

@bingwang-ms
Copy link
Contributor

Are you going to include the script for warm-reboot scenario in this PR?

@lolyu
Copy link
Contributor Author

lolyu commented May 17, 2024

please specify dependency so that we know when to merge.

Added dependency in PR description.

@lolyu
Copy link
Contributor Author

lolyu commented May 17, 2024

Are you going to include the script for warm-reboot scenario in this PR?

No, let's do this incrementally PR by PR:

  1. adapt to new schema - this PR
  2. add the subnet decap tunnel to the ipinip.json.j2 template
  3. add the warm-reboot support.

@lolyu lolyu changed the title [decap] Enable ipinip.json.j2 template to use new db schema [subnet_decap] Use new tunnel&&decap term db schema and add subnet decap tunnel to ipinip.json May 28, 2024
@lolyu
Copy link
Contributor Author

lolyu commented May 28, 2024

Hi @bingwang-ms, added the subnet decap tunnel part to this PR, please help review.

lolyu added 2 commits May 31, 2024 01:03
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu
Copy link
Contributor Author

lolyu commented May 31, 2024

The PR test failure of test_add_rack is expected.
test_add_rack tries to diff the APPL_DB before and after removing a T0 neighbor configs. As the decap term is created with a separate table TUNNEL_DECAP_TERM_TABLE and the removal of a T0 neighbor and its port-channel interface/IP will delete the decap term of it.

@lguohan
Copy link
Collaborator

lguohan commented May 31, 2024

/azpw ms_conflic

@lguohan
Copy link
Collaborator

lguohan commented May 31, 2024

@lolyu , then we cannot merge. can you have a plan to make sure there is no test failure?

@bingwang-ms
Copy link
Contributor

/azpw ms_conflic

@bingwang-ms
Copy link
Contributor

@lolyu , then we cannot merge. can you have a plan to make sure there is no test failure?

@lguohan The test failure has been fixed, but the PR is blocked by ms_conflict checker.

@bingwang-ms
Copy link
Contributor

/azpw ms_conflic

@bingwang-ms
Copy link
Contributor

/azp rerun

Copy link

Command 'rerun' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@bingwang-ms
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms
Copy link
Contributor

/azpw ms_conflict

1 similar comment
@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azp run

Copy link

Commenter does not have sufficient privileges for PR 18752 in repo sonic-net/sonic-buildimage

@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

5 similar comments
@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

@lolyu
Copy link
Contributor Author

lolyu commented Jun 4, 2024

/azpw ms_conflict

@yxieca yxieca merged commit ca5e3b2 into sonic-net:master Jun 4, 2024
20 checks passed
arun1355492 pushed a commit to arun1355492/sonic-buildimage that referenced this pull request Jul 26, 2024
…cap tunnel to `ipinip.json` (sonic-net#18752)

* [decap] Enhance `ipinip.json.j2` template to use new db schema

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
Co-authored-by: bingwang <bingwang@microsoft.com>
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.

5 participants