From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2BA72A0531; Tue, 4 Feb 2020 09:42:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35BAF1C00D; Tue, 4 Feb 2020 09:42:49 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 670DB1C000; Tue, 4 Feb 2020 09:42:48 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0148f93t015937; Tue, 4 Feb 2020 00:42:47 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=lX/8Knf298HFD/YJYLkMxsjcm6beoNAJaLGvAtwJhvw=; b=gzvbYNJFxvJvs1HT121tXXzO+lfOEvuLzHTt5nkJ9xvN91D74XV1Gup5FxplSh8jGZwo MLU5ZAPziWG4TMyqUEfzXDYnUpqyWkfYanJDUmOntGceurxbTKXve4wAi/ujHol6GXuB BAj9hJFoAYpDQela7jbLqsyeriyf8ZUKvbFBe8JiYlug+qSn5cPuEdw5GarOHZnRugF8 MUbbgKtLYC2snz7siUPtrpxTxst+v1+mlvgDuKYGYlGBmOu40RCJsQxTb7eEqmraFmav tSjRGcptMXllLb/hOa4h0eWbVzPyf0Rv4XaxJIm5RC6D5xryN8SjIPU2tgifhRFOFvkT OA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2xw9quk06s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 04 Feb 2020 00:42:47 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 4 Feb 2020 00:42:45 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 4 Feb 2020 00:42:45 -0800 Received: from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72]) by maili.marvell.com (Postfix) with ESMTP id 6F3D23F7162; Tue, 4 Feb 2020 00:42:43 -0800 (PST) From: To: CC: , , , Vamsi Attunuru , Date: Tue, 4 Feb 2020 14:12:14 +0530 Message-ID: <20200204084214.18801-1-vattunuru@marvell.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-04_02:2020-02-04, 2020-02-04 signatures=0 Subject: [dpdk-dev] [PATCH] [v1 1/1] examples/kni: fix SIGTERM signal handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Vamsi Attunuru Current KNI example application is not handling SIGTERM signal when application is killed without passing any specific signal in kill command. Patch uses the existing signal handler for SIGTERM as well for graceful application exit. Fixes: 13c4ebd65a77 ("examples: minor changes") Cc: stable@dpdk.org Signed-off-by: Vamsi Attunuru --- examples/kni/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/kni/main.c b/examples/kni/main.c index 5f713e6..29fc37e 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -176,9 +176,13 @@ signal_handler(int signum) return; } - /* When we receive a RTMIN or SIGINT signal, stop kni processing */ - if (signum == SIGRTMIN || signum == SIGINT){ - printf("\nSIGRTMIN/SIGINT received. KNI processing stopping.\n"); + /* + * When we receive a RTMIN or SIGINT or SIGTERM signal, + * stop kni processing + */ + if (signum == SIGRTMIN || signum == SIGINT || signum == SIGTERM) { + printf("\nSIGRTMIN/SIGINT/SIGTERM received. " + "KNI processing stopping.\n"); rte_atomic32_inc(&kni_stop); return; } @@ -1006,6 +1010,7 @@ main(int argc, char** argv) signal(SIGUSR2, signal_handler); signal(SIGRTMIN, signal_handler); signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); /* Initialise EAL */ ret = rte_eal_init(argc, argv); -- 2.8.4