Allow other subsystems to check if VNET is being destroyed.
MFC after: 1 week
Differential D33662
vnet: make VNET_IS_SHUTTING_DOWN macro global. melifaro on Dec 26 2021, 3:20 PM. Authored by Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions Can you please tell what you need it for. Comment Actions Sure! Specifically, there is D33658, which introduces the data structure, struct nhop_neigh, that adds _some_ coupling between nexthops and llentries. The idea of using the VNET_IS_SHUTTING_DOWN macro is to stop propagating new llentry state updates after vnet shutdown starts. I can avoid using the macro, by adding an explicit hook somewhere at the beginning of teardown, that would update the internal flag serving the similar purpose. However, I'd rather prefer to have a generic function that can be used in the same fashion. Thoughts? Comment Actions The problem you are describing is called "layer violation". It was indeed one of the harder things to solve initially for VNET teardown but it is not impossible. The moment you stop thinking about a monolithic network stack but think of each part as a module you'll quickly find unloading a module (say a protocol such as TCP or IPv6) the protocol needs to care for itself and cleanup all its related things on its own. This is what then VNET shutdown is modeled after. The places where these protocol layers interact are tricky but nonetheless it can be done. I would really love to hear what other people think about this. We already do have protocol load/unload with the TCP CC alogrithms and various TCP stacks these days. There is in theory nothing which prevents us from making IPv4 and IPv6 loadable (other OSes have long done that). |