如何解决DPDK20.8分段错误:在执行rte_ip_frag_table_create进行IP重组时
我是DPDK的新手,正在用c ++语言编写代码,目前正在IP上重组以下数据包,这是我的示例代码,这给了我rte_ip_frag_table_create的分段错误,我无法调试问题。如果有人能向我解释我哪里出了问题以及如何以正确的方式做事,我将不胜感激。目前,我觉得很困难。预先感谢。
AnonHugePages:407552 kB
ShmemHugePages:0 kB
HugePages_Total:10
HugePages_Free:10
HugePages_Rsvd:0
HugePages_Surp:0
大页面大小:1048576 kB
Hugetlb:10485760 kB
#define BUFFER_RING_SIZE 65536
#define BUFFER_LENGTH 1500
#define POOL_SIZE 8192
#define POOL_CACHE_SIZE 256
#define DEF_FLOW_NUM 0x1000
#define DEF_FLOW_TTL MS_PER_S
#define IP_FRAG_TBL_BUCKET_ENTRIES 4
static uint32_t max_flow_num = DEF_FLOW_NUM;
static uint32_t max_flow_ttl = DEF_FLOW_TTL;
#define RTE_LOGTYPE_IP_RSMBL RTE_LOGTYPE_USER1
struct lcore_queue_conf {
struct rte_ip_frag_tbl *frag_tbl;
struct rte_ip_frag_death_row death_row;
} __rte_cache_aligned;
static inline int setup_queue_tbl(struct lcore_queue_conf *qconf)
{
uint64_t frag_cycles = (rte_get_tsc_hz() + MS_PER_S - 1) / MS_PER_S * max_flow_ttl;
qconf->frag_tbl = rte_ip_frag_table_create(max_flow_num,IP_FRAG_TBL_BUCKET_ENTRIES,max_flow_num,frag_cycles,rte_socket_id());
if((qconf->frag_tbl) == NULL){
RTE_LOG(ERR,IP_RSMBL,"Table Failed.");
return -1;
}
return 0;
}
static int
lcore_main()
{
struct lcore_queue_conf *qconf;
if(setup_queue_tbl(qconf) != 0)
rte_exit(EXIT_FAILURE,"%s\n",rte_strerror(rte_errno));
.
.
.
.
}
int main(int argc,char *argv[])
{
struct rte_mempool *mbuf_pool;
struct rte_ring *ring;
uint16_t portcheck;
/* catch ctrl-c so we can print on exit */
signal(SIGINT,int_handler);
/* EAL setup */
ret=rte_eal_init(argc,argv);
cout << "=====================================================" << endl;
if(ret < 0)
cout << EAL initialising failed." << strerror(-ret) << endl;
else
cout << EAL initialisation success." << endl;
/* Mempool creation */
mbuf_pool=rte_pktmbuf_pool_create("BUFFER",POOL_SIZE,POOL_CACHE_SIZE,RTE_MBUF_DEFAULT_BUF_SIZE,rte_socket_id());
if(mbuf_pool== NULL)
rte_exit(EXIT_FAILURE,rte_strerror(rte_errno));
.
.
.
.
/* Master core call */
lcore_main();
return 0;
}
EAL: Detected 12 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Invalid NUMA socket,default to 0
EAL: Invalid NUMA socket,default to 0
EAL: using IOMMU type 1 (Type 1)
EAL: Probe PCI driver: net_ixgbe (8086:15d1) device: 0000:01:00.0 (socket 0)
EAL: Invalid NUMA socket,default to 0
EAL: No legacy callbacks,legacy socket not created
=====================================================
EAL initialisation success.
PORT 0: Ethernet configuration success.
TX queue configuration success.
RX queue configuration success.
PORT 0: NIC started successfully.
PORT 0: Enabled promiscuous mode.
MAC Addr b4:96:91:3f:21:b6
=====================================================
USER1: rte_ip_frag_table_create: allocated of 6291584 bytes at socket 0
Segmentation fault
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。