From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-x244.google.com (mail-qa0-x244.google.com [IPv6:2607:f8b0:400d:c00::244]) by dpdk.org (Postfix) with ESMTP id D6FAD6893 for ; Fri, 14 Mar 2014 11:25:47 +0100 (CET) Received: by mail-qa0-f68.google.com with SMTP id hw13so754256qab.3 for ; Fri, 14 Mar 2014 03:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=9ZVcZ50VSXVzEBpCJgYAlcAK/ByeEdHj3Ew6p3be62Q=; b=XkxlXiu2bTDY4BS8n7ye14Siy1zHY2Z8WMlomVibw/ygYmohlI9FEPxxPLkW3YOSPM mdbHLONyjwgwYlUMD9y5I+fu6nNjC+w6E1qcE4Rco8mxHkelyhPnWTdCE5f/uTJE+Uwa vwdShAgKocLZYwZEopTUohl2cYLjjFeciBd7ob7dR3Sr5bw7HpPXw/6fhmmuWy4bio52 VWZspm738VtoZ/QtzhhZQ+T+Vxj4xLSl4znfrJYAEMPZCQxVebpJDTASRrxKAm2Q4Rir GfKDhUYp+tTp4kIpw3qnOISWcSSwi2lpzg9zSp5ac2+bslHfcr8zmpDFVIlkPOkBDEZ6 Qs2g== MIME-Version: 1.0 X-Received: by 10.224.92.75 with SMTP id q11mr8709835qam.56.1394792838167; Fri, 14 Mar 2014 03:27:18 -0700 (PDT) Received: by 10.96.69.97 with HTTP; Fri, 14 Mar 2014 03:27:18 -0700 (PDT) Date: Fri, 14 Mar 2014 15:57:18 +0530 Message-ID: From: sabu kurian To: "dev@dpdk.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Segmentation Fault on printf() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 10:25:48 -0000 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