gatekeeper icon indicating copy to clipboard operation
gatekeeper copied to clipboard

Adopting rte_pktmbuf_read()

Open AltraMayor opened this issue 6 years ago • 2 comments

We have written Gatekeeper without using rte_pktmbuf_read(), so the code assumes that the headers that need to be inspected are in the first segment of the struct rte_mbuf and the code explicitly checks that there are still bytes to be read in the packet whenever a new header must be inspected. Our code can drop that assumption and simplify the buffer size verification adopting rte_pktmbuf_read().

AltraMayor avatar Jun 08 '18 14:06 AltraMayor

A related concern to reading bytes from packets is the usage of fields data_len and pkt_len of struct rte_mbuf.

pkt_len is the length of all segments of a struct rte_mbuf and data_len is the data length of the individual buffer itself.

We mostly use data_len but there is at least one usage of pkt_len that should be looked at in sol/main.c.

cjdoucette avatar Sep 25 '18 18:09 cjdoucette

While we review the fields data_len and pkt_len of struct rte_mbuf, we should also adopt the macros rte_pktmbuf_pkt_len() and rte_pktmbuf_data_len() to use instead of the fields.

AltraMayor avatar Jun 06 '19 18:06 AltraMayor