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

Flush ip before setting ip #325

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Flush ip before setting ip #325

merged 1 commit into from
Jan 21, 2025

Conversation

bn222
Copy link
Contributor

@bn222 bn222 commented Jan 17, 2025

No description provided.

@bn222
Copy link
Contributor Author

bn222 commented Jan 17, 2025

@sudhar-krishnakumar please merge this. I've tested it and it worked as expected

@sudhar-krishnakumar
Copy link
Contributor

@bn222 Sure, checking. Actually, we dont support this use-case. P4 needs to be restarted(if VSP is restarted), so thats why we did not fix this. Because, we dont support this use-case. If you do init on VSP, there are other issues, that will pop-up, if P4 was not restarted.

@bn222 Even if we resolve this error, you cant really run any traffic test, since we dont support this. I am just worried, that with this error fixed, it should NOT give an illusion, that P4 need not be restarted, if VSP was restarted. This error was helpful, to BLOCK running VSP...if P4 was not restarted. With this error resolved, it would allow such use-case(that is VSP running, without P4 restart), which is NOT supported. (edited)

@bn222
Copy link
Contributor Author

bn222 commented Jan 17, 2025

Would an error on second call to init be enough to guard against that?

@sudhar-krishnakumar
Copy link
Contributor

Would an error on second call to init be enough to guard against that?

@bn222 When VSP gets started(in Run function), it tries to update this bridge config. I thought DPU calls VSP's Init function only once during startup. If we merge this PR, then VSP's RUN will go thro fine, but then during call to VSP's Init, VSP is likely to error out, if P4 was not restarted. Having this IP address assignment, was indirectly helping in detecting such scenario, up-front, prior to VSP's Init call.

Signed-off-by: Balazs Nemeth <[email protected]>
@bn222
Copy link
Contributor Author

bn222 commented Jan 20, 2025

I think you are assuming that if you restart the pod, there will be no IP on the br. Having you tested that?

To add more clarity, if you assign an IP to the br, it will be there until you manually remove it, even if you restart the pod as the ip is stored outside the context of the pod. To put it differently, it picks up the IP from the previous run even if you restart the pod and the error will gate the pod from proceeding. That's the reason we need this change.

I've added code to error out if you call init twice with a clear message, but this is besides the issue that is being addressed here. I understand what you're saying: it was convenient that a second call to init was caught and an error message was shown. In general, I don't think erroring out for a different reason to prevent some code from executing is good code design. If you error out for a specific reason, you need to catch that specific reason or you will probably introduce a bug.

@sudhar-krishnakumar
Copy link
Contributor

sudhar-krishnakumar commented Jan 21, 2025

@bn222 , what I was discussing ...was not related ...to what happens...when Init gets called twice. In this case, it was about Run function, which gets called when VSP starts, which is were the br-infra bridge gets setup. Also when VSP terminates, VSP deletes the br-infra bridge, which unbinds any ports assigned to br-infra.

@sudhar-krishnakumar sudhar-krishnakumar merged commit 0f98035 into intel:main Jan 21, 2025
10 checks passed
@sudhar-krishnakumar
Copy link
Contributor

@bn222 we create br-infra in OVS, so it will update OVS-DB(in P4 container). Then we assign IP to bridge using ip command. When P4 restarts, it is expected to restart with a clean OVS-DB. Not sure, how the IP on the bridge will be retained during pod restart.

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