diff options
author | Klement Sekera <ksekera@cisco.com> | 2019-11-21 10:31:03 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-11-26 09:54:29 +0000 |
commit | 7dbf9a1a4fff5c3b20ad972289e49e3f88e82f2d (patch) | |
tree | fbe9a1362abd78baa612da2c7d8a055c6f60c12f /src/vnet/adj/rewrite.h | |
parent | 981a690b7d25c96ea56f95ece693377f95b93fc1 (diff) |
fib: reduce save_rewrite_length to u8
This is a preparation step for migrating NAT to use SVR (shallow virtual
reassembly) to conserve space in vnet_buffer. Since max rewrite length
is currently pre-data size (128), u8 is sufficient to hold that value.
Type: refactor
Change-Id: I5374bb396e178245b870cb0bbf1370d2a54230bc
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/adj/rewrite.h')
-rw-r--r-- | src/vnet/adj/rewrite.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/vnet/adj/rewrite.h b/src/vnet/adj/rewrite.h index 9b83b5ac0db..c2084ea0a4a 100644 --- a/src/vnet/adj/rewrite.h +++ b/src/vnet/adj/rewrite.h @@ -105,12 +105,14 @@ STATIC_ASSERT (sizeof (vnet_rewrite_header_t) <= 16, vnet_rewrite_declare(64 - 2*sizeof(int)) rw; } my_adjacency_t; */ -#define vnet_declare_rewrite(total_bytes) \ -struct { \ - vnet_rewrite_header_t rewrite_header; \ - \ - u8 rewrite_data[(total_bytes) - sizeof (vnet_rewrite_header_t)]; \ -} +#define VNET_DECLARE_REWRITE \ + struct \ + { \ + vnet_rewrite_header_t rewrite_header; \ + \ + u8 rewrite_data[(VNET_REWRITE_TOTAL_BYTES) - \ + sizeof (vnet_rewrite_header_t)]; \ + } always_inline void vnet_rewrite_clear_data_internal (vnet_rewrite_header_t * rw, int max_size) |