From mboxrd@z Thu Jan 1 00:00:00 1970 From: sabu kurian Subject: Segmentation Fault on printf() Date: Fri, 14 Mar 2014 15:57:18 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 To: "dev-VfR2kkLFssw@public.gmane.org" Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "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 = ð->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