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 D74F0A04FD; Mon, 26 Dec 2022 19:05:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37AC342D1E; Mon, 26 Dec 2022 19:05:07 +0100 (CET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 9CD104114B for ; Mon, 26 Dec 2022 19:05:05 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso15247083pjp.4 for ; Mon, 26 Dec 2022 10:05:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=1+qa6ku14wqghRbDF7MwJX1AE1tQfixML+4MlV1hDxE=; b=DmdBwBX1ewuuu3t9N0nsOzGwMagTHc6p8fN2dwGeMPx9JqYlHa64dCS0tcqOpg45CS b7F9I/41AVuzfvFbopfiB8Sq7biXvFRlypnFj8wKbrTXmXhjwlj/RUoK6YZmWr6wzsP6 LolWtZufpZu6pnuJ3OcBQa6NJsCy1+ZreXnEhjC/IduWsO/lVr6pyEPEVz8ArVcIflGm 9ZOcBD+615gcyxkwtHZw6FVJ3Ch55jpmWevVGmgqcQ8qg7+ojfv8UptqfbfSvYBrT8mj tP+S1iFJ7QhaS4cn6vElZc3j73Tu29cY9+Uwb/xmPci7zTjX39L92riZeRS6PvMRBYh5 EkuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1+qa6ku14wqghRbDF7MwJX1AE1tQfixML+4MlV1hDxE=; b=vtqad+m+XFSGi81E+jMCDiJ16P4BRcyKdGuE1/lpN4AdYyWpNx1yXnO3pWuYZQyx6M wV/5FgrV5uu4KxdOLbi4vaMuoskgyzk+61GmliBuyHMFBt4xU3BDXaO5HUskQ5aPd7Lf kpXaf2R1mmiL5lzC9QE2Q+VB7eC8FNUh9NzsKWEvHtcRN2me6S2eROaV78eLhgBIX2d9 AQpedRMtXDQxWsxyYQCRGge5ablS0p9F7zJHK2wfCD2VoZNBycp+iK+j/U2/uRm6kBpS vbzpk2nB+l9JABjqXxFwa+TVSJamVNXR+obUuxGinhMBOUHOy6zkfSLOZCmGQTIH/J0X jRfQ== X-Gm-Message-State: AFqh2kqRVqBZFQzsZf1wPbzzEjnIJrYlNIs1FIa4so9eoxP7HBR3W7dF LlEA+qeS66+z8qG/47vo0s8doA== X-Google-Smtp-Source: AMrXdXsnVXaM+Ox9oZB7590Q7o5J4zn2KrYNFFVQfdLega5brHpVNrByvdSvzXACa1pQrr6OULPULg== X-Received: by 2002:a17:902:c382:b0:192:4e35:e048 with SMTP id g2-20020a170902c38200b001924e35e048mr19027642plg.35.1672077904537; Mon, 26 Dec 2022 10:05:04 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id o4-20020a170902bcc400b0019254c19697sm7307474pls.289.2022.12.26.10.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 10:05:03 -0800 (PST) Date: Mon, 26 Dec 2022 10:05:00 -0800 From: Stephen Hemminger To: Yajun Wu Cc: , Maxime Coquelin , "Chenbo Xia" , Chengchang Tang , , Subject: Re: [PATCH] examples/vdpa: fix devices cleanup Message-ID: <20221226100500.65cf96d0@hermes.local> In-Reply-To: <20221226065105.2480103-1-yajunw@nvidia.com> References: <20221226065105.2480103-1-yajunw@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 26 Dec 2022 14:51:06 +0800 Yajun Wu wrote: > Move rte_eal_cleanup to function vdpa_sample_quit which > handling all example app quit. > Otherwise rte_eal_cleanup won't be called on receiving signal > like SIGINT(control + c). > > Fixes: 10aa3757 ("examples: add eal cleanup to examples") > Cc: stable@dpdk.org > > Signed-off-by: Yajun Wu > Acked-by: Matan Azrad NAK rte_eal_cleanup is not signal safe. This (and several other applications) are not managing termination signals correctly. It is not safe to call many DPDK functions from a signal handler. Imagine the case of getting SIGINT in the middle of a driver holding a spin lock, then calling the close function of that driver which then acquires the same lock. The only safe way to handle signals is to set a flag and do the shutdown and cleanup from the main loop.