diff options
| author | songyanchao <[email protected]> | 2022-08-17 07:09:08 +0000 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2022-08-17 07:09:08 +0000 |
| commit | aed4a0c0d527d7469bcc375d9f1d78ccb3c669b6 (patch) | |
| tree | a6674c2ff00cad924f93d25e9797c1597d61cf72 /tools | |
| parent | 784f1cb6d772751eb8d19be694ab8623e65f2190 (diff) | |
🐞 fix(TSG-11753): 修复“mrpdump工具在DPDK版本为21.11的OS上无法捕包”问题
修复“mrpdump工具在DPDK版本为21.11的OS上无法捕包”问题
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/tcpdump/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tools/tcpdump/pdump.c | 16 |
2 files changed, 14 insertions, 3 deletions
diff --git a/tools/tcpdump/CMakeLists.txt b/tools/tcpdump/CMakeLists.txt index 728b314..6dce3cb 100644 --- a/tools/tcpdump/CMakeLists.txt +++ b/tools/tcpdump/CMakeLists.txt @@ -4,6 +4,7 @@ find_package(PCAP REQUIRED) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_SOURCE_DIR}/include/extern) include_directories(${CMAKE_SOURCE_DIR}/include/internal) +include_directories(${CMAKE_SOURCE_DIR}/service/include) include_directories(${DPDK_INCLUDE_DIR}) add_executable(mrrxdump tcpdump.c) diff --git a/tools/tcpdump/pdump.c b/tools/tcpdump/pdump.c index f3f59e3..308f601 100644 --- a/tools/tcpdump/pdump.c +++ b/tools/tcpdump/pdump.c @@ -56,6 +56,7 @@ #include <rte_pdump.h> #include <pcap/pcap.h> #include <pcap/bpf.h> +#include <sc_common.h> #define CMD_LINE_OPT_PDUMP "pdump" #define PDUMP_PORT_ARG "port" @@ -88,7 +89,7 @@ #define MBUF_POOL_CACHE_SIZE 250 #define TX_DESC_PER_QUEUE 512 #define RX_DESC_PER_QUEUE 128 -#define MBUFS_PER_POOL 65535 +#define MBUFS_PER_POOL MR_PDUMP_MBUFS_PER_POOL #define MAX_LONG_OPT_SZ 64 #define RING_SIZE 16384 #define SIZE 256 @@ -394,7 +395,9 @@ parse_pdump(const char *optarg) &parse_uint_value, &v); if (ret < 0) goto free_kvlist; - pt->mbuf_data_size = (uint16_t)v.val; + //pt->mbuf_data_size = (uint16_t)v.val; + /* Current Only Support Specify 'RTE_MBUF_DEFAULT_BUF_SIZE'*/ + pt->mbuf_data_size = RTE_MBUF_DEFAULT_BUF_SIZE; } else pt->mbuf_data_size = RTE_MBUF_DEFAULT_BUF_SIZE; @@ -409,12 +412,19 @@ parse_pdump(const char *optarg) &parse_uint_value, &v); if (ret < 0) goto free_kvlist; - pt->total_num_mbufs = (uint16_t)v.val; + //pt->total_num_mbufs = (uint16_t)v.val; + /* Current Only Support Specify 'MBUFS_PER_POOL'*/ + pt->total_num_mbufs = MBUFS_PER_POOL; } else pt->total_num_mbufs = MBUFS_PER_POOL; num_tuples++; + if (num_tuples > MR_PDUMP_MEMPOOL_NUM) + { + printf("Current Only Support Max Dev Num Is:%u\n", MR_PDUMP_MEMPOOL_NUM); + ret = RT_ERR; + } free_kvlist: rte_kvargs_free(kvlist); |
