From: Jeremy Spewock <jspewock@iol.unh.edu>
To: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
probb@iol.unh.edu, paul.szczepanek@arm.com,
Luca.Vizzarro@arm.com, npratte@iol.unh.edu, dmarx@iol.unh.edu,
alex.chapman@arm.com, dev@dpdk.org
Subject: Re: [PATCH v3 11/12] dts: add Rx offload capabilities
Date: Thu, 29 Aug 2024 11:40:36 -0400 [thread overview]
Message-ID: <CAAA20UR6XUxdbpcAUDoru2fCypX5jC+VPBydvDVurn0fUdjE5g@mail.gmail.com> (raw)
In-Reply-To: <CAAA20UQcudYj7Q7-F4a145od=EtKSa9Wy0cseLyGf45GKu+3yg@mail.gmail.com>
On Wed, Aug 28, 2024 at 1:44 PM Jeremy Spewock <jspewock@iol.unh.edu> wrote:
>
> On Wed, Aug 21, 2024 at 10:53 AM Juraj Linkeš
> <juraj.linkes@pantheon.tech> wrote:
> <snip>
> > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
> > index 48c31124d1..f83569669e 100644
> > --- a/dts/framework/remote_session/testpmd_shell.py
> > +++ b/dts/framework/remote_session/testpmd_shell.py
> > @@ -659,6 +659,103 @@ class TestPmdPortStats(TextParser):
> > tx_bps: int = field(metadata=TextParser.find_int(r"Tx-bps:\s+(\d+)"))
> >
> >
> > +class RxOffloadCapability(Flag):
> > + """Rx offload capabilities of a device."""
> > +
> > + #:
> > + RX_OFFLOAD_VLAN_STRIP = auto()
>
> One other thought that I had about this; was there a specific reason
> that you decided to prefix all of these with `RX_OFFLOAD_`? I am
> working on a test suite right now that uses both RX and TX offloads
> and thought that it would be a great use of capabilities, so I am
> working on adding a TxOffloadCapability flag as well and, since the
> output is essentially the same, it made a lot of sense to make it a
> sibling class of this one with similar parsing functionality. In what
> I was writing, I found it much easier to remove this prefix so that
> the parsing method can be the same for both RX and TX, and I didn't
> have to restate some options that are shared between both (like
> IPv4_CKSUM, UDP_CKSUM, etc.). Is there a reason you can think of why
> removing this prefix is a bad idea? Hopefully I will have a patch out
> soon that shows this extension that I've made so that you can see
> in-code what I was thinking.
I see now that you actually already answered this question, I was just
looking too much at that piece of code, and clearly not looking
further down at the helper-method mapping or the commit message that
you left :).
"The Flag members correspond to NIC
capability names so a convenience function that looks for the supported
Flags in a testpmd output is also added."
Having it prefixed with RX_OFFLOAD_ in NicCapability makes a lot of
sense since it is more explicit. Since there is a good reason to have
it like this, then the redundancy makes sense I think. There are some
ways to potentially avoid this like creating a StrFlag class that
overrides the __str__ method, or something like an additional type
that would contain a toString method, but it feels very situational
and specific to this one use-case so it probably isn't going to be
super valuable. Another thing I could think of to do would be allowing
the user to pass in a function or something to the helper-method that
mapped Flag names to their respective NicCapability name, or just
doing it in the method that gets the offloads instead of using a
helper at all, but this also just makes it more complicated and maybe
it isn't worth it.
I apologize for asking you about something that you already explained,
but maybe something we can get out of this is that, since these names
have to be consistent, it might be worth putting that in the
doc-strings of the flag for when people try to make further expansions
or changes in the future. Or it could also be generally clear that
flags used for capabilities should follow this idea, let me know what
you think.
>
> > + #: Device supports L3 checksum offload.
> > + RX_OFFLOAD_IPV4_CKSUM = auto()
> > + #: Device supports L4 checksum offload.
> > + RX_OFFLOAD_UDP_CKSUM = auto()
> > + #: Device supports L4 checksum offload.
> > + RX_OFFLOAD_TCP_CKSUM = auto()
> > + #: Device supports Large Receive Offload.
> > + RX_OFFLOAD_TCP_LRO = auto()
> > + #: Device supports QinQ (queue in queue) offload.
> > + RX_OFFLOAD_QINQ_STRIP = auto()
> > + #: Device supports inner packet L3 checksum.
> > + RX_OFFLOAD_OUTER_IPV4_CKSUM = auto()
> > + #: Device supports MACsec.
> > + RX_OFFLOAD_MACSEC_STRIP = auto()
> > + #: Device supports filtering of a VLAN Tag identifier.
> > + RX_OFFLOAD_VLAN_FILTER = 1 << 9
> > + #: Device supports VLAN offload.
> > + RX_OFFLOAD_VLAN_EXTEND = auto()
> > + #: Device supports receiving segmented mbufs.
> > + RX_OFFLOAD_SCATTER = 1 << 13
> > + #: Device supports Timestamp.
> > + RX_OFFLOAD_TIMESTAMP = auto()
> > + #: Device supports crypto processing while packet is received in NIC.
> > + RX_OFFLOAD_SECURITY = auto()
> > + #: Device supports CRC stripping.
> > + RX_OFFLOAD_KEEP_CRC = auto()
> > + #: Device supports L4 checksum offload.
> > + RX_OFFLOAD_SCTP_CKSUM = auto()
> > + #: Device supports inner packet L4 checksum.
> > + RX_OFFLOAD_OUTER_UDP_CKSUM = auto()
> > + #: Device supports RSS hashing.
> > + RX_OFFLOAD_RSS_HASH = auto()
> > + #: Device supports
> > + RX_OFFLOAD_BUFFER_SPLIT = auto()
> > + #: Device supports all checksum capabilities.
> > + RX_OFFLOAD_CHECKSUM = RX_OFFLOAD_IPV4_CKSUM | RX_OFFLOAD_UDP_CKSUM | RX_OFFLOAD_TCP_CKSUM
> > + #: Device supports all VLAN capabilities.
> > + RX_OFFLOAD_VLAN = (
> > + RX_OFFLOAD_VLAN_STRIP
> > + | RX_OFFLOAD_VLAN_FILTER
> > + | RX_OFFLOAD_VLAN_EXTEND
> > + | RX_OFFLOAD_QINQ_STRIP
> > + )
> <snip>
> >
next prev parent reply other threads:[~2024-08-29 15:40 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 15:54 [RFC PATCH v1] dts: skip test cases based on capabilities Juraj Linkeš
2024-04-11 8:48 ` [RFC PATCH v2] " Juraj Linkeš
2024-05-21 15:47 ` Luca Vizzarro
2024-05-22 14:58 ` Luca Vizzarro
2024-06-07 13:13 ` Juraj Linkeš
2024-06-11 9:51 ` Luca Vizzarro
2024-06-12 9:15 ` Juraj Linkeš
2024-06-17 15:07 ` Luca Vizzarro
2024-05-24 20:51 ` Nicholas Pratte
2024-05-31 16:44 ` Luca Vizzarro
2024-06-05 13:55 ` Patrick Robb
2024-06-06 13:36 ` Jeremy Spewock
2024-06-03 14:40 ` Nicholas Pratte
2024-06-07 13:20 ` Juraj Linkeš
2024-08-21 14:53 ` [PATCH v3 00/12] dts: add test skipping " Juraj Linkeš
2024-08-21 14:53 ` [PATCH v3 01/12] dts: fix default device error handling mode Juraj Linkeš
2024-08-26 16:42 ` Jeremy Spewock
2024-08-27 16:15 ` Dean Marx
2024-08-27 20:09 ` Nicholas Pratte
2024-08-21 14:53 ` [PATCH v3 02/12] dts: add the aenum dependency Juraj Linkeš
2024-08-26 16:42 ` Jeremy Spewock
2024-08-27 16:28 ` Dean Marx
2024-08-27 20:21 ` Nicholas Pratte
2024-08-21 14:53 ` [PATCH v3 03/12] dts: add test case decorators Juraj Linkeš
2024-08-26 16:50 ` Jeremy Spewock
2024-09-05 8:07 ` Juraj Linkeš
2024-09-05 15:24 ` Jeremy Spewock
2024-08-28 20:09 ` Dean Marx
2024-08-30 15:50 ` Nicholas Pratte
2024-08-21 14:53 ` [PATCH v3 04/12] dts: add mechanism to skip test cases or suites Juraj Linkeš
2024-08-26 16:52 ` Jeremy Spewock
2024-09-05 9:23 ` Juraj Linkeš
2024-09-05 15:26 ` Jeremy Spewock
2024-08-28 20:37 ` Dean Marx
2024-08-21 14:53 ` [PATCH v3 05/12] dts: add support for simpler topologies Juraj Linkeš
2024-08-26 16:54 ` Jeremy Spewock
2024-09-05 9:42 ` Juraj Linkeš
2024-08-28 20:56 ` Dean Marx
2024-08-21 14:53 ` [PATCH v3 06/12] dst: add basic capability support Juraj Linkeš
2024-08-26 16:56 ` Jeremy Spewock
2024-09-05 9:50 ` Juraj Linkeš
2024-09-05 15:27 ` Jeremy Spewock
2024-09-03 16:03 ` Dean Marx
2024-09-05 9:51 ` Juraj Linkeš
2024-08-21 14:53 ` [PATCH v3 07/12] dts: add testpmd port information caching Juraj Linkeš
2024-08-26 16:56 ` Jeremy Spewock
2024-09-03 16:12 ` Dean Marx
2024-08-21 14:53 ` [PATCH v3 08/12] dts: add NIC capability support Juraj Linkeš
2024-08-26 17:11 ` Jeremy Spewock
2024-09-05 11:56 ` Juraj Linkeš
2024-09-05 15:30 ` Jeremy Spewock
2024-08-27 16:36 ` Jeremy Spewock
2024-09-18 12:58 ` Juraj Linkeš
2024-09-18 16:52 ` Jeremy Spewock
2024-09-03 19:13 ` Dean Marx
2024-08-21 14:53 ` [PATCH v3 09/12] dts: add topology capability Juraj Linkeš
2024-08-26 17:13 ` Jeremy Spewock
2024-09-03 17:50 ` Dean Marx
2024-08-21 14:53 ` [PATCH v3 10/12] doc: add DTS capability doc sources Juraj Linkeš
2024-08-26 17:13 ` Jeremy Spewock
2024-09-03 17:52 ` Dean Marx
2024-08-21 14:53 ` [PATCH v3 11/12] dts: add Rx offload capabilities Juraj Linkeš
2024-08-26 17:24 ` Jeremy Spewock
2024-09-18 14:18 ` Juraj Linkeš
2024-09-18 16:53 ` Jeremy Spewock
2024-08-28 17:44 ` Jeremy Spewock
2024-08-29 15:40 ` Jeremy Spewock [this message]
2024-09-18 14:27 ` Juraj Linkeš
2024-09-18 16:57 ` Jeremy Spewock
2024-09-03 19:49 ` Dean Marx
2024-09-18 13:59 ` Juraj Linkeš
2024-08-21 14:53 ` [PATCH v3 12/12] dts: add NIC capabilities from show port info Juraj Linkeš
2024-08-26 17:24 ` Jeremy Spewock
2024-09-03 18:02 ` Dean Marx
2024-08-26 17:25 ` [PATCH v3 00/12] dts: add test skipping based on capabilities Jeremy Spewock
2024-09-23 15:02 ` [PATCH v4 01/11] dts: add the aenum dependency Juraj Linkeš
2024-09-23 15:02 ` [PATCH v4 02/11] dts: add test case decorators Juraj Linkeš
2024-09-23 19:26 ` Jeremy Spewock
2024-09-24 8:00 ` Juraj Linkeš
2024-09-27 12:36 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 03/11] dts: add mechanism to skip test cases or suites Juraj Linkeš
2024-09-23 19:26 ` Jeremy Spewock
2024-09-27 12:37 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 04/11] dts: add support for simpler topologies Juraj Linkeš
2024-09-27 12:37 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 05/11] dts: add basic capability support Juraj Linkeš
2024-09-27 12:37 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 06/11] dts: add NIC " Juraj Linkeš
2024-09-23 19:26 ` Jeremy Spewock
2024-09-24 8:02 ` Juraj Linkeš
2024-09-27 12:42 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 07/11] dts: add NIC capabilities from show rxq info Juraj Linkeš
2024-09-23 19:26 ` Jeremy Spewock
2024-09-27 13:00 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 08/11] dts: add topology capability Juraj Linkeš
2024-09-23 19:26 ` Jeremy Spewock
2024-09-27 13:04 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 09/11] doc: add DTS capability doc sources Juraj Linkeš
2024-09-27 13:04 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 10/11] dts: add Rx offload capabilities Juraj Linkeš
2024-09-23 19:26 ` Jeremy Spewock
2024-09-27 13:11 ` Luca Vizzarro
2024-09-23 15:02 ` [PATCH v4 11/11] dts: add NIC capabilities from show port info Juraj Linkeš
2024-09-27 13:12 ` Luca Vizzarro
2024-09-27 12:36 ` [PATCH v4 01/11] dts: add the aenum dependency Luca Vizzarro
2024-09-24 8:20 ` [PATCH v4 00/11] dts: add test skipping based on capabilities Juraj Linkeš
2024-09-30 13:43 ` 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=CAAA20UR6XUxdbpcAUDoru2fCypX5jC+VPBydvDVurn0fUdjE5g@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=dmarx@iol.unh.edu \
--cc=juraj.linkes@pantheon.tech \
--cc=npratte@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=thomas@monjalon.net \
/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).