DPDK patches and discussions
 help / color / mirror / Atom feed
From: zhoumin <zhoumin@loongson.cn>
To: qiming.yang@intel.com, wenjun1.wu@intel.com
Cc: dev@dpdk.org, maobibo@loongson.cn
Subject: Re: [PATCH 1/1] net/ixgbe: add a proper memory barrier for LoongArch
Date: Fri, 21 Apr 2023 09:12:37 +0800	[thread overview]
Message-ID: <1cfdd578-774d-f9e8-da23-4b7c29a370c5@loongson.cn> (raw)
In-Reply-To: <20230407085041.3966259-1-zhoumin@loongson.cn>

On Fri, Apr 7, 2023 at 4:50PM, Min Zhou wrote:
> Segmentation fault has been observed while running the
> ixgbe_recv_pkts_lro() function to receive packets on the Loongson
> 3C5000 processor which has 64 cores and 4 NUMA nodes.
>
> Reason is the read ordering of the status and the rest of the
> descriptor fields in this function may not be correct on the
> LoongArch processor. We should add rte_rmb() to ensure the read
> ordering be correct.
>
> We also did the same thing in the ixgbe_recv_pkts() function.
>
> Signed-off-by: Min Zhou <zhoumin@loongson.cn>
> ---
>   drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index c9d6ca9efe..16391a42f9 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -1823,6 +1823,9 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>   		staterr = rxdp->wb.upper.status_error;
>   		if (!(staterr & rte_cpu_to_le_32(IXGBE_RXDADV_STAT_DD)))
>   			break;
> +#if defined(RTE_ARCH_LOONGARCH)
> +		rte_rmb();
> +#endif
>   		rxd = *rxdp;
>   
>   		/*
> @@ -2122,6 +2125,9 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
>   		if (!(staterr & IXGBE_RXDADV_STAT_DD))
>   			break;
>   
> +#if defined(RTE_ARCH_LOONGARCH)
> +		rte_rmb();
> +#endif
>   		rxd = *rxdp;
>   
>   		PMD_RX_LOG(DEBUG, "port_id=%u queue_id=%u rx_id=%u "

Kindly ping.

Any comments or suggestions will be appreciated.


Min



  reply	other threads:[~2023-04-21  1:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  8:50 Min Zhou
2023-04-21  1:12 ` zhoumin [this message]
2023-04-22  0:29   ` bibo, mao
2023-04-24 12:30     ` zhoumin

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=1cfdd578-774d-f9e8-da23-4b7c29a370c5@loongson.cn \
    --to=zhoumin@loongson.cn \
    --cc=dev@dpdk.org \
    --cc=maobibo@loongson.cn \
    --cc=qiming.yang@intel.com \
    --cc=wenjun1.wu@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).