patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Ye, MingjinX" <mingjinx.ye@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yang, Qiming" <qiming.yang@intel.com>,
	"Ye, MingjinX" <mingjinx.ye@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>
Subject: RE: [PATCH v6 1/2] net/iavf: fix Rx/Tx burst in multi-process
Date: Sun, 31 Dec 2023 06:41:42 +0000	[thread overview]
Message-ID: <DM4PR11MB5994A361B0FB7446ACEEB2DDD763A@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20231229101104.2167028-2-mingjinx.ye@intel.com>



> -----Original Message-----
> From: Mingjin Ye <mingjinx.ye@intel.com>
> Sent: Friday, December 29, 2023 6:11 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Ye, MingjinX
> <mingjinx.ye@intel.com>; stable@dpdk.org; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH v6 1/2] net/iavf: fix Rx/Tx burst in multi-process
>
> In a multi-process environment, a secondary process operates on shared
> memory and changes the function pointer of the primary process, resulting
> in a crash when the primary process cannot find the function address during
> an Rx/Tx burst.
>
> Fixes: 5b3124a0a6ef ("net/iavf: support no polling when link down")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> ---
> v2: Add fix for Rx burst.
> ---
>  drivers/net/iavf/iavf.h      |  42 +++++++-
>  drivers/net/iavf/iavf_rxtx.c | 184 ++++++++++++++++++++++++++++++-----
>  drivers/net/iavf/iavf_rxtx.h |   8 ++
>  3 files changed, 205 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> 10868f2c30..8db9f3d7cd 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -313,6 +313,44 @@ struct iavf_devargs {
>
>  struct iavf_security_ctx;
>
> +enum iavf_rx_burst_type {
> +     IAVF_RX_BURST_DEFAULT,
> +     IAVF_RX_BURST_FRXD,
> +     IAVF_RX_BURST_BULK_ALLOC,
> +     IAVF_RX_BURST_SCATTERED,
> +     IAVF_RX_BURST_SFRXD,
> +     IAVF_RX_BURST_VEC_SSE,
> +     IAVF_RX_BURST_VEC_AVX2,
> +     IAVF_RX_BURST_VEC_AVX2_OFFLOAD,
> +     IAVF_RX_BURST_VEC_SSE_FRXD,
> +     IAVF_RX_BURST_VEC_AVX2_FRXD,
> +     IAVF_RX_BURST_VEC_AVX2_FRXD_OFFLOAD,
> +     IAVF_RX_BURST_VEC_SSE_SCATTERED,
> +     IAVF_RX_BURST_VEC_AVX2_SCATTERED,
> +     IAVF_RX_BURST_VEC_AVX2_SCATTERED_OFFLOAD,
> +     IAVF_RX_BURST_VEC_SSE_SFLEX_RXD,
> +     IAVF_RX_BURST_VEC_AVX2_SFLEX_RXD,
> +     IAVF_RX_BURST_VEC_AVX2_SFRXD_OFFLOAD,
> +     IAVF_RX_BURST_VEC_AVX512,
> +     IAVF_RX_BURST_VEC_AVX512_OFFLOAD,
> +     IAVF_RX_BURST_VEC_AVX512_FRXD,
> +     IAVF_RX_BURST_VEC_AVX512_FRXD_OFFLOAD,
> +     IAVF_RX_BURST_VEC_AVX512_SCATTERED,
> +     IAVF_RX_BURST_VEC_AVX512_SCATTERED_OFFLOAD,
> +     IAVF_RX_BURST_VEC_AVX512_SFLEX_RXD,
> +     IAVF_RX_BURST_VEC_AVX512_SFRXD_OFFLOAD,

What is SFLEX, SFRXD, SFRXD, FRXD, please make it clear by following a consistent naming pattern.
Btw, you can consider removing BURST and VEC which didn't give any additional information if you are looking for a short name.

....

> @@ -3809,42 +3886,64 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
>                       }
>                       if (use_flex) {
>                               dev->rx_pkt_burst =
> iavf_recv_scattered_pkts_vec_flex_rxd;
> +                             rx_burst_type =
> IAVF_RX_BURST_VEC_SSE_SFLEX_RXD;
>                               if (use_avx2) {
> -                                     if (check_ret == IAVF_VECTOR_PATH)
> +                                     if (check_ret == IAVF_VECTOR_PATH)
> {
>                                               dev->rx_pkt_burst =
>
>       iavf_recv_scattered_pkts_vec_avx2_flex_rxd;
> -                                     else
> +                                             rx_burst_type =
> +
>       IAVF_RX_BURST_VEC_AVX2_SFLEX_RXD;

As you already introduce the burst_type, its not necessary to set the function pointer for each case.
Why not just
dev->rx_pkt_burst = rx_burst_ops[rx_burst_type] at last?

....

> +struct iavf_rx_burst_ops {
> +     eth_rx_burst_t rx_pkt_burst;
> +};

Why create a wrapper here but not just use eth_rx_burst_t directly?



  reply	other threads:[~2023-12-31  6:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231227101655.799560-1-mingjinx.ye@intel.com>
     [not found] ` <20231228102611.921850-1-mingjinx.ye@intel.com>
2023-12-28 10:26   ` [PATCH v5 1/2] net/iavf: fix Tx path error " Mingjin Ye
2023-12-28 10:50     ` Zhang, Qi Z
     [not found]     ` <20231229101104.2167028-1-mingjinx.ye@intel.com>
2023-12-29 10:11       ` [PATCH v6 1/2] net/iavf: fix Rx/Tx burst " Mingjin Ye
2023-12-31  6:41         ` Zhang, Qi Z [this message]
     [not found]         ` <20240102105211.788819-1-mingjinx.ye@intel.com>
2024-01-02 10:52           ` [PATCH v7 " Mingjin Ye
2024-01-03  2:22             ` Zhang, Qi Z

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=DM4PR11MB5994A361B0FB7446ACEEB2DDD763A@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=mingjinx.ye@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    /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).