Sach
Sach

Reputation: 85

DPDK - packet modification

I have been trying to receive packets from rx queues, modify them and send them to tx queues. Currently I am stuck at packets modification.

My observations and questions:

1)

I have found there are functions manipulating mbufs, which contains pkt data:

add data:

rte_pktmbuf_append 
rte_pktmbuf_prepend

remove data:

rte_pktmbuf_adj
rte_pktmbuf_trim 

Can these function be used to modify packet data, meaning change size?

2)

Will be the size of packet data automatically updated?

Thank you very much

Upvotes: 3

Views: 956

Answers (2)

Fahad Naeem
Fahad Naeem

Reputation: 535

Yes, you can modify data in packet by using these functions. It also modifies packet size to be sent out of the NIC.

Upvotes: 1

Sach
Sach

Reputation: 85

I have examined by trial that, these functions indeed can be used to modify packets and yes data size has been automatically changed.

Upvotes: 3

Related Questions