DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicholas Pratte <npratte@iol.unh.edu>
To: Patrick Robb <probb@iol.unh.edu>
Cc: yoan.picchi@foss.arm.com, paul.szczepanek@arm.com,
	 Honnappa.Nagarahalli@arm.com, thomas@monjalon.net,
	luca.vizzarro@arm.com,  thomas.wilks@arm.com, dmarx@iol.unh.edu,
	stephen@networkplumber.org,  dev@dpdk.org
Subject: Re: [RFC Patch v1 2/5] dts: rework traffic generator inheritance structure.
Date: Fri, 16 May 2025 15:12:46 -0400	[thread overview]
Message-ID: <CAKXZ7ehup4XA1T99BjBsKX1a30oBgT1pkg92P-tP8E_RZneQbQ@mail.gmail.com> (raw)
In-Reply-To: <CAJvnSUDs7To7F7TBH+CPn39TwFK-hu3+jzm_DMcEKxtDPqvYyg@mail.gmail.com>

Hi Patick, see below!

>> +
>> +from framework.testbed_model.traffic_generator.traffic_generator import TrafficGenerator
>
>
> I think this can become:
>
> from .traffic_generator import TrafficGenerator

Ack.
>
>>
>> +
>> +
>> +@dataclass(slots=True)
>> +class PerformanceTrafficStats(ABC):
>> +    """Data structure for stats offered by a given traffic generator."""
>> +
>> +    frame_size: int
>
>
> Do we need to add an optional number of packet descriptors attribute? I realize that is a SUT testpmd param, not a TREX param, but presumably when we gather stats, we want to store the descriptor count with it.'

It could be done by passing another parameter when the function is
called. Maybe adding these parameters is helpful, maybe it isn't. It
might just be easier to strip the frame size and descriptors away
entirely from the statistics data structure, under the assumption that
these fields would be managed in the test suites themselves. I think
either/or would be fine.


>
>>
>> +
>> +
>> +class PerformanceTrafficGenerator(TrafficGenerator):
>> +    """An Abstract Base Class for all performance-oriented traffic generators.
>> +
>> +    Provides an intermediary interface for performance-based traffic generator.
>> +    """
>> +
>> +    _test_stats: list[PerformanceTrafficStats]
>> +
>> +    @property
>> +    def is_capturing(self) -> bool:
>> +        """Used for synchronization."""
>> +        return False
>> +
>> +    @property
>> +    def last_results(self) -> PerformanceTrafficStats | None:
>> +        """Get the latest set of results from TG instance.
>> +
>> +        Returns:
>> +            The most recent set of traffic statistics.
>> +        """
>> +        return self._test_stats.pop(0)
>> +
>> +    def generate_traffic_and_stats(
>> +        self,
>> +        packet: Packet,
>> +        duration: float,  # Default of 60 (in seconds).
>
>
> Should it be float = 60, so the default is coming from the function, and not a "default" which is coming from the testsuite? If not, I guess the "default" comment belongs in the testsuite?

I would say the comment can be removed. Right now, as you mentioned,
it is set up so that the default value is asserted at the test suite
level. It might just make sense to do away with this default value and
just insist the user explicitly provide a duration. That would make
sense in its own right.

  reply	other threads:[~2025-05-16 19:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 19:40 [RFC Patch v1 0/5] Add TREX Traffic Generator to DTS Framework Nicholas Pratte
2025-04-23 19:40 ` [RFC Patch v1 1/5] dts: rework config module to support perf TGs Nicholas Pratte
2025-04-23 19:40 ` [RFC Patch v1 2/5] dts: rework traffic generator inheritance structure Nicholas Pratte
2025-05-15 19:24   ` Patrick Robb
2025-05-16 19:12     ` Nicholas Pratte [this message]
2025-04-23 19:40 ` [RFC Patch v1 3/5] dts: add asychronous support to ssh sessions Nicholas Pratte
2025-05-15 19:24   ` Patrick Robb
2025-04-23 19:40 ` [RFC Patch v1 4/5] dts: add trex traffic generator to dts framework Nicholas Pratte
2025-05-15 19:25   ` Patrick Robb
2025-05-16 19:45     ` Nicholas Pratte
2025-04-23 19:40 ` [RFC Patch v1 5/5] dts: add performance test functions to test suite api Nicholas Pratte
2025-05-15 19:25   ` Patrick Robb
2025-05-16 20:18 ` [RFC v2 0/6] Add TREX Traffic Generator to DTS Framework Nicholas Pratte
2025-05-16 20:18   ` [RFC v2 1/6] dts: rework config module to support perf TGs Nicholas Pratte
2025-05-16 20:18   ` [RFC v2 2/6] dts: rework traffic generator inheritance structure Nicholas Pratte
2025-05-16 20:18   ` [RFC v2 3/6] dts: add asynchronous support to ssh sessions Nicholas Pratte
2025-05-16 20:18   ` [RFC v2 4/6] dts: add extended timeout option to interactive shells Nicholas Pratte
2025-05-16 20:18   ` [RFC v2 5/6] dts: add trex traffic generator to dts framework Nicholas Pratte
2025-05-16 20:18   ` [RFC v2 6/6] dts: add performance test functions to test suite api Nicholas Pratte

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=CAKXZ7ehup4XA1T99BjBsKX1a30oBgT1pkg92P-tP8E_RZneQbQ@mail.gmail.com \
    --to=npratte@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=stephen@networkplumber.org \
    --cc=thomas.wilks@arm.com \
    --cc=thomas@monjalon.net \
    --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).