title: How to use rte_hash_add_key_data?
body: <p>I write a program based on DPDK,I am not familiar with dpdk hash library,so I write an example about DPDK hash.The code is:</p>
  
  <pre><code>struct rte_hash *hash;
  struct rte_hash_parameters params;
  void *data;
  int key;
  int d;
  int ret;
  bzero (&amp;params,sizeof (params));
  
  params.name = NULL;
  params.entries = 500;
  params.key_len = sizeof (int);
  params.hash_func = rte_jhash;
  params.hash_func_init_val = 0;
  
  hash = rte_hash_create (&amp;params);
  if (!hash) {
      fprintf (stderr,"rte_hash_create failed\n");
      return;
  }   
  
  key = 0;
  data = NULL;
  key = 1;  
  d = 1;
  //add 1/1 to hash table
  rte_hash_add_key_data (hash,&amp;key,(void *) (long) d); 
  key = 2;
  d = 2;
  //add 2/2 to hash table
  rte_hash_add_key_data (hash,&amp;key,(void *) (long) d); 
  
  key = 2;
  //I want to lookup with key = 2
  //But it failed.
  ret = rte_hash_lookup_data (hash,&amp;key,&amp;data);
  if (ret) {
      if (ret == ENOENT) {
          fprintf (stderr,"find failed\n");
          return;
      }   
  
      if (ret == EINVAL) {
          fprintf (stderr,"parameter invalid");
          return;
      }
      fprintf (stderr,"lookup failed");
      return;
  }
  </code></pre>
  
  <p>In the code above, I add 1/1 and 2/2 to hash table.
  but rte_hash_lookup_data with key = 2 failed.How to deal with this problem?
  Thank you.</p>