> -----Original Message-----
> From: Qian Hao <qi_an_...@126.com>
> Sent: Friday, December 8, 2023 1:43 PM
> To: dev@dpdk.org
> Cc: Volodymyr Fialko <vfia...@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_...@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 via email to