[dpdk-dev] [PATCH 4/6] examples/ntb: enable an example for ntb
xiaolong.ye at intel.com
Wed Jun 5 11:25:12 CEST 2019
On 06/05, Li, Xiaoyun wrote:
>> > I noticed that there are two allocations, one for pkts_recv and another for
>> > pkts_recv->buf_addr, How about we declare
>> > struct rte_rawdev_buf pkts_recv;
>> > and allocate memory for its buf_addr
>> > pkts_recv.buf_addr = malloc(size);
>> > then we call
>> > rte_rawdev_dequeue_buffers(dev_id, &pkts_recv, 1, (void *)size);
>> > After that, we just need to free once.
>> > free(pkts_recv.buf_addr);
>Double pointer does not represent 2D arrays. Please refer to
Yes, I agree, but I don't think it is the case here.
>It will cause segment fault in enqueue/dequeue.
Hmm, have you debug it? Which line caused the segfault?
You can refer to test_rawdev_enqdeq function in skeleton_rawdev_test.c, what it
does is similar to my suggestion, and you just need one alloc/free.
>I will free twice.
>> > >2.17.1
>> > >
More information about the dev