From: Bruce Richardson <bruce.richardson@intel.com>
To: Harry van Haaren <harry.van.haaren@intel.com>
Cc: <dev@dpdk.org>, <bruce-richardson@intel.com>
Subject: Re: [PATCH v2 1/2] event/sw: fix ordering corruption with op release
Date: Thu, 14 Sep 2023 12:12:53 +0100 [thread overview]
Message-ID: <ZQLqtUNaZtdocbuB@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20230914105852.82471-1-harry.van.haaren@intel.com>
On Thu, Sep 14, 2023 at 11:58:51AM +0100, Harry van Haaren wrote:
> This commit changes the logic in the scheduler to always
> reset reorder-buffer (and QID/FID) entries when writing
> them. This avoids stale ROB/QID/FID data re-use, which
> previously caused ordering issues.
>
> Before this commit, release events left the history-list
> in an inconsistent state, and future events with op type of
> forward could be incorrectly reordered.
>
> Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Couple of very minor style comments below.
> ---
>
> v2:
> - Rework fix to simpler suggestion (Bruce)
> - Respin patchset to "apply order" (Bruce)
>
> ---
> drivers/event/sw/sw_evdev_scheduler.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c
> index de6ed21643..21c360770e 100644
> --- a/drivers/event/sw/sw_evdev_scheduler.c
> +++ b/drivers/event/sw/sw_evdev_scheduler.c
> @@ -90,8 +90,10 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
> sw->cq_ring_space[cq]--;
>
> int head = (p->hist_head++ & (SW_PORT_HIST_LIST-1));
> - p->hist_list[head].fid = flow_id;
> - p->hist_list[head].qid = qid_id;
> + p->hist_list[head] = (struct sw_hist_list_entry) {
> + .qid = qid_id,
> + .fid = flow_id,
> + };
>
> p->stats.tx_pkts++;
> qid->stats.tx_pkts++;
> @@ -162,8 +164,13 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
> qid->stats.tx_pkts++;
>
> const int head = (p->hist_head & (SW_PORT_HIST_LIST-1));
> - p->hist_list[head].fid = SW_HASH_FLOWID(qe->flow_id);
> - p->hist_list[head].qid = qid_id;
> + const uint32_t fid = SW_HASH_FLOWID(qe->flow_id);
> + p->hist_list[head] = (struct sw_hist_list_entry) {
> + .qid = qid_id,
> + .fid = fid,
> + };
> +
> +
You're adding some extra whitespace here. Can probably be fixed on apply.
And one final minor nit: if doing a new version, you can remove the
temporary variable for "fid". In my suggestion I only added it because I
had the assignment done on a single line and didn't want to wrap. Since
you've split the temporary struct across multiple lines, the temporary
variable isn't needed as the SW_HASH_FLOWID will fit on the assignment
line.
next prev parent reply other threads:[~2023-09-14 11:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 16:47 [PATCH 1/2] event/sw: add selftest for ordered history list Harry van Haaren
2023-08-31 16:47 ` [PATCH 2/2] event/sw: fix ordering corruption with op release Harry van Haaren
2023-09-04 16:37 ` Bruce Richardson
2023-09-08 16:22 ` Van Haaren, Harry
2023-09-14 10:58 ` [PATCH v2 1/2] " Harry van Haaren
2023-09-14 10:58 ` [PATCH v2 2/2] event/sw: add selftest for ordered history list Harry van Haaren
2023-09-14 11:13 ` Bruce Richardson
2023-10-02 10:58 ` [PATCH v3 1/2] event/sw: fix ordering corruption with op release Harry van Haaren
2023-10-02 10:58 ` [PATCH v3 2/2] event/sw: add selftest for ordered history list Harry van Haaren
2023-10-03 6:38 ` [PATCH v3 1/2] event/sw: fix ordering corruption with op release Jerin Jacob
2023-09-14 11:12 ` Bruce Richardson [this message]
2023-08-31 17:10 ` [PATCH 1/2] event/sw: add selftest for ordered history list Bruce Richardson
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=ZQLqtUNaZtdocbuB@bricha3-MOBL.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=bruce-richardson@intel.com \
--cc=dev@dpdk.org \
--cc=harry.van.haaren@intel.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).