git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
raw/cnxk_bphy: add baseband PHY skeleton driver
[dpdk.git]
/
examples
/
ipsec-secgw
/
sad.h
diff --git
a/examples/ipsec-secgw/sad.h
b/examples/ipsec-secgw/sad.h
index
55712ba
..
3224b62
100644
(file)
--- a/
examples/ipsec-secgw/sad.h
+++ b/
examples/ipsec-secgw/sad.h
@@
-18,11
+18,6
@@
struct ipsec_sad_cache {
RTE_DECLARE_PER_LCORE(struct ipsec_sad_cache, sad_cache);
RTE_DECLARE_PER_LCORE(struct ipsec_sad_cache, sad_cache);
-struct ipsec_sad {
- struct rte_ipsec_sad *sad_v4;
- struct rte_ipsec_sad *sad_v6;
-};
-
int ipsec_sad_create(const char *name, struct ipsec_sad *sad,
int socket_id, struct ipsec_sa_cnt *sa_cnt);
int ipsec_sad_create(const char *name, struct ipsec_sad *sad,
int socket_id, struct ipsec_sa_cnt *sa_cnt);
@@
-82,6
+77,7
@@
sad_lookup(struct ipsec_sad *sad, struct rte_mbuf *pkts[],
uint32_t spi, cache_idx;
struct ipsec_sad_cache *cache;
struct ipsec_sa *cached_sa;
uint32_t spi, cache_idx;
struct ipsec_sad_cache *cache;
struct ipsec_sa *cached_sa;
+ uint16_t udp_hdr_len = 0;
int is_ipv4;
cache = &RTE_PER_LCORE(sad_cache);
int is_ipv4;
cache = &RTE_PER_LCORE(sad_cache);
@@
-90,8
+86,12
@@
sad_lookup(struct ipsec_sad *sad, struct rte_mbuf *pkts[],
for (i = 0; i < nb_pkts; i++) {
ipv4 = rte_pktmbuf_mtod(pkts[i], struct rte_ipv4_hdr *);
ipv6 = rte_pktmbuf_mtod(pkts[i], struct rte_ipv6_hdr *);
for (i = 0; i < nb_pkts; i++) {
ipv4 = rte_pktmbuf_mtod(pkts[i], struct rte_ipv4_hdr *);
ipv6 = rte_pktmbuf_mtod(pkts[i], struct rte_ipv6_hdr *);
+ if ((pkts[i]->packet_type &
+ (RTE_PTYPE_TUNNEL_MASK | RTE_PTYPE_L4_MASK)) ==
+ MBUF_PTYPE_TUNNEL_ESP_IN_UDP)
+ udp_hdr_len = sizeof(struct rte_udp_hdr);
esp = rte_pktmbuf_mtod_offset(pkts[i], struct rte_esp_hdr *,
esp = rte_pktmbuf_mtod_offset(pkts[i], struct rte_esp_hdr *,
- pkts[i]->l3_len);
+ pkts[i]->l3_len
+ udp_hdr_len
);
is_ipv4 = pkts[i]->packet_type & RTE_PTYPE_L3_IPV4;
spi = rte_be_to_cpu_32(esp->spi);
is_ipv4 = pkts[i]->packet_type & RTE_PTYPE_L3_IPV4;
spi = rte_be_to_cpu_32(esp->spi);