summaryrefslogtreecommitdiff
path: root/infra/src
diff options
context:
space:
mode:
Diffstat (limited to 'infra/src')
-rw-r--r--infra/src/ldbc.c31
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