|
|
@@ -289,7 +289,7 @@ static __always_inline struct map_bucket *get_map_bucket(void *headers_ptr_ptr)
|
|
|
}
|
|
|
__builtin_memset(map_value, 0, sizeof(struct map_bucket));
|
|
|
|
|
|
- for (u32 j = 0; j < 20; j++) {
|
|
|
+ for (u32 j = 0; j < 8; j++) {
|
|
|
if (j >= bucket_count) {
|
|
|
break;
|
|
|
}
|
|
|
@@ -307,7 +307,6 @@ static __always_inline char *get_header_val(struct map_bucket *map_value,u32 off
|
|
|
if (map_value->tophash[i] != 0 && map_value->keys[i].len == CW_HEADER_KEY_LENGTH) {
|
|
|
char current_header_key[CW_HEADER_KEY_LENGTH];
|
|
|
bpf_probe_read(current_header_key, sizeof(current_header_key), map_value->keys[i].str);
|
|
|
- cw_bpf_debug("get_header_val str is %s",current_header_key);
|
|
|
if ((current_header_key[0] == CW_HEADER_KEY_VAL[0]
|
|
|
|| current_header_key[0] == CW_HEADER_KEY_UFIRST_VAL[0])
|
|
|
&& current_header_key[1] == CW_HEADER_KEY_UFIRST_VAL[1]
|
|
|
@@ -332,15 +331,15 @@ static __always_inline char *get_header_val(struct map_bucket *map_value,u32 off
|
|
|
|
|
|
// 分段获取 header_val
|
|
|
static __always_inline char *get_header_val_off(struct map_bucket *map_value) {
|
|
|
- char *val = get_header_val(map_value, 0, 5);
|
|
|
+ char *val = get_header_val(map_value, 0, 2);
|
|
|
if (val == NULL) {
|
|
|
- val = get_header_val(map_value, 5, 10);
|
|
|
+ val = get_header_val(map_value, 2, 4);
|
|
|
}
|
|
|
if (val == NULL) {
|
|
|
- val = get_header_val(map_value, 10, 15);
|
|
|
+ val = get_header_val(map_value, 4, 6);
|
|
|
}
|
|
|
if (val == NULL) {
|
|
|
- val = get_header_val(map_value, 15, 20);
|
|
|
+ val = get_header_val(map_value, 6, 8);
|
|
|
}
|
|
|
return val;
|
|
|
}
|