From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: Jeremy Spewock <jspewock@iol.unh.edu>,
Luca Vizzarro <Luca.Vizzarro@arm.com>
Cc: dev@dpdk.org, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
Paul Szczepanek <paul.szczepanek@arm.com>
Subject: Re: [PATCH v2 4/5] dts: add ability to start/stop testpmd ports
Date: Mon, 9 Sep 2024 17:16:47 +0200 [thread overview]
Message-ID: <480e75e5-3efb-4392-b1f3-b7a59f011fd3@pantheon.tech> (raw)
In-Reply-To: <CAAA20UQuMvvq-Jy_juZ2=MdTbVftz96gEdOm_t031mSFu=3Knw@mail.gmail.com>
On 9. 9. 2024 16:20, Jeremy Spewock wrote:
> On Fri, Sep 6, 2024 at 12:46 PM Luca Vizzarro <Luca.Vizzarro@arm.com> wrote:
>>
>> On 23/08/2024 13:16, Juraj Linkeš wrote:
>>> As Jeremy mentioned, adding the verify argument may be worthwhile, but
>>> maybe only if we actually identify a usecase where we wouldn't want to
>>> do the verification.
>>
>> Yeah, as I pointed out, it feels unlikely to pretend that they are
>> started (or stopped). I think that could cause my unpredicted behaviour
>> and confusion. But also as said already, it can always be added on demand.
>>
>
> I agree that we can save this as something to add as we need it and
> that there could be some confusion to pretending the ports are in a
> certain state. Since we actually save the state in testpmd, we
> definitely want that to be accurate. The main thing I was thinking
> about this for however was less about the state tracking and more
> about what the expectation is for developers when they specifically
> specify they do not want a method to be verified. There aren't many
> cases where you wouldn't want to verify the outcome of a command, but
> I would imagine the two reasons you would do so is either you don't
> care about the result, or you specifically don't want to be disruptive
> to the rest of the run if this command fails (like if the framework
> has a testpmd shell running for some kind of process but doesn't want
> to end the run if it fails). When we enforce the verification of some
> part of the process like stopping the port in this case, that
> assumption about not verifying changes. The second reason I mentioned
> is why I believe capabilities checking specifies no-verify when it
> updates the MTU, for example. I imagine we don't want the test run to
> end if a testpmd method fails its check with capabilities, we would
> want the capability to just be unsupported. Of course the developer
> could catch the exception themselves, but in that case I think it
> would make more sense for catching the exception to be the primary way
> to avoid verification and we could just remove the parameter all
> together so there isn't this edge-case for avoiding verification with
> decorated methods. I guess even the static parameter that specifies
> whether or not to verify doesn't really address this problem either,
> haha. Maybe it would even make more sense for the decorator to assume
> that it shouldn't throw an exception if the ports state changing
> failed (but still avoid updating the port state) and let the verifying
> process be completely down to if the method being decorated succeeded
> or not with the ports in whatever state they were at the time since, I
> would assume, if the ports fail to update their state the method will
> also fail anyway.
>
> All-in-all however, there likely won't be many cases where the ports
> actually fail to stop in the first place, and not verifying in general
> is uncommon. If what I mentioned above makes sense and we're fine with
> the slight change in thinking, I think it is fine to merge this and
> just keep in the back of our minds that this is the case, and maybe
> either document somewhere that you have to catch the exception with
> decorated methods, or just remove the verify parameter from decorated
> methods all together and enforce that they must be verified. As
> mentioned, it's not like we are forcing ourselves to stick with it,
> adding the parameter is pretty easy to do on demand.
>
These are pretty good points. It makes sense to remove the verify
parameter and if we don't care about the result (or the result should
not be disrupting), we just catch the exception.
This patchset is not the place to settle this, so please open a bugzilla
ticket for this. In the worst case scenario we just close the ticket,
but it's good to have these thoughts in the ticket as well.
>>> I also have two other points:
>>> 1. Do we want a decorator that does both - starting and stopping? Is the
>>> idea to have all methods that require a certain state to be decorated
>>> and in that case we don't need this? E.g. if there are multiple
>>> configuration steps, only the first one stops the ports (if started) and
>>> we start the ports only when a method needs that (such as starting pkt
>>> fwd)? I think this workflow should be documented in the class docstring
>>> (the important part being that starting and stopping of ports is done
>>> automatically).
>>
>> The way I envisioned these decorators is by using a lazy approach. I
>> don't think it may be right to eagerly restart ports after stopping
>> them, because maybe we want to run another command after that will stop
>> them again. So only start and stop as needed. Ideally every port that
>> requires a specific state of the ports need to be decorated. I went
>> through all the methods in the class to check which would and which
>> wouldn't, and it seems alright like this.
>>
>>> 2. Do we want decorators that start/stop just one port? I guess this is
>>> basically useless with the above workflow.
>>
>> Would it actually matter? We are not really using the other ports in
>> parallel here I believe. May bring unnecessary complexity. I am thinking
>> that maybe if needed it could be added later.
next prev parent reply other threads:[~2024-09-09 15:16 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 12:14 [PATCH 0/4] dts: add pktgen and testpmd changes Luca Vizzarro
2024-08-06 12:14 ` [PATCH 1/5] dts: add ability to send/receive multiple packets Luca Vizzarro
2024-08-06 12:14 ` [PATCH 2/5] dts: add random generation seed setting Luca Vizzarro
2024-08-06 12:14 ` [PATCH 3/5] dts: add random packet generator Luca Vizzarro
2024-08-06 12:14 ` [PATCH 4/5] dts: add ability to start/stop ports Luca Vizzarro
2024-08-06 12:14 ` [PATCH 4/5] dts: add ability to start/stop testpmd ports Luca Vizzarro
2024-08-06 12:14 ` [PATCH 5/5] dts: add testpmd set ports queues Luca Vizzarro
2024-08-06 12:46 ` [PATCH v2 0/5] dts: add pktgen and testpmd changes Luca Vizzarro
2024-08-06 12:46 ` [PATCH v2 1/5] dts: add ability to send/receive multiple packets Luca Vizzarro
2024-08-09 15:10 ` Jeremy Spewock
2024-09-06 16:23 ` Luca Vizzarro
2024-09-09 14:12 ` Jeremy Spewock
2024-08-23 10:17 ` Juraj Linkeš
2024-09-06 16:30 ` Luca Vizzarro
2024-08-06 12:46 ` [PATCH v2 2/5] dts: add random generation seed setting Luca Vizzarro
2024-08-09 15:10 ` Jeremy Spewock
2024-08-23 10:30 ` Juraj Linkeš
2024-08-06 12:46 ` [PATCH v2 3/5] dts: add random packet generator Luca Vizzarro
2024-08-09 15:11 ` Jeremy Spewock
2024-08-23 11:58 ` Juraj Linkeš
2024-09-06 16:31 ` Luca Vizzarro
2024-08-06 12:46 ` [PATCH v2 4/5] dts: add ability to start/stop testpmd ports Luca Vizzarro
2024-08-09 15:13 ` Jeremy Spewock
2024-09-06 16:41 ` Luca Vizzarro
2024-08-23 12:16 ` Juraj Linkeš
2024-09-06 16:46 ` Luca Vizzarro
2024-09-09 7:32 ` Juraj Linkeš
2024-09-09 14:20 ` Jeremy Spewock
2024-09-09 15:16 ` Juraj Linkeš [this message]
2024-08-06 12:46 ` [PATCH v2 5/5] dts: add testpmd set ports queues Luca Vizzarro
2024-08-09 15:14 ` Jeremy Spewock
2024-08-20 16:04 ` Jeremy Spewock
2024-09-06 16:51 ` Luca Vizzarro
2024-08-23 12:22 ` Juraj Linkeš
2024-09-06 16:53 ` Luca Vizzarro
2024-09-09 11:01 ` [PATCH v3 0/5] dts: add pktgen and testpmd changes Luca Vizzarro
2024-09-09 11:01 ` [PATCH v3 1/5] dts: add ability to send/receive multiple packets Luca Vizzarro
2024-09-09 17:12 ` Patrick Robb
2024-09-09 11:01 ` [PATCH v3 2/5] dts: add random generation seed setting Luca Vizzarro
2024-09-09 11:01 ` [PATCH v3 3/5] dts: add random packet generator Luca Vizzarro
2024-09-09 11:01 ` [PATCH v3 4/5] dts: add ability to start/stop testpmd ports Luca Vizzarro
2024-09-09 11:54 ` Juraj Linkeš
2024-09-09 14:20 ` Jeremy Spewock
2024-09-09 11:01 ` [PATCH v3 5/5] dts: add testpmd set ports queues Luca Vizzarro
2024-09-09 12:01 ` Juraj Linkeš
2024-09-09 14:20 ` Jeremy Spewock
2024-09-09 15:50 ` [PATCH 0/4] dts: add pktgen and testpmd changes Juraj Linkeš
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=480e75e5-3efb-4392-b1f3-b7a59f011fd3@pantheon.tech \
--to=juraj.linkes@pantheon.tech \
--cc=Luca.Vizzarro@arm.com \
--cc=dev@dpdk.org \
--cc=honnappa.nagarahalli@arm.com \
--cc=jspewock@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).