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 F3ABB45490; Tue, 18 Jun 2024 17:48:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF6E1402E3; Tue, 18 Jun 2024 17:48:01 +0200 (CEST) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 6BE78402B4 for ; Tue, 18 Jun 2024 17:48:00 +0200 (CEST) Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-57c83100bd6so6898313a12.3 for ; Tue, 18 Jun 2024 08:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1718725680; x=1719330480; darn=dpdk.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IrnqMcWGCYSZO+iHquDY2nq5JcH2MaKscQdIWYGdweE=; b=NBoNZ9u9zSgMuAMla0M/KfIkCB87E4o9H1udbAtE0m57RVP0UY+pqfqJCXvdv5inPj Ydix4eT9BJfVT7C9K7Ycpu+2oBNZ3+7ldIDW+9G+dqi4dWZnovX3IruUTKa1HRaW/yAj lVuZaUsjsWocHn5Nj+HJ4yDnVQrXgafvAQUEj14/OXhbMHfu0Ykvt0EHsbSLihfSVJ2N 8Cx0FT/mCF18xtXUZ0VczTsXTz/874m8GUUzezAe3fv/B2FckkF5XIvpIuAjvtFcj5yD zkn4TWiChPY2Sxh3DAtqn33KeJiZlR98NLK9vqFOHiM+xeeAhFRs2jNWYQb8dGNGOAnp Xilw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718725680; x=1719330480; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IrnqMcWGCYSZO+iHquDY2nq5JcH2MaKscQdIWYGdweE=; b=mqUYsamZM5rKKeXQNnn4PXocDZFpgGU50BeJpyNL+u8RmU8lTaYtki1JYiEwQcLg44 CuQ8fLnu8i7YOBDoTV4bdNwXCv38SQSuKmrtXAEpJh/dY7AfHBTIU4/QK/rRuQSviqFv uV89V5LXryxHwi5MrKOclpdhPyL/rEuP7vC+M9CqdT4jwIdt/7Mh8msM3w7TveZw0/qY 0SyVM8yx2d7EQWWfH0Yv9rbnCQWJllqrcsV2XQsvhYprRZFj8Z7hN0K8Dp/QOu8+yAHM 9e9+ENi2gMqOEkD0LXq75uH/hCtzaA7nwsoBuDUWOHzFm4At0J5SbGlfFgNhMzzKpJga QLYg== X-Gm-Message-State: AOJu0Yycc5fMJ7JnHtsMxJFX0WKbsCQhumbYn2wJFYh3MNQg7N3F6OgV MTyil+8mKPlmPgO6b1pCKAypXJLKwEL8boBme62tyFTuo8mVWoceL6aRWh33WIE= X-Google-Smtp-Source: AGHT+IFu3nInuxtTc0A2UsBue/471jOlkqwMty+0uWNGi4E/Ufz2HdveNNlkktAqNSPMkxvtfTqbCQ== X-Received: by 2002:a50:d793:0:b0:57c:ab22:18a8 with SMTP id 4fb4d7f45d1cf-57cbd651ceemr7788732a12.7.1718725679794; Tue, 18 Jun 2024 08:47:59 -0700 (PDT) Received: from [192.168.1.113] ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb741e5a3sm7804871a12.65.2024.06.18.08.47.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jun 2024 08:47:59 -0700 (PDT) Message-ID: <702b8a6a-c504-4ac1-ba53-cda051808358@pantheon.tech> Date: Tue, 18 Jun 2024 17:47:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/4] dts: add context manager for interactive shells To: jspewock@iol.unh.edu, probb@iol.unh.edu, yoan.picchi@foss.arm.com, npratte@iol.unh.edu, Honnappa.Nagarahalli@arm.com, wathsala.vithanage@arm.com, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, thomas@monjalon.net Cc: dev@dpdk.org References: <20240514201436.2496-1-jspewock@iol.unh.edu> <20240613181510.30135-1-jspewock@iol.unh.edu> <20240613181510.30135-2-jspewock@iol.unh.edu> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: <20240613181510.30135-2-jspewock@iol.unh.edu> Content-Type: text/plain; charset=UTF-8; format=flowed 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 On 13. 6. 2024 20:15, jspewock@iol.unh.edu wrote: > From: Jeremy Spewock > > Interactive shells are managed in a way currently where they are closed > and cleaned up at the time of garbage collection. Due to there being no > guarantee of when this garbage collection happens in Python, there is no > way to consistently know when an application will be closed without > manually closing the application yourself when you are done with it. > This doesn't cause a problem in cases where you can start another > instance of the same application multiple times on a server, but this > isn't the case for primary applications in DPDK. The introduction of > primary applications, such as testpmd, adds a need for knowing previous > instances of the application have been stopped and cleaned up before > starting a new one, which the garbage collector does not provide. > > To solve this problem, a new class is added which acts as a base class > for interactive shells that enforces that instances of the > application be managed using a context manager. Using a context manager > guarantees that once you leave the scope of the block where the > application is being used for any reason, the application will be closed > immediately. This avoids the possibility of the shell not being closed > due to an exception being raised or user error. The interactive shell > class then becomes shells that can be started/stopped manually or at the > time of garbage collection rather than through a context manager. > > depends-on: patch-139227 ("dts: skip test cases based on capabilities") > > Signed-off-by: Jeremy Spewock Reviewed-by: Juraj Linkeš