fib: use 32 bits per-source reference counter 94/24094/3
authorMiklos Tirpak <miklos.tirpak@gmail.com>
Fri, 20 Dec 2019 10:55:43 +0000 (11:55 +0100)
committerNeale Ranns <nranns@cisco.com>
Sun, 22 Dec 2019 22:56:22 +0000 (22:56 +0000)
The 16 bits reference counter limited the number of interfaces
per FIB table to 65K from a given source. Some use cases, for example
GTP-U tunnels require much more interfaces than that.
This change increases the size of the reference counter to 32 bits.

Type: fix

Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com>
Change-Id: I944a98513018840f904f2808c2a1e963b37886cc

src/vnet/fib/fib_table.c
src/vnet/fib/fib_table.h

index 6766028..ac0f2da 100644 (file)
@@ -1277,7 +1277,7 @@ fib_table_lock_inc (fib_table_t *fib_table,
 {
     vec_validate(fib_table->ft_locks, source);
 
-    ASSERT(fib_table->ft_locks[source] < (0xffff - 1));
+    ASSERT(fib_table->ft_total_locks < (0xffffffff - 1));
     fib_table->ft_locks[source]++;
     fib_table->ft_total_locks++;
 }
index a11f056..7f18188 100644 (file)
@@ -83,7 +83,7 @@ typedef struct fib_table_t_
     /**
      * per-source number of locks on the table
      */
-    u16 *ft_locks;
+    u32 *ft_locks;
     u32 ft_total_locks;
 
     /**