From: Jeremy Spewock <jspewock@iol.unh.edu>
To: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Cc: Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com,
paul.szczepanek@arm.com, alex.chapman@arm.com,
probb@iol.unh.edu, wathsala.vithanage@arm.com,
thomas@monjalon.net, yoan.picchi@foss.arm.com,
npratte@iol.unh.edu, dev@dpdk.org
Subject: Re: [PATCH v6 1/1] dts: add text parser for testpmd verbose output
Date: Thu, 26 Sep 2024 10:43:02 -0400 [thread overview]
Message-ID: <CAAA20UToYMz0gSa3e=OErV2ANWRObsB+n03-=E1Zvpo5CUbfeA@mail.gmail.com> (raw)
In-Reply-To: <e9559f6e-acbd-4d16-81b0-20dc5fe98d72@pantheon.tech>
On Thu, Sep 26, 2024 at 4:25 AM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
>
> > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
>
> > @@ -581,6 +581,506 @@ class TestPmdPortStats(TextParser):
> > tx_bps: int = field(metadata=TextParser.find_int(r"Tx-bps:\s+(\d+)"))
> >
> >
> > +class PacketOffloadFlag(Flag):
>
> > + #: RX IEEE1588 L2 Ethernet PT Packet.
> > + RTE_MBUF_F_RX_IEEE1588_PTP = 1 << 9
> > + #: RX IEEE1588 L2/L4 timestamped packet.
> > + RTE_MBUF_F_RX_IEEE1588_TMST = 1 << 10
>
> There are a few instances with two or three consecutive bits set
> expliticly instead with auto(). I don't know if it's better to use
> auto() or the explitic value, just wanted to point it out.
>
If it was only two consecutive bits I avoided using auto because I
thought that made it more clear (at least for me, it felt like less
bouncing back and forth). This is a good point though, I also don't
know which is really better.
>
> > +
> > + #: FD id reported if FDIR match.
> > + RTE_MBUF_F_RX_FDIR_ID = 1 << 13
> > + #: Flexible bytes reported if FDIR match.
> > + RTE_MBUF_F_RX_FDIR_FLX = 1 << 14
> > + @classmethod
> > + def from_str(cls, flags: str) -> Self:
>
> Now that we're doing the same thing as the other classes, I think it
> makes sense to just flat out copy-paste the from_list_string method.
Sure, that makes sense to me.
>
> > + """Makes an instance from a string containing whitespace-separated the flag members.
> > +
> > + Args:
> > + arr: A string containing ol_flag values.
> > +
> > + Returns:
> > + A new instance of the flag.
> > + """
> > + flag = cls(0)
> > + for name in flags.split():
> > + if hasattr(cls, name):
>
> This is still different from the other class. I think making these
> exactly the same would make it clear what needs to be put into the base
> class if we ever create one.
Ack.
>
> > + flag |= cls[name]
> > + return flag
>
> > +
> > +class RtePTypes(Flag):
> > + """Flag representing possible packet types in DPDK verbose output.
> > +
> > + Values in this class are derived from definitions in the RTE MBUF ptype library in DPDK located
> > + in lib/mbuf/rte_mbuf_ptype.h. Specifically, the names of values in this class should match the
> > + possible return options from the methods rte_get_ptype_*_name in rte_mbuf_ptype.c.
>
> I think these are functions (rte_get_ptype_*_name), not methods.
>
Ahh, good call. I wasn't thinking of the distinction when I wrote it.
> > + """
>
> You didn't update the docstring here (double backticks (for file and
> function names) and the References: section).
Good catch, I'll fix those as well.
>
>
> > + @classmethod
> > + def from_str(cls, flags: str) -> Self:
>
> The same comments apply here.
Ack.
>
>
next prev parent reply other threads:[~2024-09-26 14:43 UTC|newest]
Thread overview: 39+ 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š
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 [this message]
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
2024-09-30 13:41 ` 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='CAAA20UToYMz0gSa3e=OErV2ANWRObsB+n03-=E1Zvpo5CUbfeA@mail.gmail.com' \
--to=jspewock@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=Luca.Vizzarro@arm.com \
--cc=alex.chapman@arm.com \
--cc=dev@dpdk.org \
--cc=juraj.linkes@pantheon.tech \
--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).