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 43646A04FD for ; 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 1BC524114B; Mon, 26 Dec 2022 19:05:07 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 9B8FC40E2D for ; Mon, 26 Dec 2022 19:05:05 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id n65-20020a17090a2cc700b0021bc5ef7a14so11250790pjd.0 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=HFZnubT4LCfD1Tn9/dyn2Fm47Cv/OnWGkw998l20nVrDmGskS+jusRJ6Z+4H/MxHGO jWaSgUd7s+jJ7u+GWm19E4RZZwlf5zU3c7dP6sXOA+w5piCfISw6cD1KCH9RuTPNNgkK OM5jTp97wOUoEnbq9V/5oXZXg/MKpu+XoAVb+DDhFNRf52+AeVT3ceDjL/MiEsVodiy0 U8fKj6l2AzJcmy3Dm3e9Fjg/jNVI+EFVdUNzt2G3R5SFBi1fcUwlY6/Tazy5xi0EIIFa ZKsPL44zyuyIgrRVARjlm3NSD+MutU6SnyZtCygv7oWsi8roEXXsZcZh2LqyQwHos+oj 24XQ== X-Gm-Message-State: AFqh2krHmQOGtNNUWRN/02oSG2jG5zxCzdEJqtHR0+AvByxe0KrpyWEG 7TcBgTCyf8tR2kfuxoL/fxWZvA== 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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.