From 2bd7f91ca30d5e988bf0d2926e00dca0be647303 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Jun 09 2023 17:57:11 +0000 Subject: Import openvswitch3.1-3.1.0-38 from Fast DataPath --- diff --git a/SOURCES/openvswitch-3.1.0.patch b/SOURCES/openvswitch-3.1.0.patch index 0eebf8f..420d678 100644 --- a/SOURCES/openvswitch-3.1.0.patch +++ b/SOURCES/openvswitch-3.1.0.patch @@ -718,6 +718,89 @@ index 6cb4dae6d..129cbf6a1 100644 /* Log functions. */ struct vlog_module; +diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c +index bbb31ef27..7054f8e74 100644 +--- a/lib/fatal-signal.c ++++ b/lib/fatal-signal.c +@@ -78,6 +78,39 @@ static void call_hooks(int sig_nr); + static BOOL WINAPI ConsoleHandlerRoutine(DWORD dwCtrlType); + #endif + ++/* Sets up a pipe or event handle that will be used to wake up the current ++ * process after signal is received, so it can be processed outside of the ++ * signal handler context in fatal_signal_run(). */ ++static void ++fatal_signal_create_wakeup_events(void) ++{ ++#ifndef _WIN32 ++ xpipe_nonblocking(signal_fds); ++#else ++ wevent = CreateEvent(NULL, TRUE, FALSE, NULL); ++ if (!wevent) { ++ char *msg_buf = ovs_lasterror_to_string(); ++ VLOG_FATAL("Failed to create a event (%s).", msg_buf); ++ } ++#endif ++} ++ ++static void ++fatal_signal_destroy_wakeup_events(void) ++{ ++#ifndef _WIN32 ++ close(signal_fds[0]); ++ signal_fds[0] = -1; ++ close(signal_fds[1]); ++ signal_fds[1] = -1; ++#else ++ ResetEvent(wevent); ++ CloseHandle(wevent); ++ wevent = NULL; ++#endif ++} ++ ++ + /* Initializes the fatal signal handling module. Calling this function is + * optional, because calling any other function in the module will also + * initialize it. However, in a multithreaded program, the module must be +@@ -94,15 +127,10 @@ fatal_signal_init(void) + inited = true; + + ovs_mutex_init_recursive(&mutex); +-#ifndef _WIN32 +- xpipe_nonblocking(signal_fds); +-#else +- wevent = CreateEvent(NULL, TRUE, FALSE, NULL); +- if (!wevent) { +- char *msg_buf = ovs_lasterror_to_string(); +- VLOG_FATAL("Failed to create a event (%s).", msg_buf); +- } + ++ fatal_signal_create_wakeup_events(); ++ ++#ifdef _WIN32 + /* Register a function to handle Ctrl+C. */ + SetConsoleCtrlHandler(ConsoleHandlerRoutine, true); + #endif +@@ -456,6 +484,9 @@ do_unlink_files(void) + * hooks passed a 'cancel_cb' function to fatal_signal_add_hook(), then those + * functions will be called, allowing them to free resources, etc. + * ++ * Also re-creates wake-up events, so signals in one of the processes do not ++ * wake up the other one. ++ * + * Following a fork, one of the resulting processes can call this function to + * allow it to terminate without calling the hooks registered before calling + * this function. New hooks registered after calling this function will take +@@ -467,6 +498,9 @@ fatal_signal_fork(void) + + assert_single_threaded(); + ++ fatal_signal_destroy_wakeup_events(); ++ fatal_signal_create_wakeup_events(); ++ + for (i = 0; i < n_hooks; i++) { + struct hook *h = &hooks[i]; + if (h->cancel_cb) { diff --git a/lib/learning-switch.c b/lib/learning-switch.c index 8102475ca..cdf42935c 100644 --- a/lib/learning-switch.c diff --git a/SPECS/openvswitch3.1.spec b/SPECS/openvswitch3.1.spec index 91c88b2..ca1b55c 100644 --- a/SPECS/openvswitch3.1.spec +++ b/SPECS/openvswitch3.1.spec @@ -63,7 +63,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 3.1.0 -Release: 37%{?dist} +Release: 38%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -757,6 +757,12 @@ exit 0 %endif %changelog +* Fri Jun 09 2023 Open vSwitch CI - 3.1.0-38 +- Merging upstream branch-3.1 [RH git: 1b7d3d3a1f] + Commit list: + 5fe322e169 fatal-signal: Don't share signal fds/handles with forked process. + + * Wed Jun 07 2023 Open vSwitch CI - 3.1.0-37 - Merging upstream branch-3.1 [RH git: 31e7facba9] Commit list: