Hi William, You do not need to copy the packets out of memif. Once you finish processing all these packets, call memif_refill_queue() function to free these buffers. Let's say if you receive 32 packets in memif_rx_burst function, after processing, call memif_refill_queue with count=32 to free.
Best Regards, Chengqiang Yao -----Original Message----- From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of William Tu Sent: 2019年8月15日 2:07 To: vpp-dev@lists.fd.io Subject: [vpp-dev] Question about libmemif API Hi, I'm working on using libmemif in OVS. https://patchwork.ozlabs.org/patch/1140858/ While using the API, one question I have is, when I call err = memif_rx_burst(dev->handle, qid, dev->rx_bufs, NETDEV_MAX_BURST, &recv); There are 'recv' number of packets are at dev->rx_bufs, do I have to copy the packet buffer immediately to my master side? For example, I received 32 packets from memif_rx_burst, and I might process these packets in different order. Once done, is there an API to free each specific packet buffer back to memif buffer pool? Now the memif_refill_queue() can only specify number of buffers to refill, not which buffer. Thanks William
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#13743): https://lists.fd.io/g/vpp-dev/message/13743 Mute This Topic: https://lists.fd.io/mt/32866729/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-