dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: sabu kurian <sabu2kurian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Segmentation Fault on printf()
Date: Fri, 14 Mar 2014 15:57:18 +0530	[thread overview]
Message-ID: <CAJ2bnfDcs9OiycSFcC9CvSihJ=u6vQt5ema_VMjseq-CiDsqBQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2014-03-14 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 10:27 sabu kurian [this message]
     [not found] ` <CAJ2bnfDcs9OiycSFcC9CvSihJ=u6vQt5ema_VMjseq-CiDsqBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-14 16:10   ` Segmentation Fault on printf() Chris Wright
     [not found]     ` <20140314161047.GD1390-SwUeJysX96B82hYKe6nXyg@public.gmane.org>
2014-03-16 13:03       ` sabu kurian
     [not found]         ` <CAJ2bnfAt=guObm2VZuLrAfXiOGWdCZHhg4A_Ek-YdtwDbRS-bQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-17 19:45           ` Daniel Kaminsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ2bnfDcs9OiycSFcC9CvSihJ=u6vQt5ema_VMjseq-CiDsqBQ@mail.gmail.com' \
    --to=sabu2kurian-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).