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

[intfmgrd]: Support loopback #742

Merged
merged 2 commits into from
Jan 16, 2019
Merged

[intfmgrd]: Support loopback #742

merged 2 commits into from
Jan 16, 2019

Conversation

marian-pritsak
Copy link
Collaborator

@marian-pritsak marian-pritsak commented Jan 9, 2019

In #635, the intfmgrd does not read loopback address from config db at all and then it does not configure the loopback address in the asic. The PR fix the issue by reading from the config db. Since loopback address is configured via /etc/network/interface so it is skipped in intfmgrd.

Signed-off-by: Marian Pritsak [email protected]

Signed-off-by: Marian Pritsak <[email protected]>
@marian-pritsak
Copy link
Collaborator Author

retest this please

setIntfVrf(alias, vrf_name);
m_appIntfTableProducer.set(alias, data);
// Set Interface VRF except for lo
if (!is_lo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you excluding the loopbacks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ip address for lo is configured in /etc/network/interfaces

Copy link
Contributor

@nikos-github nikos-github Jan 9, 2019

Choose a reason for hiding this comment

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

Not sure I follow your response. It is valid for a loopback to be in a vrf. Why are you excluding the loopbacks?

Copy link
Contributor

Choose a reason for hiding this comment

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

@nikos-github , your comment is valid, but currently we do not support to have loopback in the vrf. We can add it in the future PR.

@@ -173,7 +196,11 @@ bool IntfMgr::doIntfAddrTask(const vector<string>& keys,
return false;
}

setIntfIp(alias, "add", ip_prefix.to_string(), ip_prefix.isV4());
// Set Interface IP except for lo
if (!is_lo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please explain how your code is dealing with multiple IP addresses on the loopback which is a valid config and must continue to work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What's the issue with multiple IPs?
It's just different keys in APP DB

Copy link
Contributor

Choose a reason for hiding this comment

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

Today the loopback in sonic has more than one address. So with your changes post #635, will all the loopback addresses make it to the asic and correctly? I'm just asking you to explain and also test.

@@ -186,7 +213,11 @@ bool IntfMgr::doIntfAddrTask(const vector<string>& keys,
}
else if (op == DEL_COMMAND)
{
setIntfIp(alias, "del", ip_prefix.to_string(), ip_prefix.isV4());
// Set Interface IP except for lo
Copy link
Contributor

Choose a reason for hiding this comment

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

This set of changes require unit tests.

@svc-acs
Copy link
Collaborator

svc-acs commented Jan 9, 2019

retest this please

@jipanyang
Copy link
Contributor

Is it expected to support incremental IP config for loopback interface?

if yes, lo config should be removed from /etc/network/interfaces and lo needs to be treated as other regular interface as to address config.

@nikos-github
Copy link
Contributor

@jipanyang Ideally it should be treated like any other interface when it comes to its incremental config, etc. however the loopback interface is kind of special since it's the anchoring point for 127.0.0.1. So I'm not sure it's a simple yes/no answer to your question but certainly today's loopback may have more than one address.

@yxieca
Copy link
Contributor

yxieca commented Jan 9, 2019

This change indeed solves the issue where ptf cannot ping lo interface. It is to my belief that the issue was introduced by PR #635

@lguohan
Copy link
Contributor

lguohan commented Jan 10, 2019

in long run, we should create lo interface and assign IP address to it, so that we can move those interfaces to the vrf, but current we do not support this.

@nikos-github
Copy link
Contributor

in long run, we should create lo interface and assign IP address to it, so that we can move those interfaces to the vrf, but current we do not support this.

That's fine. Since we don't currently support the loopback in the vrf, we can exclude it. I just need my other two comments addressed please regarding testing (including unit test) as well as an explanation how all the IP addresses a loopback can have, will make it to the ASIC.

@prsunny
Copy link
Collaborator

prsunny commented Jan 11, 2019

@marian-pritsak , I don't think we need to check for if (!is_lo) in code. For doIntfGeneralTask, it is invoked only if the interface is configured in config_db as part of VRF which is currently not the case. For doIntfAddrTask, it will be applying the same IP address again which can produce an error log. If you need to skip this error, its fine to have the check but I feel doIntfGeneralTask doesn't need the check. What do you think?

@yxieca
Copy link
Contributor

yxieca commented Jan 16, 2019

This change is required by warm reboot test. Let's keep the discussion offline and make changes accordingly.

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

Successfully merging this pull request may close these issues.

8 participants