DPDK patches and discussions
 help / color / mirror / Atom feed
From: Daniel Kaminsky <daniel.kaminsky@infinitelocality.com>
To: sabu kurian <sabu2kurian@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Error : dereferencing pointer to incomplete type......
Date: Mon, 17 Mar 2014 21:42:54 +0200	[thread overview]
Message-ID: <CA+8v-JzrZ8qPXAbWk3cyZg6sxz9+zs5B_4vru_4cCRgYCnAmoA@mail.gmail.com> (raw)
In-Reply-To: <CAJ2bnfAFuovG3MoAv4Eqy-jX+Gdqx9-20ZPFjj+b-t957=CnCg@mail.gmail.com>

Hi,

Are you sure that this is the line that gives the error? How did you define
m_pool?

Regarding coping one byte, copy using simple assignment should be the most
efficient way. If you want to make sure it is just 8 bits, do a bit wise
and (& 0xff).

Daniel


On Mon, Mar 17, 2014 at 10:27 AM, sabu kurian <sabu2kurian@gmail.com> wrote:

> A little bit of correction on the second format:
>
> iphdr->packet_id = rte_bswap16(0x0001); // This one gives error as well....
>
> Any idea on what could be wrong ?
>
> Thanks
>
>
>
>
>
>
> On Mon, Mar 17, 2014 at 1:51 PM, sabu kurian <sabu2kurian@gmail.com>
> wrote:
>
> > Hello friends,
> >
> > I get a error like "dereferencing pointer to incomplete type", when I try
> > to fill in the IPv4 headers.
> >
> > Below is the code snippet:
> >
> > struct ether_hdr *ehdr = rte_pktmbuf_mtod(m_pool, struct ether_hdr *);
> >
> > struct ipv4_hdr *iphdr = (struct ipv4_hdr *)(&ehdr[1]);
> >
> >
> > iphdr->packet_id = (uint16_t)0x0001; //This gives error.
> >
> > rte_bswap16(iphdr->packet_id,0x0001); //This format also gives the same
> > error.
> >
> > And also what is the best way to copy an 8 bit (1 byte) value for fields
> > like 'type_of_service' ? will rte_memcpy() work for it ?
> >
> >
> >
> > Thanks in advance....
> >
> >
>

  reply	other threads:[~2014-03-17 19:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17  8:21 sabu kurian
2014-03-17  8:27 ` sabu kurian
2014-03-17 19:42   ` Daniel Kaminsky [this message]
2014-03-18  9:55   ` Richardson, Bruce

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=CA+8v-JzrZ8qPXAbWk3cyZg6sxz9+zs5B_4vru_4cCRgYCnAmoA@mail.gmail.com \
    --to=daniel.kaminsky@infinitelocality.com \
    --cc=dev@dpdk.org \
    --cc=sabu2kurian@gmail.com \
    /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).