From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E1F341E93; Tue, 14 Mar 2023 18:37:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE0D742BDA; Tue, 14 Mar 2023 18:36:55 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id A7B8141101 for ; Tue, 14 Mar 2023 18:36:53 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id j13so406663pjd.1 for ; Tue, 14 Mar 2023 10:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678815413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M68cgGAccwdlcns1EQOlHuBCNsyevWXyU7u1VYuw/Ms=; b=LUnQs+pLcdx5fH5b3cPqYFU38+x3aEzDhs6aeZ2YHjNPGRgHVECjrcic+LD3RmL5Xn oRSrR36CY23vvdQM+Mp/C/gTryeRtTyLjvUvtfl8ofU17YqEVcgW5Z3tZS/6tvK/iiKb 6Gf98m//6sVDCtEGUPha2lk+dnJkH+15w08FbEqy1cPn0uS1xkZqtHoU7KPi/wzZNic8 29BucyHC27ar1wP+3RorSgcC2oOMMKbS3EU8I2iYeGXfewK2BMUfp77IId0z06kimmsQ 0smimdNAx0SJ7tQqasJdIkfX+tJs3fuWseqOEQUWe+KALa/S0/JcoFxDRbLfGQrjWmsx AL8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678815413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M68cgGAccwdlcns1EQOlHuBCNsyevWXyU7u1VYuw/Ms=; b=QC8wSRBzwIWXhb3cRGqiUSY9hc+iINmRBdcEnxJkX0/J3CZfePlsFyp4qUBtzFHpzm PeoRvFprfZqtISxrXXTImG123ffAOgSstQZAtnJkQDo1Y+xs7lSmamUwnzYytNlWhYGi TV52pckOwlBBu1K/4bRkogz6h3uPT+CzBTL0vwneREH6wuumRXV05c9clIy7BVSao10+ boLDzUZCpu/6Z0kmGe9WB7BQryiLrxOVF7iYO0oqh4Iwpqm+XsQfPFu782ulemimNsr+ dWqgv21gxZ2XnJMm6q+9zoLvqjXZotxvE2kbxqafAhgppA2m1V1ObPsdL84/2hVSNqSs h3Rw== X-Gm-Message-State: AO0yUKVBsJ/hu2hFmEgkE8eGMO2QUsk3E73IltuqSSMm2S2U+hFIjgG7 G7/HYVm+pDn6FfIXT8Oy3P3qjvmVItvj2CLZkoqEkA== X-Google-Smtp-Source: AK7set+y6LR4kfUirirdMtn0qFi4kdNG1vnWyi0FuCPF/x5JNhVDKD9K3wBkuh5+zG7o3O2ej/hZNg== X-Received: by 2002:a17:902:da87:b0:19e:4862:13ab with SMTP id j7-20020a170902da8700b0019e486213abmr43017633plx.69.1678815412969; Tue, 14 Mar 2023 10:36:52 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q11-20020a170902a3cb00b0019ac9c4f32esm1979970plb.309.2023.03.14.10.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 10:36:52 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang Subject: [PATCH v3 2/3] testpmd: use sig_atomic_t for flag Date: Tue, 14 Mar 2023 10:36:47 -0700 Message-Id: <20230314173648.69528-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314173648.69528-1-stephen@networkplumber.org> References: <20230313171905.67720-1-stephen@networkplumber.org> <20230314173648.69528-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Standard conforming signal handling in applications should use sig_atomic_t for flags set by signal handler. https://www.gnu.org/software/libc/manual/html_node/Atomic-Data-Access.html This is really just a fancy way of saying ''int'' but adds to platform portablilty for DPDK. Signed-off-by: Stephen Hemminger --- app/test-pmd/testpmd.c | 6 +----- app/test-pmd/testpmd.h | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5cb6f9252395..aee926571f53 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -228,11 +228,7 @@ struct rte_eth_xstat_name *xstats_display; unsigned int xstats_display_num; /**< Size of extended statistics to show */ -/* - * In container, it cannot terminate the process which running with 'stats-period' - * option. Set flag to exit stats period loop after received SIGINT/SIGTERM. - */ -volatile uint8_t f_quit; +volatile sig_atomic_t f_quit; /* Quit testpmd from signal */ uint8_t cl_quit; /* Quit testpmd from cmdline. */ /* diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index bdfbfd36d3c5..5c11d4f86301 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -6,6 +6,7 @@ #define _TESTPMD_H_ #include +#include #ifdef RTE_LIB_GRO #include @@ -34,7 +35,7 @@ #define RTE_PORT_HANDLING (uint16_t)3 extern uint8_t cl_quit; -extern volatile uint8_t f_quit; +extern volatile sig_atomic_t f_quit; /* * It is used to allocate the memory for hash key. -- 2.39.2