DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: Jeremy Spewock <jspewock@iol.unh.edu>
Cc: alex.chapman@arm.com, paul.szczepanek@arm.com,
	Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com,
	wathsala.vithanage@arm.com, probb@iol.unh.edu,
	npratte@iol.unh.edu, thomas@monjalon.net,
	yoan.picchi@foss.arm.com, dev@dpdk.org
Subject: Re: [PATCH v5 1/1] dts: add text parser for testpmd verbose output
Date: Mon, 23 Sep 2024 15:30:13 +0200	[thread overview]
Message-ID: <a184d14a-9ea0-488c-8940-6e982c6f16f2@pantheon.tech> (raw)
In-Reply-To: <CAAA20USv+nhkG60G9xvdrrB+m7PHvpcNhRvBL5neC1Zzwsn+Hg@mail.gmail.com>


>>
>> The question is when the exception would be raised, or, in other words,
>> what should we do when hasattr(cls, name) is False. If I understand this
>> correctly, is it's False, then name is not among the flags and that
>> means testpmd returned an unsupported flag, which shouldn't happen, but
>> if it does in the future, we would be better off throwing an exception,
>> or at very least, log a warning, so that we have an indication that we
>> need to add support for a new flag.
> 
> This is a good point. Realistically if it is ever false that would
> mean we have a gap in implementation. I like the idea of flagging a
> loud warning over throwing an exception in this case though since if
> we threw an exception that would stop all test cases that use OL flags
> to stop working even if they don't require the new flag. That would
> definitely get the problem fixed sooner, but would also shutdown
> automated testing until it then.
> 

It's a tradeoff between risking CI being affected (if a new flag is 
added without also adding it to DTS) and how noticable the warning is. I 
guess we can implement something in CI that will look for warnings like 
these?

>>
>>> +                flag |= cls[name]
>>> +        return flag
>>> +
>>> +    @classmethod
>>> +    def make_parser(cls) -> ParserFn:
>>> +        """Makes a parser function.
>>> +
>>> +        Returns:
>>> +            ParserFn: A dictionary for the `dataclasses.field` metadata argument containing a
>>> +                parser function that makes an instance of this flag from text.
>>> +        """
>>> +        return TextParser.wrap(
>>> +            TextParser.wrap(TextParser.find(r"ol_flags: ([^\n]+)"), str.split),
>>> +            cls.from_str_list,
>>> +        )
>>
>> The RSSOffloadTypesFlag does the split in its from_list_string method.
>> Do we want to do the same here?
>>
>> Maybe could create a ParsableFlag (or Creatable? Or something else)
>> superclass that would implement these from_* methods (from_list_string,
>> from_str) and subclass it. Flags should be subclassable if they don't
>> contain members.
>>
>> The superclass would be useful so that we don't redefine the same method
>> over and over and so that it's clear what's already available.
> 
> I like this idea a lot. Basically all of these flags that are used in
> parsers are going to need something like that which is going to be
> basically the same so just implementing it one time would be great.
> I'm not sure if it fits the scope of this series though, do you think
> I should write it and add it here or in a separate patch?
> 

A separate patch seems better, as it touches different parts of the 
code. We should probably implement the same logic in this patch (without 
the exception or warning and with the same if condition) and then make 
changes in the other patch.

