diff options
| author | Lu Qiuwen <[email protected]> | 2021-11-16 23:41:52 +0300 |
|---|---|---|
| committer | Lu Qiuwen <[email protected]> | 2021-11-16 23:52:06 +0300 |
| commit | ad801d927c33328d242ed989ed5b813a8e319228 (patch) | |
| tree | 74f0380e35ef934f6145d591c169a2521f167b71 /infra/src | |
| parent | 6c0a8ae4c86f588522c476257c67f46a16bf28d2 (diff) | |
增加GTP-over-VXLAN封装报文的内层二元组、四元组解析功能。v4.4.11-2021117rel-4.4dev-4.4
Diffstat (limited to 'infra/src')
| -rw-r--r-- | infra/src/ldbc.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/infra/src/ldbc.c b/infra/src/ldbc.c index e5604b1..29d7b9e 100644 --- a/infra/src/ldbc.c +++ b/infra/src/ldbc.c @@ -558,23 +558,10 @@ static inline uint32_t hash_sym_rss(struct distributer * dist, const void * data switch (layer_type) { + /* RSS is not support TCP/UDP for the short length */ case LAYER_TYPE_TCP: - { - const struct rte_tcp_hdr * tcp_hdr = (const struct rte_tcp_hdr *)data; - s_data = (const char *)&tcp_hdr->src_port; - d_data = (const char *)&tcp_hdr->dst_port; - data_len = sizeof(uint16_t); - break; - } - case LAYER_TYPE_UDP: - { - const struct rte_udp_hdr * udp_hdr = (const struct rte_udp_hdr *)data; - s_data = (const char *)&udp_hdr->src_port; - d_data = (const char *)&udp_hdr->dst_port; - data_len = sizeof(uint16_t); - break; - } + return orin_hash; case LAYER_TYPE_IPV4: { @@ -604,6 +591,16 @@ static inline uint32_t hash_sym_rss(struct distributer * dist, const void * data return src_hash ^ dst_hash; } +uint32_t EXPORT_FOR_UNITTEST_hash_sym_crc(struct distributer * dist, const void * data, int layer_type, uint32_t orin_hash) +{ + return hash_sym_crc(dist, data, layer_type, orin_hash); +} + +uint32_t EXPORT_FOR_UNITTEST_hash_sym_rss(struct distributer * dist, const void * data, int layer_type, uint32_t orin_hash) +{ + return hash_sym_rss(dist, data, layer_type, orin_hash); +} + static inline uint32_t __distributer_inner_tuple2(struct distributer * dist_object, struct rte_mbuf * mbuf) { @@ -611,7 +608,7 @@ static inline uint32_t __distributer_inner_tuple2(struct distributer * dist_obje int inner_layer_type; struct pkt_parser pkt_parser; - pkt_parser_init(&pkt_parser, LAYER_TYPE_L3, 2); + pkt_parser_init(&pkt_parser, LAYER_TYPE_L3, 4); /* 根据硬件的解析能力,找到最外层的IP */ #if ENABLE_LDBC_BASED_NIC_PTYPE @@ -647,7 +644,7 @@ static inline uint32_t __distributer_inner_tuple4(struct distributer * dist_obje struct rte_mbuf * mbuf) { struct pkt_parser pkt_parser; - pkt_parser_init(&pkt_parser, LAYER_TYPE_L3 | LAYER_TYPE_L4, 4); + pkt_parser_init(&pkt_parser, LAYER_TYPE_L3 | LAYER_TYPE_L4, 8); /* 根据硬件的解析能力,找到最外层的IP */ #if ENABLE_LDBC_BASED_NIC_PTYPE |
