@@ -3778,6 +3778,7 @@ pmd_thread_main(void *f_)
ovs_numa_thread_setaffinity_core(pmd->core_id);
dpdk_set_lcore_id(pmd->core_id);
poll_cnt = pmd_load_queues_and_ports(pmd, &poll_list);
+ ka_store_pmd_id(pmd->core_id);
reload:
emc_cache_init(&pmd->flow_cache);
@@ -75,6 +75,29 @@ get_ka_init_status(void)
return ka_init_status;
}
+void
+ka_store_pmd_id(unsigned core_idx)
+{
+ uint32_t tid = 0;
+#ifdef DPDK_NETDEV
+ tid = rte_sys_gettid();
+#endif
+
+ if (is_ka_enabled()) {
+ ka_shm->thread_id[core_idx] = tid;
+ }
+}
+
+uint32_t
+ka_get_tid(unsigned core_idx)
+{
+ uint32_t tid = 0;
+ if (ka_shm) {
+ tid = ka_shm->thread_id[core_idx];
+ }
+ return tid;
+}
+
/* Register packet processing core 'core_id' for liveness checks. */
void
ka_register_pmd_thread(unsigned core_id)
@@ -62,6 +62,8 @@ void ka_unregister_pmd_thread(unsigned);
void ka_mark_pmd_thread_alive(void);
void ka_mark_pmd_thread_sleep(void);
+void ka_store_pmd_id(unsigned core);
+uint32_t ka_get_tid(unsigned core);
bool is_ka_enabled(void);
uint32_t get_ka_interval(void);
int get_ka_init_status(void);
This commit adds an API to store the PMD thread id in SHM block. The tid later shall be retrieved by callback function that gets invoked to check for false positives. Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> --- lib/dpif-netdev.c | 1 + lib/keepalive.c | 23 +++++++++++++++++++++++ lib/keepalive.h | 2 ++ 3 files changed, 26 insertions(+)