From: Stephen Hemminger <stephen@networkplumber.org>
To: Scott Mitchell <scott.k.mitch1@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [RFC 2/4] test: add test for af_packet
Date: Wed, 28 Jan 2026 13:45:48 -0800 [thread overview]
Message-ID: <20260128134548.7d228aa2@phoenix.local> (raw)
In-Reply-To: <CAFn2buC-6sMuhiWRp-OmSR5HvGrhNRs+erqc=qZpWvqQ26GDPg@mail.gmail.com>
On Wed, 28 Jan 2026 12:36:41 -0800
Scott Mitchell <scott.k.mitch1@gmail.com> wrote:
> Awesome! Some suggestions below but could easily be done in a followup
> for incremental progress.
>
> > + /* TX burst */
> > + nb_tx = rte_eth_tx_burst(port_id, 0, bufs, BURST_SIZE);
> > +
> > + /* Free any unsent mbufs */
> > + for (i = nb_tx; i < BURST_SIZE; i++)
> > + rte_pktmbuf_free(bufs[i]);
> > +
> > + /* Small delay to allow stats update */
> > + rte_delay_us_block(1000);
>
> Consider polling rte_eth_stats_get at a more frequent interval, break
> when you see status update, and apply overall timeout/repeat limit ->
> can make test more reliable and take less time when data is usually
> available quickly
>
> > + /* Try to receive packets (non-blocking) */
> > + nb_rx = rte_eth_rx_burst(port_id, 0, bufs, BURST_SIZE);
> > +
> > + /* Free any received mbufs */
> > + for (i = 0; i < nb_rx; i++)
> > + rte_pktmbuf_free(bufs[i]);
> > +
> > + /* RX from tap interface without external traffic will return 0 */
> > + /* This test just verifies the RX path doesn't crash */
>
> Consider adding a test that round trips data (tx -> rx) to exercise
> the read loop.
>
> > + /* Get current MTU */
> > + ret = rte_eth_dev_get_mtu(port_id, &mtu);
> > + TEST_ASSERT(ret == 0, "Failed to get MTU");
> > +
> > + /* Try to set a smaller MTU */
> > + ret = rte_eth_dev_set_mtu(port_id, 1400);
>
> Consider getting the min/max supported MTU and setting it to verify it
> works. My patch fixed some issues related to MTU and overhead of
> frames that may have been caught by this.
>
> > +
> > + /* Reset stats */
> > + ret = rte_eth_stats_reset(port_id);
> > + TEST_ASSERT(ret == 0, "Failed to reset stats");
>
> Consider enhancing to introduce multiple threads (writer and reader)
> to replicate
>
> > +static int
> > +test_af_packet_multi_queue(void)
>
> Consider sharing rx/tx logic in common functions for single/multi-queue cases.
Wow, AI could take that feedback and revise for a new version.
next prev parent reply other threads:[~2026-01-28 21:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 17:30 [RFC 0/4] net/af_packet: cleanups and optimizations Stephen Hemminger
2026-01-28 17:30 ` [RFC 1/4] net/af_packet: remove volatile from statistics Stephen Hemminger
2026-01-28 19:57 ` Scott Mitchell
2026-01-28 21:00 ` Stephen Hemminger
2026-02-02 7:02 ` Scott Mitchell
2026-02-02 17:34 ` Stephen Hemminger
2026-02-02 19:12 ` Scott Mitchell
2026-02-02 20:12 ` Stephen Hemminger
2026-01-28 17:30 ` [RFC 2/4] test: add test for af_packet Stephen Hemminger
2026-01-28 20:36 ` Scott Mitchell
2026-01-28 21:45 ` Stephen Hemminger [this message]
2026-01-28 17:30 ` [RFC 3/4] net/af_packet: fix indentation Stephen Hemminger
2026-01-28 17:30 ` [RFC 4/4] net/af_packet: add VPP-style prefetching to receive path Stephen Hemminger
2026-01-29 1:06 ` Stephen Hemminger
2026-01-29 9:00 ` Morten Brørup
2026-02-02 7:09 ` Scott Mitchell
2026-02-02 18:43 ` Stephen Hemminger
2026-02-03 7:31 ` Morten Brørup
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=20260128134548.7d228aa2@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=scott.k.mitch1@gmail.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