+/* Custom handling of signals to handle process terminal */
+static void
+signal_handler(int signum)
+{
+ uint8_t portid;
+ uint8_t nb_ports = rte_eth_dev_count();
+
+ /* When we receive a SIGINT signal */
+ if (signum == SIGINT) {
+ for (portid = 0; portid < nb_ports; portid++) {
+ /* skip ports that are not enabled */
+ if ((enabled_port_mask & (1 << portid)) == 0)
+ continue;
+ rte_eth_dev_close(portid);
+ }
+ }
+ rte_exit(EXIT_SUCCESS, "\n User forced exit\n");
+}