summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_psh_cksum.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-11-08 11:18:30 +0000
committerFlorin Coras <florin.coras@gmail.com>2021-11-10 23:22:58 +0000
commitaa63bc6cf4b9031c3fc6ae22aecd846cc712bc52 (patch)
treec007868ca129f5594ac9c5aa460edea4aa63951e /src/vnet/ip/ip_psh_cksum.h
parent29355644c5eca85b83b183ff887633dbcf86cf35 (diff)
vppinfra: new vectorized ip checksum functions incl. csum_and_copy
Type: improvement Change-Id: Id5810b7f4a6d6e4ce16b73c235b50db5d475ebf7 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_psh_cksum.h')
-rw-r--r--src/vnet/ip/ip_psh_cksum.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/ip/ip_psh_cksum.h b/src/vnet/ip/ip_psh_cksum.h
index eaac401f223..8723749865f 100644
--- a/src/vnet/ip/ip_psh_cksum.h
+++ b/src/vnet/ip/ip_psh_cksum.h
@@ -7,6 +7,7 @@
#define included_ip_psh_cksum_h
#include <vnet/ip/ip.h>
+#include <vppinfra/vector/ip_csum.h>
typedef struct _ip4_psh
{
@@ -37,7 +38,8 @@ ip4_pseudo_header_cksum (ip4_header_t *ip4)
psh.proto = ip4->protocol;
psh.l4len = clib_host_to_net_u16 (clib_net_to_host_u16 (ip4->length) -
sizeof (ip4_header_t));
- return ~clib_net_to_host_u16 (ip_csum (&psh, sizeof (ip4_psh_t)));
+ return ~clib_net_to_host_u16 (
+ clib_ip_csum ((u8 *) &psh, sizeof (ip4_psh_t)));
}
static_always_inline u16
@@ -48,7 +50,8 @@ ip6_pseudo_header_cksum (ip6_header_t *ip6)
psh.dst = ip6->dst_address;
psh.l4len = ip6->payload_length;
psh.proto = clib_host_to_net_u32 ((u32) ip6->protocol);
- return ~clib_net_to_host_u16 (ip_csum (&psh, sizeof (ip6_psh_t)));
+ return ~clib_net_to_host_u16 (
+ clib_ip_csum ((u8 *) &psh, sizeof (ip6_psh_t)));
}
#endif /* included_ip_psh_cksum_h */