aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/udp
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-01-19 17:28:57 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-01-19 17:35:54 +0100
commitc7f942175b8c25c77ddc21561b52e3e6b5620b80 (patch)
treed9cecc4574ae9ed2f4a9e041010c8794e6001363 /hicn-plugin/src/faces/udp
parentd13d37534d9449dd54277af664310d5f957dc44a (diff)
Improved performance on data-fwd node:
- Removed full pit entry initialization in favor of a lighter initialization on few fields - Squeezed pit entry size in order to store only the number of incomplete faces (as set in HICN_PARAM_PIT_ENTRY_PHOPS_MAX). The bitmap size is now determined by HICN_PARAM_FACES_MAX and optimized to do a fast lookup Replaced the field is_appface with the field flags in the hicn_buffer_t: - is_appface is now a flag with value 0x01 (HICN_BUFFER_FLAGS_FACE_IS_APP) - Added flag HICN_BUFFER_FLAGS_PKT_LESS_TWO_CL (0x02) to handle the copy of pkt with length < than 2*CACHE_LINES (in this case cloning is prevented by the cloning function in vpp). Such flag is initialized by the incoming face of the pkt. Change-Id: Ia956fd5719a28ee29f7fa2fd23d283964743efd8 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/faces/udp')
-rwxr-xr-xhicn-plugin/src/faces/udp/dpo_udp.c8
-rwxr-xr-xhicn-plugin/src/faces/udp/dpo_udp.h30
-rwxr-xr-xhicn-plugin/src/faces/udp/face_udp_node.c6
-rwxr-xr-xhicn-plugin/src/faces/udp/iface_udp_node.c6
4 files changed, 25 insertions, 25 deletions
diff --git a/hicn-plugin/src/faces/udp/dpo_udp.c b/hicn-plugin/src/faces/udp/dpo_udp.c
index e58fc9788..eadcb6abd 100755
--- a/hicn-plugin/src/faces/udp/dpo_udp.c
+++ b/hicn-plugin/src/faces/udp/dpo_udp.c
@@ -79,14 +79,14 @@ hicn_dpo_udp4_create (dpo_id_t * dpo,
u16 net_dst_port = clib_host_to_net_u16 (dst_port);
hicn_face_t *face = hicn_face_udp4_get (src_ip, dst_ip, src_port, dst_port);
- u8 is_appface;
+ u8 hicnb_flags;
/* ip_csum_t sum0; */
if (face != NULL)
return HICN_ERROR_FACE_ALREADY_CREATED;
hicn_dpo_udp4_add_and_lock (dpo, src_ip, dst_ip, net_src_port, net_dst_port,
- node_index, &is_appface);
+ node_index, &hicnb_flags);
face = hicn_dpoi_get_from_idx (dpo->dpoi_index);
@@ -118,13 +118,13 @@ hicn_dpo_udp6_create (dpo_id_t * dpo,
u16 net_dst_port = clib_host_to_net_u16 (dst_port);
hicn_face_t *face =
hicn_face_udp6_get (src_ip, dst_ip, net_src_port, net_dst_port);
- u8 is_appface;
+ u8 hicnb_flags;
if (face != NULL)
return HICN_ERROR_FACE_ALREADY_CREATED;
hicn_dpo_udp6_add_and_lock (dpo, src_ip, dst_ip, net_src_port, net_dst_port,
- node_index, &is_appface);
+ node_index, &hicnb_flags);
face = hicn_dpoi_get_from_idx (dpo->dpoi_index);
diff --git a/hicn-plugin/src/faces/udp/dpo_udp.h b/hicn-plugin/src/faces/udp/dpo_udp.h
index fdde4192b..33e4b5d46 100755
--- a/hicn-plugin/src/faces/udp/dpo_udp.h
+++ b/hicn-plugin/src/faces/udp/dpo_udp.h
@@ -64,8 +64,8 @@ hicn_dpo_udp4_create (dpo_id_t * dpo,
* @param remote_addr: Remote address of the UDP tunnel
* @param local_port: Local port of the UDP tunnel
* @param remote_port: Remote port of the UDP tunnel
- * @param is_appface: Boolean that indicates whether the face is an application
- * face or not. (Currently only IP faces can be appface)
+ * @param hicnb_flags: Flags that indicate whether the face is an application
+ * face or not in the hicn_buffer. (Currently only IP faces can be appface)
*
* @result HICN_ERROR_FACE_NOT_FOUND if the face does not exist, otherwise HICN_ERROR_NONE.
*/
@@ -73,7 +73,7 @@ always_inline int
hicn_dpo_udp4_lock (dpo_id_t * dpo,
const ip4_address_t * local_addr,
const ip4_address_t * remote_addr,
- u16 local_port, u16 remote_port, u8 * is_appface)
+ u16 local_port, u16 remote_port, u8 * hicnb_flags)
{
hicn_face_t *face =
hicn_face_udp4_get (local_addr, remote_addr, local_port, remote_port);
@@ -86,7 +86,7 @@ hicn_dpo_udp4_lock (dpo_id_t * dpo,
dpo->dpoi_next_node = ~0;
dpo_lock (dpo);
- *is_appface = 0;
+ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
return HICN_ERROR_NONE;
}
@@ -101,7 +101,7 @@ hicn_dpo_udp4_lock (dpo_id_t * dpo,
* @param remote_addr: Remote address of the UDP tunnel
* @param local_port: Local port of the UDP tunnel
* @param remote_port: Remote port of the UDP tunnel
- * @param is_appface: Boolean that indicates whether the face is an application
+ * @param hicnb_flags: Flags that indicate whether the face is an application
* face or not. (Currently only IP faces can be appface)
* @param node_index: vlib edge index to use in the packet processing
*/
@@ -110,7 +110,7 @@ hicn_dpo_udp4_add_and_lock (dpo_id_t * dpo,
const ip4_address_t * local_addr,
const ip4_address_t * remote_addr,
u16 local_port, u16 remote_port,
- u32 node_index, u8 * is_appface)
+ u32 node_index, u8 * hicnb_flags)
{
hicn_face_t *face =
hicn_face_udp4_get (local_addr, remote_addr, local_port, remote_port);
@@ -145,7 +145,7 @@ hicn_dpo_udp4_add_and_lock (dpo_id_t * dpo,
mhash_set_mem (&hicn_face_udp_hashtb, &key, (uword *) & dpoi_index, 0);
face = face;
- *is_appface = 0;
+ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
dpo_set (dpo, hicn_face_udp_type, DPO_PROTO_IP4, dpoi_index);
dpo->dpoi_next_node = node_index;
dpo_lock (dpo);
@@ -153,7 +153,7 @@ hicn_dpo_udp4_add_and_lock (dpo_id_t * dpo,
return;
}
- *is_appface = 0;
+ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
hicn_face_id_t dpoi_index = hicn_dpoi_get_index (face);
dpo_set (dpo, hicn_face_udp_type, DPO_PROTO_IP4, dpoi_index);
@@ -196,7 +196,7 @@ hicn_dpo_udp6_create (dpo_id_t * dpo,
* @param remote_addr: Remote address of the UDP tunnel
* @param local_port: Local port of the UDP tunnel
* @param remote_port: Remote port of the UDP tunnel
- * @param is_appface: Boolean that indicates whether the face is an application
+ * @param hicnb_flags: Flags that indicate whether the face is an application
* face or not. (Currently only IP faces can be appface)
*
* @result HICN_ERROR_FACE_NOT_FOUND if the face does not exist, otherwise HICN_ERROR_NONE.
@@ -205,7 +205,7 @@ always_inline int
hicn_dpo_udp6_lock (dpo_id_t * dpo,
const ip6_address_t * local_addr,
const ip6_address_t * remote_addr,
- u16 local_port, u16 remote_port, u8 * is_appface)
+ u16 local_port, u16 remote_port, u8 * hicnb_flags)
{
hicn_face_t *face =
hicn_face_udp6_get (local_addr, remote_addr, local_port, remote_port);
@@ -218,7 +218,7 @@ hicn_dpo_udp6_lock (dpo_id_t * dpo,
dpo_set (dpo, hicn_face_udp_type, DPO_PROTO_IP4, dpoi_index);
dpo->dpoi_next_node = ~0;
dpo_lock (dpo);
- *is_appface = 0;
+ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
return HICN_ERROR_NONE;
}
@@ -233,7 +233,7 @@ hicn_dpo_udp6_lock (dpo_id_t * dpo,
* @param remote_addr: Remote address of the UDP tunnel
* @param local_port: Local port of the UDP tunnel
* @param remote_port: Remote port of the UDP tunnel
- * @param is_appface: Boolean that indicates whether the face is an application
+ * @param hicnb_flags: Flags that indicate whether the face is an application
* face or not. (Currently only IP faces can be appface)
* @param node_index: vlib edge index to use in the packet processing
*/
@@ -242,7 +242,7 @@ hicn_dpo_udp6_add_and_lock (dpo_id_t * dpo,
const ip6_address_t * local_addr,
const ip6_address_t * remote_addr,
u16 local_port, u16 remote_port,
- u32 node_index, u8 * is_appface)
+ u32 node_index, u8 * hicnb_flags)
{
hicn_face_t *face =
hicn_face_udp6_get (local_addr, remote_addr, local_port, remote_port);
@@ -276,7 +276,7 @@ hicn_dpo_udp6_add_and_lock (dpo_id_t * dpo,
mhash_set_mem (&hicn_face_udp_hashtb, &key, (uword *) & dpoi_index, 0);
- *is_appface = 0;
+ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
dpo_set (dpo, hicn_face_udp_type, DPO_PROTO_IP6, dpoi_index);
dpo->dpoi_next_node = node_index;
dpo_lock (dpo);
@@ -284,7 +284,7 @@ hicn_dpo_udp6_add_and_lock (dpo_id_t * dpo,
return;
}
- *is_appface = 0;
+ *hicnb_flags = HICN_BUFFER_FLAGS_DEFAULT;
hicn_face_id_t dpoi_index = hicn_dpoi_get_index (face);
dpo_set (dpo, hicn_face_udp_type, DPO_PROTO_IP6, dpoi_index);
diff --git a/hicn-plugin/src/faces/udp/face_udp_node.c b/hicn-plugin/src/faces/udp/face_udp_node.c
index 74d0b1864..ac7a63731 100755
--- a/hicn-plugin/src/faces/udp/face_udp_node.c
+++ b/hicn-plugin/src/faces/udp/face_udp_node.c
@@ -139,7 +139,7 @@ typedef enum
&(ip_hdr->src_address), \
(udp_hdr->dst_port), \
(udp_hdr->src_port), \
- &hicnb0->is_appface); \
+ &hicnb0->flags); \
\
if ( PREDICT_FALSE(ret != HICN_ERROR_NONE) ) \
{ \
@@ -233,7 +233,7 @@ typedef enum
&(ip_hdr0->src_address), \
(udp_hdr0->dst_port), \
(udp_hdr0->src_port), \
- &hicnb0->is_appface); \
+ &hicnb0->flags); \
\
ret1 = HICN_DPO_UDP_LOCK_IP##ipv \
(&(hicnb1->face_dpo_id), \
@@ -241,7 +241,7 @@ typedef enum
&(ip_hdr1->src_address), \
(udp_hdr1->dst_port), \
(udp_hdr1->src_port), \
- &hicnb1->is_appface); \
+ &hicnb1->flags); \
\
if ( PREDICT_FALSE(ret0 != HICN_ERROR_NONE) ) \
{ \
diff --git a/hicn-plugin/src/faces/udp/iface_udp_node.c b/hicn-plugin/src/faces/udp/iface_udp_node.c
index ddea31b4c..1f6dbd4ab 100755
--- a/hicn-plugin/src/faces/udp/iface_udp_node.c
+++ b/hicn-plugin/src/faces/udp/iface_udp_node.c
@@ -183,7 +183,7 @@ typedef enum
udp_hdr->src_port, \
GET_FACE_UDP##ipv \
(), \
- &hicnb0->is_appface); \
+ &hicnb0->flags); \
\
vlib_buffer_advance(b0, sizeof(IP_HEADER_##ipv) + \
sizeof(udp_header_t)); \
@@ -270,7 +270,7 @@ typedef enum
udp_hdr0->src_port, \
GET_FACE_UDP##ipv \
(), \
- &hicnb0->is_appface); \
+ &hicnb0->flags); \
\
\
HICN_IFACE_UDP_ADD_LOCK_IP##ipv \
@@ -281,7 +281,7 @@ typedef enum
udp_hdr1->src_port, \
GET_FACE_UDP##ipv \
(), \
- &hicnb1->is_appface); \
+ &hicnb1->flags); \
\
vlib_buffer_advance(b0, sizeof(IP_HEADER_##ipv) + \
sizeof(udp_header_t)); \