From: "Michael S. Tsirkin" <mst@redhat.com>
To: Ilya Maximets <i.maximets@samsung.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
"Gavin Hu (Arm Technology China)" <Gavin.Hu@arm.com>,
"dev@dpdk.org" <dev@dpdk.org>, Xiao Wang <xiao.w.wang@intel.com>,
Tiwei Bie <tiwei.bie@intel.com>,
Zhihong Wang <zhihong.wang@intel.com>,
"jfreimann@redhat.com" <jfreimann@redhat.com>,
Jason Wang <jasowang@redhat.com>,
"xiaolong.ye@intel.com" <xiaolong.ye@intel.com>,
"alejandro.lucero@netronome.com" <alejandro.lucero@netronome.com>,
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
"jerinj@marvell.com" <jerinj@marvell.com>, nd <nd@arm.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/3] net/virtio: update memory ordering comment for vq notify
Date: Thu, 10 Jan 2019 09:56:36 -0500 [thread overview]
Message-ID: <20190110094353-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <8fdbcaef-05ba-230f-a2eb-21a4014ad699@samsung.com>
On Thu, Jan 10, 2019 at 12:55:19PM +0300, Ilya Maximets wrote:
> On 10.01.2019 12:18, Maxime Coquelin wrote:
> > Hi Gavin,
> >
> > On 1/10/19 9:19 AM, Gavin Hu (Arm Technology China) wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: dev <dev-bounces@dpdk.org> On Behalf Of Ilya Maximets
> >>> Sent: Wednesday, January 9, 2019 10:50 PM
> >>> To: dev@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>;
> >>> Michael S . Tsirkin <mst@redhat.com>; Xiao Wang
> >>> <xiao.w.wang@intel.com>
> >>> Cc: Tiwei Bie <tiwei.bie@intel.com>; Zhihong Wang
> >>> <zhihong.wang@intel.com>; jfreimann@redhat.com; Jason Wang
> >>> <jasowang@redhat.com>; xiaolong.ye@intel.com;
> >>> alejandro.lucero@netronome.com; Ilya Maximets
> >>> <i.maximets@samsung.com>
> >>> Subject: [dpdk-dev] [PATCH v3 2/3] net/virtio: update memory ordering
> >>> comment for vq notify
> >>>
> >>> We're not using io ports in case of modern device even on IA.
> >>> Also, this comment useless for other architectures.
> >>
> >> Agree, it should be architecture neutral.
> >>
> >>>
> >>> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> >>> ---
> >>> drivers/net/virtio/virtqueue.h | 9 ++++-----
> >>> 1 file changed, 4 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
> >>> index dffa03669..53aeac238 100644
> >>> --- a/drivers/net/virtio/virtqueue.h
> >>> +++ b/drivers/net/virtio/virtqueue.h
> >>> @@ -437,14 +437,13 @@ virtqueue_kick_prepare_packed(struct virtqueue
> >>> *vq)
> >>> return flags != RING_EVENT_FLAGS_DISABLE;
> >>> }
> >>>
> >>> +/*
> >>> + * virtqueue_kick_prepare*() or the virtio_wmb() should be called
> >>> + * before this function to be sure that all the data is visible to vhost.
> >>> + */
> >>
> >> C11 _atomic APIs are preferred for new code, other than wmb or rmb, could you work on that?
> >
> > Thanks for the review.
> > -rc2 deadline is today, so I may apply this series as is if no reply
> > from Ilya today. If a change is agreed, it could be made on top for
> > -rc3.
>
> IMHO, If we'll decide to move to C11 atomics, we'll need to rewrite all
> the significant memory accesses in virtio driver at once. We can't do
> this partially. This will require significant amount of work to understand
> how to do that and will require a lot of testing. So, it's definitely not
> for current release. Also, there are possible performance concerns about
> such solution.
>
> But I have even more significant concern: C11 atomics are designed for
> inter-thread synchronization on multi-core systems. But in case of vDPA we
> have real hardware and I'm not sure if we can use C11 atomics for
> cross-domain synchronizations. Do you know if some of the memory ordering
> types in C11 provide outer domain sync on ARMv8, for example ?
I would add to that - compiler support might not work well in all
versions which can be used to build dpdk.
E.g. this article https://lwn.net/Articles/691128/
says that "there will be some seriously suboptimal code production
before gcc-7.1".
HTH
> >
> > Regards,
> > Maxime
> >>> static inline void
> >>> virtqueue_notify(struct virtqueue *vq)
> >>> {
> >>> - /*
> >>> - * Ensure updated avail->idx is visible to host.
> >>> - * For virtio on IA, the notificaiton is through io port operation
> >>> - * which is a serialization instruction itself.
> >>> - */
> >>> VTPCI_OPS(vq->hw)->notify_queue(vq->hw, vq);
> >>> }
> >>>
> >>> --
> >>> 2.17.1
> >>
> >
> >
next prev parent reply other threads:[~2019-01-10 14:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20181214153817eucas1p19a41cdd791879252e1f3a5d77c427845@eucas1p1.samsung.com>
2018-12-14 15:38 ` [dpdk-dev] [PATCH] net/virtio: add platform memory ordering feature support Ilya Maximets
2018-12-14 17:00 ` Michael S. Tsirkin
2018-12-14 17:23 ` Ilya Maximets
[not found] ` <CGME20181226163717eucas1p15276eb45e35abe2c9cf3e7c1e0050823@eucas1p1.samsung.com>
2018-12-26 16:37 ` [dpdk-dev] [PATCH v2] " Ilya Maximets
2018-12-27 10:07 ` Shahaf Shuler
2019-01-09 14:34 ` Ilya Maximets
2019-01-09 15:50 ` Michael S. Tsirkin
2019-01-10 20:36 ` Shahaf Shuler
2019-01-15 6:33 ` Shahaf Shuler
2019-01-15 8:29 ` Ilya Maximets
2019-01-15 8:55 ` Shahaf Shuler
2019-01-15 10:23 ` Ilya Maximets
2019-02-12 17:50 ` Michael S. Tsirkin
[not found] ` <CGME20190109145021eucas1p1bfe194ffafaaaa5df62243c92b2ed6cd@eucas1p1.samsung.com>
2019-01-09 14:50 ` [dpdk-dev] [PATCH v3 0/3] Missing barriers and VIRTIO_F_ORDER_PLATFORM Ilya Maximets
[not found] ` <CGME20190109145027eucas1p2437215de0df4c691eb84d4e84bfc71e5@eucas1p2.samsung.com>
2019-01-09 14:50 ` [dpdk-dev] [PATCH v3 1/3] net/virtio: add missing barrier before reading the flags Ilya Maximets
2019-01-10 14:31 ` Maxime Coquelin
[not found] ` <CGME20190109145034eucas1p2183e275e316b87917b96fa184fc7d7cb@eucas1p2.samsung.com>
2019-01-09 14:50 ` [dpdk-dev] [PATCH v3 2/3] net/virtio: update memory ordering comment for vq notify Ilya Maximets
2019-01-10 8:19 ` Gavin Hu (Arm Technology China)
2019-01-10 9:18 ` Maxime Coquelin
2019-01-10 9:55 ` Ilya Maximets
2019-01-10 14:56 ` Michael S. Tsirkin [this message]
2019-01-10 14:31 ` Maxime Coquelin
[not found] ` <CGME20190109145040eucas1p2d9afc678ef94986544bde07b77373e6f@eucas1p2.samsung.com>
2019-01-09 14:50 ` [dpdk-dev] [PATCH v3 3/3] net/virtio: add platform memory ordering feature support Ilya Maximets
2019-01-10 14:31 ` Maxime Coquelin
2019-01-09 14:55 ` [dpdk-dev] [PATCH v3 0/3] Missing barriers and VIRTIO_F_ORDER_PLATFORM Michael S. Tsirkin
2019-01-09 15:24 ` Ilya Maximets
2019-01-09 16:53 ` Ferruh Yigit
2019-01-10 15:19 ` Maxime Coquelin
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=20190110094353-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=Gavin.Hu@arm.com \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=alejandro.lucero@netronome.com \
--cc=dev@dpdk.org \
--cc=i.maximets@samsung.com \
--cc=jasowang@redhat.com \
--cc=jerinj@marvell.com \
--cc=jfreimann@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=nd@arm.com \
--cc=tiwei.bie@intel.com \
--cc=xiao.w.wang@intel.com \
--cc=xiaolong.ye@intel.com \
--cc=zhihong.wang@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).