@@ -48,6 +48,7 @@
#include "fat-rwlock.h"
#include "flow.h"
#include "hmapx.h"
+#include "keepalive.h"
#include "latch.h"
#include "netdev.h"
#include "netdev-vport.h"
@@ -3723,6 +3724,8 @@ pmd_thread_main(void *f_)
poll_list = NULL;
+ ka_store_pmd_id(pmd->core_id);
+
/* Stores the pmd thread's 'pmd' to 'per_pmd_key'. */
ovsthread_setspecific(pmd->dp->per_pmd_key, pmd);
ovs_numa_thread_setaffinity_core(pmd->core_id);
@@ -63,6 +63,19 @@ get_ka_init_status(void)
return ka_init_status;
}
+void
+ka_store_pmd_id(unsigned core_idx)
+{
+ int tid = -1;
+#ifdef DPDK_NETDEV
+ tid = rte_sys_gettid();
+#endif
+
+ if (ka_is_enabled()) {
+ ka_info->thread_id[core_idx] = tid;
+ }
+}
+
/* Register thread to KA framework. */
void
ka_register_pmd_thread(int tid OVS_UNUSED, bool thread_is_pmd OVS_UNUSED,
@@ -76,6 +76,7 @@ void ka_unregister_pmd_thread(int, bool, unsigned);
void ka_mark_pmd_thread_alive(void);
void ka_mark_pmd_thread_sleep(void);
+void ka_store_pmd_id(unsigned core);
uint32_t get_ka_interval(void);
int get_ka_init_status(void);
This commit adds an API to store the PMD thread ids in to KA info struct. The thread ids shall be used to check false positives and for status and statistics reporting. Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> --- lib/dpif-netdev.c | 3 +++ lib/keepalive.c | 13 +++++++++++++ lib/keepalive.h | 1 + 3 files changed, 17 insertions(+)