diff options
author | Luca Muscariello <lumuscar@cisco.com> | 2022-03-30 22:29:28 +0200 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2022-03-31 19:51:47 +0200 |
commit | c46e5df56b67bb8ea7a068d39324c640084ead2b (patch) | |
tree | eddeb17785938e09bc42eec98ee09b8a28846de6 /hicn-plugin/src/pcs.h | |
parent | 18fa668f25d3cc5463417ce7df6637e31578e898 (diff) |
feat: boostrap hicn 22.02
The current patch provides several new features, improvements,
bug fixes and also complete rewrite of entire components.
- lib
The hicn packet parser has been improved with a new packet
format fully based on UDP. The TCP header is still temporarily
supported but the UDP header will replace completely the new hicn
packet format. Improvements have been made to make sure every
packet parsing operation is made via this library. The current
new header can be used as header between the payload and the
UDP header or as trailer in the UDP surplus area to be tested
when UDP options will start to be used.
- hicn-light
The portable packet forwarder has been completely rewritten from
scratch with the twofold objective to improve performance and
code size but also to drop dependencies such as libparc which is
now removed by the current implementation.
- hicn control
the control library is the agent that is used to program the
packet forwarders via their binary API. This component has
benefited from significant improvements in terms of interaction
model which is now event driven and more robust to failures.
- VPP plugin has been updated to support VPP 22.02
- transport
Major improvement have been made to the RTC protocol, to the
support of IO modules and to the security sub system. Signed
manifests are the default data authenticity and integrity framework.
Confidentiality can be enabled by sharing the encryption key to the
prod/cons layer. The library has been tested with group key based
applications such as broadcast/multicast and real-time on-line
meetings with trusted server keys or MLS.
- testing
Unit testing has been introduced using GoogleTest. One third of
the code base is covered by unit testing with priority on
critical features. Functional testing has also been introduce
using Docker, linux bridging and Robot Framework to define
test with Less Code techniques to facilitate the extension
of the coverage.
Co-authored-by: Mauro Sardara <msardara@cisco.com>
Co-authored-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Angelo Mantellini <manangel@cisco.com>
Co-authored-by: Jacques Samain <jsamain@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Enrico Loparco <eloparco@cisco.com>
Co-authored-by: Giulio Grassi <gigrassi@cisco.com>
Change-Id: I75d0ef70f86d921e3ef503c99271216ff583c215
Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-plugin/src/pcs.h')
-rw-r--r-- | hicn-plugin/src/pcs.h | 64 |
1 files changed, 13 insertions, 51 deletions
diff --git a/hicn-plugin/src/pcs.h b/hicn-plugin/src/pcs.h index 083efa901..b98b72a53 100644 --- a/hicn-plugin/src/pcs.h +++ b/hicn-plugin/src/pcs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 Cisco and/or its affiliates. + * Copyright (c) 2021 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -91,7 +91,7 @@ typedef struct __attribute__ ((packed)) hicn_pit_entry_s } hicn_pit_entry_t; -#define HICN_CS_ENTRY_OPAQUE_SIZE HICN_HASH_NODE_APP_DATA_SIZE - 36 +#define HICN_CS_ENTRY_OPAQUE_SIZE HICN_HASH_NODE_APP_DATA_SIZE - 32 /* * CS entry, unioned with a PIT entry below @@ -105,17 +105,17 @@ typedef struct __attribute__ ((packed)) hicn_cs_entry_s /* 20B + 4B = 24B */ u32 cs_pkt_buf; - /* Ingress face */ - /* 24B + 4B = 28B */ - hicn_face_id_t cs_rxface; + // /* Ingress face */ + // /* 24B + 4B = 28B */ + // hicn_face_id_t cs_rxface; /* Linkage for LRU, in the form of hashtable node indexes */ - /* 28B + 8B = 36B */ + /* 24B + 8B = 32B */ u32 cs_lru_prev; u32 cs_lru_next; /* Reserved for implementing cache policy different than LRU */ - /* 36B + (64 - 36)B = 64B */ + /* 32B + (64 - 32)B = 64B */ u8 opaque[HICN_CS_ENTRY_OPAQUE_SIZE]; } __attribute__ ((packed)) hicn_cs_entry_t; @@ -167,8 +167,7 @@ always_inline void hicn_pit_to_cs (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_hash_entry_t *hash_entry, hicn_hash_node_t *node, const hicn_dpo_vft_t *dpo_vft, - dpo_id_t *hicn_dpo_id, - hicn_face_id_t inface_id, u8 is_appface); + dpo_id_t *hicn_dpo_id); always_inline void hicn_pcs_cs_update (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *old_entry, @@ -193,7 +192,7 @@ always_inline int hicn_pcs_cs_insert_update ( vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *entry, hicn_hash_node_t *node, hicn_hash_entry_t **hash_entry, u64 hashval, u32 *node_id, index_t *dpo_ctx_id, u8 *vft_id, u8 *is_cs, u8 *hash_entry_id, - u32 *bucket_id, u8 *bucket_is_overflow, hicn_face_id_t inface); + u32 *bucket_id, u8 *bucket_is_overflow); always_inline int hicn_pcs_pit_insert (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *entry, @@ -352,7 +351,6 @@ hicn_pcs_delete_internal (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entryp, else { pitcs->pcs_pit_dealloc++; - hicn_strategy_dpo_ctx_unlock (hicn_dpo_id); /* Flush faces */ hicn_faces_flush (&(pcs->u.pit.faces)); @@ -370,7 +368,7 @@ always_inline void hicn_pit_to_cs (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *pcs_entry, hicn_hash_entry_t *hash_entry, hicn_hash_node_t *node, const hicn_dpo_vft_t *dpo_vft, - dpo_id_t *hicn_dpo_id, hicn_face_id_t inface_id, u8 is_appface) + dpo_id_t *hicn_dpo_id) { /* @@ -378,7 +376,6 @@ hicn_pit_to_cs (vlib_main_t *vm, hicn_pit_cs_t *pitcs, * hash entry. */ pitcs->pcs_pit_count--; - hicn_strategy_dpo_ctx_unlock (hicn_dpo_id); /* Flush faces */ hicn_faces_flush (&(pcs_entry->u.pit.faces)); @@ -386,8 +383,6 @@ hicn_pit_to_cs (vlib_main_t *vm, hicn_pit_cs_t *pitcs, node->hn_flags |= HICN_HASH_NODE_CS_FLAGS; pcs_entry->shared.entry_flags |= HICN_PCS_ENTRY_CS_FLAG; - pcs_entry->u.cs.cs_rxface = inface_id; - /* Update the CS according to the policy */ hicn_cs_policy_t *policy_state; hicn_cs_policy_vft_t *policy_vft; @@ -432,40 +427,8 @@ hicn_pcs_cs_update (vlib_main_t *vm, hicn_pit_cs_t *pitcs, policy_state = &pitcs->policy_state; policy_vft = &pitcs->policy_vft; - if (entry->u.cs.cs_rxface != old_entry->u.cs.cs_rxface) - { - /* Dequeue content from the old queue */ - policy_vft->hicn_cs_dequeue (pitcs, node, old_entry, policy_state); - - old_entry->u.cs.cs_rxface = entry->u.cs.cs_rxface; - policy_state = &pitcs->policy_state; - policy_vft = &pitcs->policy_vft; - - policy_vft->hicn_cs_insert (pitcs, node, old_entry, policy_state); - - if (policy_state->count > policy_state->max) - { - hicn_hash_node_t *node; - hicn_pcs_entry_t *pcs_entry; - hicn_hash_entry_t *hash_entry; - policy_vft->hicn_cs_delete_get (pitcs, policy_state, &node, - &pcs_entry, &hash_entry); - - /* - * We don't have to decrease the lock (therefore we cannot - * use hicn_pcs_cs_delete function) - */ - policy_vft->hicn_cs_dequeue (pitcs, node, pcs_entry, policy_state); - - hicn_cs_delete_trimmed (pitcs, &pcs_entry, hash_entry, &node, vm); - - /* Update the global CS counter */ - pitcs->pcs_cs_count--; - } - } - else - /* Update the CS LRU, moving this item to the head */ - policy_vft->hicn_cs_update (pitcs, node, old_entry, policy_state); + /* Update the CS LRU, moving this item to the head */ + policy_vft->hicn_cs_update (pitcs, node, old_entry, policy_state); } always_inline void @@ -565,13 +528,12 @@ hicn_pcs_cs_insert_update (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_hash_entry_t **hash_entry, u64 hashval, u32 *node_id, index_t *dpo_ctx_id, u8 *vft_id, u8 *is_cs, u8 *hash_entry_id, u32 *bucket_id, - u8 *bucket_is_overflow, hicn_face_id_t inface) + u8 *bucket_is_overflow) { int ret; ASSERT (entry == hicn_hashtb_node_data (node)); - entry->u.cs.cs_rxface = inface; ret = hicn_pcs_cs_insert (vm, pitcs, entry, node, hash_entry, hashval, node_id, dpo_ctx_id, vft_id, is_cs, hash_entry_id, bucket_id, bucket_is_overflow); |