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 via email to