DPDK patches and discussions
 help / color / mirror / Atom feed
* hash lookup in secondary process
@ 2024-05-28 21:34 Mohsen Meamarian
  0 siblings, 0 replies; only message in thread
From: Mohsen Meamarian @ 2024-05-28 21:34 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]

Hi all,

I have two dpdk app, one primary and one secondary. I create a hash table
in the primary dpdk app like this:

static struct rte_hash_parameters ut_params = {
    .name = "BufferTable2",
    .entries = 1024*256,
    .key_len = sizeof(uint64_t),
    .hash_func = rte_jhash,
    //.extra_flag=RTE_HASH_EXTRA_FLAGS_EXT_TABLE,
    //.extra_flag=RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY,
};

    buffer_table = rte_hash_create(&ut_params);
    if (buffer_table == NULL) {
        printf("UNABLE TO CREATE HASHTABLE\n");
        rte_exit(EXIT_FAILURE, "UNABLE TO CREATE HASHTABLE\n");
    }


and in secondary I use :

    h=rte_hash_find_existing("BufferTable1");
    if (!h) {
        fprintf(stderr, "Failed to find existing hash table\n");
        return -1;
    }

int ret = rte_hash_lookup_data(buffer_table, &teid,
(void**)&packet_in_bucket);

I can find the table pointer, but it gives a segmentation fault when I want
to look up something or add some key value.
I cannot add a key value in the primary app, so it should be in the
secondary app.

I checked rte_hash_lookup_with_hash_data and rte_hash_add_key_with_hash.
these get a hash signature along with a key/value. but it also gives
segfault. in this way, the hash sig should be calculated manually.


I saw this too in dpdk doc:

The use of function pointers between multiple processes running based on
different compiled binaries is not supported, since the location of a given
function in one process may be different from its location in a second.
This prevents the librte_hash library from behaving properly as in a
multi-process instance since it uses a pointer to the hash function
internally.
https://doc.dpdk.org/guides/prog_guide/multi_proc_support.html

can you explain what I should do?
dpdk version 24.03



Best,
Mohsen

[-- Attachment #2: Type: text/html, Size: 2528 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-28 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-28 21:34 hash lookup in secondary process Mohsen Meamarian

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).