>>
>>
>>> @@ -656,6 +1147,9 @@ def stop(self, verify: bool = True) -> None:
>>>            Raises:
>>>                InteractiveCommandExecutionError: If `verify` is :data:`True` and the command to stop
>>>                    forwarding results in an error.
>>> +
>>> +        Returns:
>>> +            Output gathered from sending the stop command.
>>
>> This not just from sending the stop command, but everything else that
>> preceded (when collecting the verbose output), right?
> 
> Technically yes, but that's just due to the nature of how interactive
> shells aren't perfect when it comes to asynchronous output. That's why
> I tried to be sneaky and say that it is the "output gathered from
> sending the stop command" trying to imply that it is not just the
> output of the `stop` command, but all the output that is gathered from
> sending it. I can update this though.
> 
>>
>>
>>> diff --git a/dts/framework/utils.py b/dts/framework/utils.py
>>
>>> @@ -27,6 +27,12 @@
>>>    from .exception import ConfigurationError
>>>
>>>    REGEX_FOR_PCI_ADDRESS: str = "/[0-9a-fA-F]{4}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}.[0-9]{1}/"
>>> +_REGEX_FOR_COLON_SEP_MAC: str = r"(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}"
>>> +_REGEX_FOR_HYPHEN_SEP_MAC: str = r"(?:[\da-fA-F]{2}-){5,7}[\da-fA-F]{2}"
>>
>> {5,7} should be just 5 repetitions. When could it be more?
> 
> I added it for EUI-64 addresses, but maybe this isn't very relevant
> here since I just read that they are encouraged on non-ethernet
> devices. I can remove it if it doesn't seem worth it to capture.
> 

 From what I gather the EUI-64 address is composed from MAC addresses, 
but it's a different identifier. I'd say if we ever need it we can add 
it as a separate regex (and look for both if we need to).

  reply	other threads:[~2024-09-23 13:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 20:39 [PATCH v1 0/1] dts: testpmd verbose parser jspewock
2024-07-29 20:39 ` [PATCH v1 1/1] dts: add text parser for testpmd verbose output jspewock
2024-07-30 13:34 ` [PATCH v2 0/1] dts: testpmd verbose parser jspewock
2024-07-30 13:34   ` [PATCH v2 1/1] dts: add text parser for testpmd verbose output jspewock
2024-07-30 15:41     ` Nicholas Pratte
2024-07-30 21:30       ` Jeremy Spewock
2024-08-02 14:54         ` Nicholas Pratte
2024-08-02 17:38           ` Jeremy Spewock
2024-08-05 13:20             ` Nicholas Pratte
2024-07-30 21:33     ` Jeremy Spewock
2024-08-01  8:43       ` Luca Vizzarro
2024-08-02 13:40         ` Jeremy Spewock
2024-08-01  8:41     ` Luca Vizzarro
2024-08-02 13:35       ` Jeremy Spewock
2024-08-08 20:36 ` [PATCH v3 0/1] dts: testpmd verbose parser jspewock
2024-08-08 20:36   ` [PATCH v3 1/1] dts: add text parser for testpmd verbose output jspewock
2024-08-08 21:49     ` Jeremy Spewock
2024-08-12 17:32       ` Nicholas Pratte
2024-09-09 11:44     ` Juraj Linkeš
2024-09-17 13:40       ` Jeremy Spewock
2024-09-18  8:09         ` Juraj Linkeš
2024-09-18 16:34 ` [PATCH v4 0/1] dts: testpmd verbose parser jspewock
2024-09-18 16:34   ` [PATCH v4 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-18 17:05 ` [PATCH v5 0/1] dts: testpmd verbose parser jspewock
2024-09-18 17:05   ` [PATCH v5 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-19  9:02     ` Juraj Linkeš
2024-09-20 15:53       ` Jeremy Spewock
2024-09-23 13:30         ` Juraj Linkeš [this message]
2024-09-19 12:35     ` Juraj Linkeš
2024-09-20 15:55       ` Jeremy Spewock
2024-09-25 15:46 ` [PATCH v6 0/1] dts: testpmd verbose parser jspewock
2024-09-25 15:46   ` [PATCH v6 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-26  8:25     ` Juraj Linkeš
2024-09-26 14:43       ` Jeremy Spewock
2024-09-26 15:47 ` [PATCH v7 0/1] dts: testpmd verbose parser jspewock
2024-09-26 15:47   ` [PATCH v7 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-27  9:32     ` Juraj Linkeš
2024-09-27 11:48     ` Luca Vizzarro

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=a184d14a-9ea0-488c-8940-6e982c6f16f2@pantheon.tech \
    --to=juraj.linkes@pantheon.tech \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --cc=yoan.picchi@foss.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).