DPDK patches and discussions
 help / color / mirror / Atom feed
From: Asok Tiyyagura <asokt@hotmail.com>
To: "konstantin.ananyev@intel.com" <konstantin.ananyev@intel.com>
Cc: "skoteshwar@caviumnetworks.com" <skoteshwar@caviumnetworks.com>,
	"helin.zhang@intel.com" <helin.zhang@intel.com>,
	"jingjing.wu@intel.com" <jingjing.wu@intel.com>,
	"jerin.jacob@caviumnetworks.com" <jerin.jacob@caviumnetworks.com>,
	"jianbo.liu@linaro.org" <jianbo.liu@linaro.org>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] i40e: Fix eth_i40e_dev_init sequence on ThunderX
Date: Wed, 30 Nov 2016 01:23:51 +0000	[thread overview]
Message-ID: <SN2PR18MB07348CE400733571E91B3CBAAD8C0@SN2PR18MB0734.namprd18.prod.outlook.com> (raw)
In-Reply-To: <mailman.4.1479684107.2722.dev@dpdk.org>

I can confirm we ran into a similar issue while using ixgbe.


-Asok


Hi
>
> i40e_asq_send_command: rd32 & wr32 under ThunderX gives unpredictable
>                        results. To solve this include rte memory barriers
>
> Signed-off-by: Satha Rao <skoteshwar@caviumnetworks.com>
> ---
>  drivers/net/i40e/base/i40e_osdep.h | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h
> index 38e7ba5..ffa3160 100644
> --- a/drivers/net/i40e/base/i40e_osdep.h
> +++ b/drivers/net/i40e/base/i40e_osdep.h
> @@ -158,7 +158,13 @@ do {                                                            \
>        ((volatile uint32_t *)((char *)(a)->hw_addr + (reg)))
>  static inline uint32_t i40e_read_addr(volatile void *addr)
>  {
> +#if defined(RTE_ARCH_ARM64)
> +     uint32_t val = rte_le_to_cpu_32(I40E_PCI_REG(addr));
> +     rte_rmb();
> +     return val;

If you really need an rmb/wmb with MMIO read/writes on ARM,
I think you can avoid #ifdefs here and use rte_smp_rmb/rte_smp_wmb.
BTW, I suppose if you need it for i40e, you would need it for other devices too.
Konstantin

> +#else
>        return rte_le_to_cpu_32(I40E_PCI_REG(addr));
> +#endif
>  }
>  #define I40E_PCI_REG_WRITE(reg, value) \
>        do { I40E_PCI_REG((reg)) = rte_cpu_to_le_32(value); } while (0)
> @@ -171,8 +177,16 @@ static inline uint32_t i40e_read_addr(volatile void *addr)
>        I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((hw), (reg)), (value))
>
>  #define rd32(a, reg) i40e_read_addr(I40E_PCI_REG_ADDR((a), (reg)))
> +#if defined(RTE_ARCH_ARM64)
> +#define wr32(a, reg, value) \
> +     do { \
> +             I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((a), (reg)), (value)); \
> +             rte_wmb(); \
> +     } while (0)
> +#else
>  #define wr32(a, reg, value) \
>        I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((a), (reg)), (value))
> +#endif
>  #define flush(a) i40e_read_addr(I40E_PCI_REG_ADDR((a), (I40E_GLGEN_STAT)))
>
>  #define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
> --
> 2.7.4

       reply	other threads:[~2016-11-30  1:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4.1479684107.2722.dev@dpdk.org>
2016-11-30  1:23 ` Asok Tiyyagura [this message]
2016-11-18 12:52 Satha Rao
2016-11-18 15:00 ` Bruce Richardson
2016-11-20 23:21 ` Ananyev, Konstantin
2016-11-21 22:16   ` Jerin Jacob
2016-11-22 13:46     ` Bruce Richardson
2016-11-22 18:49       ` Jerin Jacob
2016-11-30 17:52         ` Ananyev, Konstantin
2016-11-30 20:54           ` Jerin Jacob
2016-12-01 11:38             ` Ananyev, Konstantin
2017-02-07 14:33 ` Ferruh Yigit

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=SN2PR18MB07348CE400733571E91B3CBAAD8C0@SN2PR18MB0734.namprd18.prod.outlook.com \
    --to=asokt@hotmail.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=jianbo.liu@linaro.org \
    --cc=jingjing.wu@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=skoteshwar@caviumnetworks.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).