DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Segmentation Fault on printf()
@ 2014-03-14 10:27 sabu kurian
  2014-03-14 16:10 ` Chris Wright
  0 siblings, 1 reply; 4+ messages in thread
From: sabu kurian @ 2014-03-14 10:27 UTC (permalink / raw)
  To: dev

Hello friends,

I'm trying to print the ether_type for a packet that I captured from a port
on my machine. Suppose 'm' holds the packet. 'm' is of type 'struct
rte_mbuf'. Intels API reference for DPDK says 'ether_type' is of uint16_t.
I used the following code to retrieve ether_type.

void * eth_type;
struct ether_hdr *eth;

eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
eth_type = &eth->ether_type;

printf("\n Type is %" PRIu16 , *((uint16_t *)eth_type));

rte_pktmbuf_free(m);

I get a 'Segmentation fault' when the printf() statement gets executed.
Where am I going wrong ?

Thanks in advance

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-17 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-14 10:27 [dpdk-dev] Segmentation Fault on printf() sabu kurian
2014-03-14 16:10 ` Chris Wright
2014-03-16 13:03   ` sabu kurian
2014-03-17 19:45     ` Daniel Kaminsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).