-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
zebra: remove ZEBRA_INTERFACE_VRF_UPDATE #10733
Conversation
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-3928/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
|
3b720aa
to
f616c32
Compare
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 amd64 part 9: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO9U18AMD64-3933/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 9 Successful on other platforms/tests
|
f616c32
to
a9cdf18
Compare
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-3936/ This is a comment from an automated CI system. |
IMO shouldn't the operation just be a simple VRF_UPDATE? instead of doing the delete than update then add? |
Yes, use |
@@ -616,7 +616,6 @@ void zebra_interface_vrf_update_del(struct interface *ifp, vrf_id_t new_vrf_id) | |||
zsend_interface_update(ZEBRA_INTERFACE_DOWN, client, ifp); | |||
client->ifdel_cnt++; | |||
zsend_interface_delete(client, ifp); | |||
zsend_interface_vrf_update(client, ifp, new_vrf_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How it will be taken care at the client side.
Example pimd client:
In the function, pim_zebra_interface_vrf_update() it will update the interface to new VRF.
If zebra is not sending the vrf_update msg then how it will be taken care.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As i said, it is redundant and no use.
pim_zebra_interface_vrf_update()
will never call if_update_to_new_vrf()
, it will immediately exit with NULL ifp
, which is returned by zebra_interface_vrf_update_read()
.
@donaldsharp Any suggestion? |
This PR is stale because it has been open 180 days with no activity. Comment or remove the |
If removed this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change look good.
When zsend_interface_delete
is sent the protocol daemons call the library function zclient_interface_delete
which removes the interface from the daemon, so when the zsend_interface_vrf_update
message is sent no interface will be found.
Unless there is a daemon which does not use the standard zebra_interface_vrf_update_read
, this ZEBRA_INTERFACE_VRF_UPDATE
will be useless because the interface will never be there causing the following log message: https://github.com/FRRouting/frr/blob/master/lib/zclient.c#L3068
I checked all daemons and they all use zebra_interface_vrf_update_read
with ZEBRA_INTERFACE_VRF_UPDATE
(maybe we could even move this repeated code to lib
and split the specialized protocol code).
Hmm, I still wonder about this: it looks like isis and ospf6 don't even handle this message, but I see bgp doing quite a lot of work when this arrives. has someone knowledgeable carefully examined the bgp code and confirmed that nothing would be lost if that code never ran again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I still wonder about this: it looks like isis and ospf6 don't even handle this message, but I see bgp doing quite a lot of work when this arrives. has someone knowledgeable carefully examined the bgp code and confirmed that nothing would be lost if that code never ran again? Also, if we're going to stop sending the zapi message, really we should remove it, and remove all the handlers for it (daemon and lib/zclient I guess.) Leaving the stale code around is just asking for future pain?
Agreed, looks like bgpd
was the only real user of this. I looked at the history of that function and the most meaningful commit was from 7 years ago ( bfcd43b ).
I think we should remove all uses of this message since its the only place its being used and it seems unnecessary now.
a9cdf18
to
690681a
Compare
Thanks for checking this PR, i have re-pushed it. |
I don't see an answer to my question from earlier. There is significant code in the bgp handler for this message: has someone knowledgeable examined that code and verified that bgp won't lose anything if that handler function is removed? |
Currently |
@@ -234,221 +234,219 @@ Zebra Protocol Commands | |||
+-----------------------------------------+-------+ | |||
| ZEBRA_VRF_LABEL | 35 | | |||
+-----------------------------------------+-------+ | |||
| ZEBRA_INTERFACE_VRF_UPDATE | 36 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof - yeah, I'd forgotten about this table. I think it's not worth documenting these values, and maintaining this table. Let's just refer to the header file?
I'm ok with this; the (scrupulous) change to the docs did raise a question for me about that dev doc file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good. ZEBRA_INTERFACE_VRF_UPDATE
was introduced 8 years ago ( c8e264b ) and at that time zebra clients had to ask for VRF interest to get updates. When there was no interest in updates the ZEBRA_INTERFACE_VRF_UPDATE
was useful:
if (!vrf_bitmap_check (client->ifinfo, new_vrf_id))
{
/* Need to delete if the client is not interested in the new VRF. */
zsend_interface_update (ZEBRA_INTERFACE_DOWN, client, ifp);
client->ifdel_cnt++;
zsend_interface_delete (client, ifp);
}
else if (vrf_bitmap_check (client->ifinfo, ifp->vrf_id))
{
/* Client is interested in both VRFs, inform about the change. */
zsend_interface_vrf_update (client, ifp, new_vrf_id);
}
Later ( 4fe5171 ) the code was simplified, but the VRF_UPDATE message was kept.
I don't see how this message makes sense anymore since the work for """update""" the VRF is the same as delete all interface information and then add back (which is what is already happening).
Currently when one interface changes its VRF, zebra will send these messages to all daemons in *order*: 1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF ) 2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF ) 3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF ) When daemons deal with `VRF_UPDATE`, they use `zebra_interface_vrf_update_read()->if_lookup_by_name()` to check the interface exist or not in old VRF. This check will always return *NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't find this interface in old VRF. Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough, they will deal with RB tree, so don't send this `VRF_UPDATE` message when vrf changes. Since all daemons have good mechanism to deal with changing vrf, and don't use this `VRF_UPDATE` mechanism. So, it is safe to completely remove all the code with `VRF_UPDATE`. Signed-off-by: anlan_cs <[email protected]>
Signed-off-by: anlan_cs <[email protected]>
690681a
to
56f141e
Compare
Okay, add one commit for it. |
ci:rerun |
Currently when one interface changes its VRF, zebra will send these messages to
all daemons in order:
1)
ZEBRA_INTERFACE_DELETE
( notify them delete from old VRF )2)
ZEBRA_INTERFACE_VRF_UPDATE
( notify them move from old to new VRF )3)
ZEBRA_INTERFACE_ADD
( notify them added into new VRF )When daemons deal with
VRF_UPDATE
, they usezebra_interface_vrf_update_read()->if_lookup_by_name()
to check the interface exist or not in old VRF. This check will always return
NULL because
DELETE
( deleted from old VRF ) is already done, so can'tfind this interface in old VRF.
Send
VRF_UPDATE
is redundant and unuseful.DELETE
andADD
are enough,they will deal with RB tree, so don't send this
VRF_UPDATE
message.