DPDK patches and discussions
 help / color / mirror / Atom feed
From: Volodymyr Fialko <vfialko@marvell.com>
To: Qian Hao <qi_an_hao@126.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [EXT] [PATCH v3] examples/packet_ordering: fix segfault in disable_reorder mode
Date: Mon, 18 Dec 2023 10:59:53 +0000	[thread overview]
Message-ID: <MW2PR18MB22823E4A3D210B5A76F9AE2EA890A@MW2PR18MB2282.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20231213110718.18859-1-qi_an_hao@126.com>

> -----Original Message-----
> From: Qian Hao <qi_an_hao@126.com>
> Sent: Wednesday, December 13, 2023 12:07 PM
> To: dev@dpdk.org
> Cc: Volodymyr Fialko <vfialko@marvell.com>
> Subject: [EXT] [PATCH v3] examples/packet_ordering: fix segfault in disable_reorder mode
> 
> External Email
> 
> ----------------------------------------------------------------------
> The packet_ordering example works in two modes (opt via --disable-reorder):
>   - When reorder is enabled: rx_thread - N*worker_thread - send_thread
>   - When reorder is disabled: rx_thread - N*worker_thread - tx_thread N parallel worker_thread(s)
> generate out-of-order packets.
> 
> When reorder is enabled, send_thread uses sequence number generated in rx_thread (L459) to
> enforce packet ordering. Otherwise rx_thread just sends any packet it receives.
> 
> rx_thread writes sequence number into a dynamic field, which is only registered by calling
> rte_reorder_create() (Line 741) when reorder is enabled. However, rx_thread marks sequence
> number onto each packet no matter whether reorder is enabled, overwriting the leading bytes in
> packet mbufs when reorder is disabled, resulting in segfaults when PMD tries to DMA packets.
> 
> `if (!disable_reorder_flag) {...}` is added in rx_thread to fix the bug.
> The test is inlined by the compiler to prevent any performance loss.
> 
> Signed-off-by: Qian Hao <qi_an_hao@126.com>
> ---
>  examples/packet_ordering/main.c | 32 +++++++++++++++++++++++++-------
>  1 file changed, 25 insertions(+), 7 deletions(-)
> 

Acked-by: Volodymyr Fialko <vfialko@marvell.com> 

/Volodymyr

  reply	other threads:[~2023-12-18 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 12:42 [PATCH] " Qian Hao
2023-12-11 10:51 ` [EXT] " Volodymyr Fialko
2023-12-13 10:49 ` [PATCH v2] " Qian Hao
2023-12-13 11:07   ` [PATCH v3] " Qian Hao
2023-12-18 10:59     ` Volodymyr Fialko [this message]
2024-03-07  8:22       ` [EXT] " Thomas Monjalon

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=MW2PR18MB22823E4A3D210B5A76F9AE2EA890A@MW2PR18MB2282.namprd18.prod.outlook.com \
    --to=vfialko@marvell.com \
    --cc=dev@dpdk.org \
    --cc=qi_an_hao@126.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).