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] examples/packet_ordering: fix segfault in disable_reorder mode
Date: Mon, 11 Dec 2023 10:51:55 +0000	[thread overview]
Message-ID: <MW2PR18MB228208B61B043F99D107E4BAA88FA@MW2PR18MB2282.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20231208124231.198138-1-qi_an_hao@126.com>

> -----Original Message-----
> From: Qian Hao <qi_an_hao@126.com>
> Sent: Friday, December 8, 2023 1:43 PM
> To: dev@dpdk.org
> Cc: Volodymyr Fialko <vfialko@marvell.com>
> Subject: [EXT] [PATCH] examples/packet_ordering: fix segfault in disable_reorder mode
<snip>

Good catch overall, but few comments:

1. Please fix checkpatch coding style issues:
http://patchwork.dpdk.org/project/dpdk/patch/20231208124231.198138-1-qi_an_hao@126.com/
Check dpdk contributing guide to see how to run it locally:
https://doc.dpdk.org/guides/contributing/patches.html#checking-the-patches

2. This patch will add if check per burst of packets (even so it will be easy to
branch predict for CPU since this flag does not changes), I still think it would
be better to check this condition only once before starting the rx_thread and
let compiler inline the rest. So something like this:

    // mark rx_thread inline with explicit parameter
    static __rte_always_inline int
    rx_thread(struct rte_ring *ring_out, bool disable_reorder)

    // create two separate functions with baked flag
    static __rte_noinline int
    rx_thread_reorder(struct rte_ring *ring_out)
    {
         return rx_thread(ring_out, false);
    }
    static __rte_noinline int
    rx_thread_reorder_disabled(struct rte_ring *ring_out)
    {
        return rx_thread(ring_out, true);
    }

    // dispatch only once in main
    /* Start rx_thread() on the main core */
    if (disable_reorder)
        rx_thread_reorder_disabled(rx_to_workers);
    else
        rx_thread_reorder(rx_to_workers);

/Volodymyr


  reply	other threads:[~2023-12-11 10:52 UTC|newest]

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