DPDK usage discussions
 help / color / mirror / Atom feed
From: =?gb18030?B?s8no69XfsfA=?= <373755701@qq.com>
To: =?gb18030?B?dXNlcnM=?= <users@dpdk.org>
Subject: [dpdk-users] My questions about dpdk hash
Date: Thu, 6 Apr 2017 18:57:38 +0800	[thread overview]
Message-ID: <tencent_76C1F5CD70706C61225E0A78@qq.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1346 bytes --]

Hi all:
     here is my pseudo code:
     struct HASH_KEY
     {
         int data1;
         int data2;
      };
     void test_hash_add_key()
     {
        struct rte_hash* testHash;
        struct rte_hash_parameters hash_params;
        hash_params.name = "xxxyyy";
        hash_params.entries = 64;
        hash_params.hash_func = rte_jhash;
        hash_params.hash_func_init_val = 0;
        hash_params.key_len = sizeof(struct HASH_KEY);
        hash_params.socket_id = rte_socket_id();
        
        testHash = rte_hash_create(&hash_params);
        if(NULL == testHash)
        {
           return;
         }
          struct HASH_KEY hashKey;
          hashKey.data1=1;
          hashKey.data2=2;
          int iRet = rte_hash_add_key(testHash,(void*)&hashKey);
      }


       int main()
       {
          rte_eal_init();
          test_hash_add_key();
          return 0;
        }


The program give me a error "signal SIGILL ,illegal instruction"  in __rte_hash_add_key_with_hash,when i GDB it.


Using "static struct rte_hash_parameters hash_params; " or "static struct HASH_KEY hashKey; program would be OKey." , program would be okey and the error disappeared.
BUT,the test demo is so simple, I want to know WHY can it encounter an error.


     Any help would be appreciated.

             reply	other threads:[~2017-04-06 10:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 10:57  =?gb18030?B?s8no69XfsfA=?= [this message]
2017-04-06 11:27 ` De Lara Guarch, Pablo

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=tencent_76C1F5CD70706C61225E0A78@qq.com \
    --to=373755701@qq.com \
    --cc=users@dpdk.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).