Created
September 1, 2016 04:43
-
-
Save zhangwei1984/7f85d695d456991c5e6cbbef0b8aea8f to your computer and use it in GitHub Desktop.
rust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ether_hdr* eth; | |
struct rte_mbuf *pkt = batch->pkts[i]; | |
eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *); | |
the related macro: | |
#define rte_pktmbuf_mtod_offset(m, t, o) ((t)((char *)(m)->buf_addr + (m)->data_off + (o))) | |
#define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment