DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Rohit Saini (Stellus)" <rohit.saini@stellus.com>
To: 'Sergio Gonzalez Monroy' <sergio.gonzalez.monroy@intel.com>,
	"'dev@dpdk.org'" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Use rte_malloc in application
Date: Thu, 10 Aug 2017 11:19:15 +0000	[thread overview]
Message-ID: <3eec78a1002f41d4a7ccc9bb1d2f5ef2@stellus.com> (raw)
In-Reply-To: <2f989384-b5e8-f975-9a65-de5b4e3c0dd1@intel.com>

Thanks Sergio. It helped. There was a mistake the way I was linking dpdk with my application.

Thanks,
Rohit

-----Original Message-----
From: Sergio Gonzalez Monroy [mailto:sergio.gonzalez.monroy@intel.com] 
Sent: Thursday, August 03, 2017 1:59 PM
To: Rohit Saini (Stellus) <rohit.saini@stellus.com>; 'dev@dpdk.org' <dev@dpdk.org>
Subject: Re: [dpdk-dev] Use rte_malloc in application

On 03/08/2017 07:12, Rohit Saini (Stellus) wrote:
> With below code, I am getting this warning.
>
> warning: cast to pointer from integer of different size 
> [-Wint-to-pointer-cast]
>
> my_node_t *data_ptr = (my_node_t *) rte_malloc(NULL, 
> sizeof(my_node_t), 0);

As far as I can see, the syntax looks correct.

How are you building/linking your application?

I would suggest to modify the DPDK examples/helloworld application to just do a simple rte_malloc as a first step.

Thanks,
Sergio


> Thanks,
> Rohit
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Rohit Saini 
> (Stellus)
> Sent: Thursday, August 03, 2017 11:28 AM
> To: 'dev@dpdk.org' <dev@dpdk.org>
> Subject: [dpdk-dev] Use rte_malloc in application
>
> Hi,
> I have a use case in my application where I need to implement my own memory manager, rather than doing malloc/free everytime to kernel.
> Instead of writing my own memory manager, I am thinking to use dpdk rte_malloc or rte_mempool. Please let me know if this is a good idea.
>
> Also,
>
> my_node_t *data_ptr = (my_node_t *) (uintptr_t) rte_malloc(NULL, 
> sizeof(my_node_t), 0);
>
> data_ptr is pointing to some invalid memory.  Am I doing anything wrong here?
>
>
> Thanks,
> Rohit

  reply	other threads:[~2017-08-10 11:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170803055747uscas1p15fd0c2a998cf260734f89cc48192a61c@uscas1p1.samsung.com>
2017-08-03  5:57 ` Rohit Saini (Stellus)
2017-08-03  6:12   ` Rohit Saini (Stellus)
2017-08-03  8:29     ` Sergio Gonzalez Monroy
2017-08-10 11:19       ` Rohit Saini (Stellus) [this message]
2017-08-03 13:29     ` Stefan Puiu

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=3eec78a1002f41d4a7ccc9bb1d2f5ef2@stellus.com \
    --to=rohit.saini@stellus.com \
    --cc=dev@dpdk.org \
    --cc=sergio.gonzalez.monroy@intel.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).