From: huangdengdui <huangdengdui@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <konstantin.ananyev@huawei.com>,
<wathsala.vithanage@arm.com>, <lihuisong@huawei.com>,
<fengchengwen@huawei.com>, <haijie1@huawei.com>,
<liuyonglong@huawei.com>
Subject: Re: [PATCH] examples/l3fwd: add option to set refetch offset
Date: Tue, 14 Jan 2025 17:22:08 +0800 [thread overview]
Message-ID: <59587382-d90d-4141-936a-6af5fed5c859@huawei.com> (raw)
In-Reply-To: <20250110092036.23a762dd@hermes.local>
On 2025/1/11 1:20, Stephen Hemminger wrote:
> This will make it slower for many platforms.
> GCC will unroll a loop of fixed small size, which is what we want.
Do you mean to replace option with a macro?
But most of prefetch_offset are used with the nb_rx, So using macros is the same as using options.
const int32_t k = RTE_ALIGN_FLOOR(nb_rx, FWDSTEP);
for (j = 0; j != k; j += FWDSTEP) {
for (i = 0, pos = j + prefetch_offset;
i < FWDSTEP && pos < k; i++, pos++)
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[pos], void *));
processx4_step1(&pkts_burst[j], &dip, &ipv4_flag);
processx4_step2(qconf, dip, ipv4_flag, portid,
&pkts_burst[j], &dst_port[j]);
if (do_step3)
processx4_step3(&pkts_burst[j], &dst_port[j]);
}
The option can dynamically adjust the prefetch window, which makes it easier to find the prefetch window for a HW platform.
So I think it's better to use option.
next prev parent reply other threads:[~2025-01-14 9:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-25 7:53 [PATCH] examples/l3fwd: optimize packet prefetch Dengdui Huang
2024-12-25 21:21 ` Stephen Hemminger
2025-01-08 13:42 ` Konstantin Ananyev
2025-01-09 11:31 ` huangdengdui
2025-01-10 9:37 ` [PATCH] examples/l3fwd: add option to set refetch offset Dengdui Huang
2025-01-10 17:19 ` Stephen Hemminger
2025-01-14 9:23 ` huangdengdui
2025-01-10 17:20 ` Stephen Hemminger
2025-01-14 9:22 ` huangdengdui [this message]
2025-01-14 16:07 ` Stephen Hemminger
2025-01-14 16:11 ` Stephen Hemminger
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=59587382-d90d-4141-936a-6af5fed5c859@huawei.com \
--to=huangdengdui@huawei.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=haijie1@huawei.com \
--cc=konstantin.ananyev@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=stephen@networkplumber.org \
--cc=wathsala.vithanage@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).