|
2 | 2 | // Copyright Open Network Fabric Authors |
3 | 3 |
|
4 | 4 | //! Module that implements Display for routing objects |
5 | | -
|
| 5 | +//! |
| 6 | +//! Note: most of the objects for which Display is implemented here belong to |
| 7 | +//! the routing database which is fully and only owned by the routing thread. |
| 8 | +//! This includes the Fib contents since fibs belong to vrfs. |
| 9 | +//! So: |
| 10 | +/// - it is Okay to call any of this from the routing thread (cli) |
| 11 | +/// - other threads may not be able to call Display's for routing objects. |
| 12 | +/// - Display for Fib objects visible from dataplane workers can be safely called. |
| 13 | +/// - Cli thread does not need a read handle cache to inspect Fib contents |
| 14 | +/// - Still, FIXME(fredi): make that distinction clearer |
6 | 15 | use crate::atable::adjacency::{Adjacency, AdjacencyTable}; |
7 | 16 | use crate::cpi::{CpiStats, CpiStatus, StatsRow}; |
8 | 17 | use crate::fib::fibgroupstore::FibRoute; |
9 | 18 | use crate::fib::fibobjects::{EgressObject, FibEntry, FibGroup, PktInstruction}; |
10 | | -use crate::fib::fibtable::FibTable; |
11 | 19 | use crate::fib::fibtype::{Fib, FibKey}; |
12 | 20 | use crate::frr::frrmi::{FrrAppliedConfig, Frrmi, FrrmiStats}; |
13 | 21 |
|
@@ -723,22 +731,6 @@ impl Display for Fib { |
723 | 731 | Ok(()) |
724 | 732 | } |
725 | 733 | } |
726 | | -impl Display for FibTable { |
727 | | - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { |
728 | | - Heading(format!( |
729 | | - " Fib Table ({} fibs, version: {})", |
730 | | - self.len(), |
731 | | - self.version() |
732 | | - )) |
733 | | - .fmt(f)?; |
734 | | - for fibr in self.values().map(|f| f.handle()) { |
735 | | - if let Some(fib) = fibr.enter() { |
736 | | - write!(f, "{}", *fib)?; |
737 | | - } |
738 | | - } |
739 | | - Ok(()) |
740 | | - } |
741 | | -} |
742 | 734 |
|
743 | 735 | pub struct FibViewV4<'a, F> |
744 | 736 | where |
|
0 commit comments