diff options
| author | songyanchao <[email protected]> | 2023-09-06 03:20:33 +0000 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2023-09-06 03:20:33 +0000 |
| commit | dcb971312ba13365a6ea5e75ffd7dcd4233e692d (patch) | |
| tree | 5444b0e4c182514ae2d950be63e3f9ac552cb3d6 | |
| parent | 26036462f311b36343cb61732606b1930822713a (diff) | |
🎈 perf(TSG-16785): mrpdump 修改 snaplen 数据类型v4.6.51-20230906
mrpdump 修改 snaplen 数据类型
| -rw-r--r-- | service/include/sc_pdump.h | 2 | ||||
| -rw-r--r-- | tools/tcpdump/pdump.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/service/include/sc_pdump.h b/service/include/sc_pdump.h index 24be4ff..4c3d826 100644 --- a/service/include/sc_pdump.h +++ b/service/include/sc_pdump.h @@ -55,7 +55,7 @@ struct mr_pdump_request uint32_t total_num_mbufs; uint32_t flags; uint32_t ring_size; - uint64_t snaplen; + uint32_t snaplen; char dev_symbol[MR_SYMBOL_MAX]; char * dumpfile_path; struct rte_bpf_prm * prm; diff --git a/tools/tcpdump/pdump.c b/tools/tcpdump/pdump.c index 3c6065c..6ddda6c 100644 --- a/tools/tcpdump/pdump.c +++ b/tools/tcpdump/pdump.c @@ -191,7 +191,7 @@ static unsigned long long dumpfile_count = 0; static struct bpf_program bpf_prog; static char str_bpf_expr[4096] = {}; static bool is_str_bpf_expr_set = false; -static uint64_t snaplen = UINT32_MAX; +static uint32_t snaplen = UINT32_MAX; static struct rte_bpf_prm * prm = NULL; uint16_t interface_index = 0; @@ -218,7 +218,7 @@ static void pdump_usage(const char * prgname) "[--bpf-rule=<bpf-rule>]" "default:<None>\n" "[--snapshot-length=]" - "default:<262144 bytes>\n", + "default:<UINT32_MAX>\n", prgname); } @@ -468,7 +468,7 @@ static int launch_args_parse(int argc, char ** argv, char * prgname) if (!strncmp(long_option[option_index].name, CMD_LINE_OPT_SNAPSHOT_LENGTH, sizeof(CMD_LINE_OPT_SNAPSHOT_LENGTH))) { - sscanf(optarg, "%" SCNu64, &snaplen); + sscanf(optarg, "%" SCNu32, &snaplen); } break; |
