@@ -72,3 +72,9 @@ dpdk_mark_pmd_core_sleep(void)
{
/* Nothing */
}
+
+void
+dispatch_heartbeats(void)
+{
+ /* Nothing */
+}
@@ -543,3 +543,10 @@ dpdk_mark_pmd_core_sleep(void)
{
rte_keepalive_mark_sleep(rte_global_keepalive_info);
}
+
+/* Dispatch pings */
+void
+dispatch_heartbeats(void)
+{
+ rte_keepalive_dispatch_pings(NULL, rte_global_keepalive_info);
+}
@@ -47,4 +47,6 @@ void dpdk_unregister_pmd_core(unsigned core_id);
void dpdk_mark_pmd_core_alive(void);
void dpdk_mark_pmd_core_sleep(void);
+void dispatch_heartbeats(void);
+
#endif /* dpdk.h */
@@ -978,6 +978,11 @@ ovs_keepalive(void *f_)
pthread_detach(pthread_self());
for (;;) {
+ int n_pmds = cmap_count(&dp->poll_threads) - 1;
+ if (n_pmds > 0) {
+ dispatch_heartbeats();
+ }
+
ovsrcu_quiesce_start();
usleep(get_ka_interval() * 1000);
ovsrcu_quiesce_end();
This commit adds heartbeat mechanism support for DPDK datapath. Heartbeats are sent to registered PMD threads at predefined intervals (as set in ovsdb with 'keepalive-interval'). The heartbeats are only enabled when there is atleast one port added to the bridge and with active PMD thread polling the port. Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> --- lib/dpdk-stub.c | 6 ++++++ lib/dpdk.c | 7 +++++++ lib/dpdk.h | 2 ++ lib/dpif-netdev.c | 5 +++++ 4 files changed, 20 insertions(+)