diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-06-28 14:58:55 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-08-08 09:15:22 -0400 | 
| commit | c87f5c23922a17738111fff767501717d7b1b933 (patch) | |
| tree | 646bbf8dbee3f8970892c8e509fd5099dee7d092 /zebra/zebra_mpls.h | |
| parent | e63831f1336beb25192e3a55143c46abe4a55210 (diff) | |
zebra: Notice when an interface is turned on w/ mpls and enable mpls subsystem
Currently when FRR starts up it queries the kernel to see if mpls is turned on.
If not FRR does not enable zebra's mpls subsection.  If at a later time mpls
is turned on, let's notice that an interface now is enabled for mpls( thus
implying that all the bits and bobs in the kernel are now setup properly ).
a) convert mpls_enabled to a bool
b) abstract a new function zebra_mpls_turned_on and call it
when FRR notices that an interface now has mpls enabled.
c) mpls_processq_init cannot fail, so actually notice that
and don't have special code to detect a failure.
New results:
sharpd@eva ~> vtysh -c "show zebra"
 OS                           Linux(5.10.0-12-amd64)
 ECMP Maximum                 128
 v4 Forwarding                On
 v6 Forwarding                On
 MPLS                         Off
 EVPN                         Off
 Kernel socket buffer size    90000000
 VRF                          l3mdev Available
 ASIC offload                 Unavailable
 RA                           Compiled in
 RFC 5549                     BGP is not using
 Kernel NHG                   Available
 v4 All LinkDown Routes       Off
 v4 Default LinkDown Routes   Off
 v6 All LinkDown Routes       Off
 v6 Default LinkDown Routes   Off
 v4 All MC Forwarding         On
 v4 Default MC Forwarding     Off
 v6 All MC Forwarding         On
 v6 Default MC Forwarding     Off
                            Route      Route      Neighbor   LSP        LSP
VRF                         Installs   Removals    Updates   Installs   Removals
default                           26          7          0          0          0
<turn on mpls_iptunnel and mpls_router modules in the kernel and then do this>:
sharpd@eva ~> sudo sysctl -w net.mpls.conf.enp39s0.input=1
[sudo] password for sharpd:
net.mpls.conf.enp39s0.input = 1
sharpd@eva ~> vtysh -c "show zebra"
 OS                           Linux(5.10.0-12-amd64)
 ECMP Maximum                 128
 v4 Forwarding                On
 v6 Forwarding                On
 MPLS                         On
 EVPN                         Off
 Kernel socket buffer size    90000000
 VRF                          l3mdev Available
 ASIC offload                 Unavailable
 RA                           Compiled in
 RFC 5549                     BGP is not using
 Kernel NHG                   Available
 v4 All LinkDown Routes       Off
 v4 Default LinkDown Routes   Off
 v6 All LinkDown Routes       Off
 v6 Default LinkDown Routes   Off
 v4 All MC Forwarding         On
 v4 Default MC Forwarding     Off
 v6 All MC Forwarding         On
 v6 Default MC Forwarding     Off
                            Route      Route      Neighbor   LSP        LSP
VRF                         Installs   Removals    Updates   Installs   Removals
default                           26          7          0          0          0
sharpd@eva ~>
I am doing this work because FRR keeps having operators not know about how
to properly use mpls.  Let's make FRR behave a bit better in this weird edge
case.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_mpls.h')
| -rw-r--r-- | zebra/zebra_mpls.h | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index a8c4e1a60c..a7a955a80b 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -395,6 +395,13 @@ void zebra_mpls_close_tables(struct zebra_vrf *zvrf);  void zebra_mpls_init_tables(struct zebra_vrf *zvrf);  /* + * If mpls is turned on *after* FRR is brought + * up let's actually notice this and turn on + * the relevant bits to make it work. + */ +void zebra_mpls_turned_on(void); + +/*   * Global MPLS initialization.   */  void zebra_mpls_init(void); @@ -569,7 +576,7 @@ static inline int mpls_should_lsps_be_processed(struct route_node *rn)  }  /* Global variables. */ -extern int mpls_enabled; +extern bool mpls_enabled;  extern bool mpls_pw_reach_strict; /* Strict pseudowire reachability checking */  #ifdef __cplusplus  | 
