Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp503960imu; Wed, 23 Jan 2019 00:07:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Zmr0zhzHrE4KThu+uo6XCumMF1bbgUbP3C4IgDHlgiuyOrIZhUNYBjgVjOF181KWd+sjS X-Received: by 2002:a17:902:6b46:: with SMTP id g6mr1268899plt.21.1548230831742; Wed, 23 Jan 2019 00:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548230831; cv=none; d=google.com; s=arc-20160816; b=WZnMj86ltKoO6mrcF82gecyWs6aZ3RDE1QNtQovlUzEGjbWYT5rcaJKhHiYR/X3X7a IrqwdNBiRtA3VrFxkia27CgGrBYuAGxjSAX0MmKAJiDHy+YJTI3BP72pBTtTNI9Vmdyv UMvrGp+wgxK+wAzxEPwnXyWMbs07mKdPn+4fbfhVruSG3ZvgLcU5vuPq9I+OCpxZrhbx XF8TkADNm9z1DRJW7OHUmPf6vXhl0Ranql69Xq2ZAfPorpVLYBoW8hh8wgVD9tkhMxsy Se/HQp6ffHbD60mQFDeNemzogcEghJYnHbVAIM+BA2tCeo0IgFZ809XqGIwr1Ct0MPjr rnJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=O5tWb/WJgZSFu7dJM6SqehdXe0b3HPtyOtPsCdqRJTs=; b=eN9SmxSdrx7ioI8Y8/cmkYtSunNYoLF8jVHAypjwvlKh5HxRLGV0ZWwiUihvNzoQcT p9AboQyBiK1DHfa/k3HRJTgYXmxvil/T9BBn88tGCy1VQtMZALrtJsKAmGdVSupHeqm1 MVyN6ALQ/tuWcF/TEGTg7hsn7psAY/jQ2t1LYwuZRXOHKB1rvdLktkpjZENAUnv3O/Z4 uXTWLGQrmoJ7gBS/DmttMdJw6dfF4brRIzQ4ljeizD0NYyxtGvHznes2C+IMsGLpWp0W qhG8gawRcEgAW2BffEFvHpeDj66Q9E+bLbeMo1qt0dPKsLQAh5Xf+BgdOd6ylwhnv+nn OU3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si16914003pgl.141.2019.01.23.00.06.55; Wed, 23 Jan 2019 00:07:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726373AbfAWIEv (ORCPT + 99 others); Wed, 23 Jan 2019 03:04:51 -0500 Received: from mga05.intel.com ([192.55.52.43]:18341 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfAWIEu (ORCPT ); Wed, 23 Jan 2019 03:04:50 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2019 00:04:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,510,1539673200"; d="scan'208";a="116707982" Received: from unknown (HELO dpdk-tbie) ([10.67.104.173]) by fmsmga007.fm.intel.com with ESMTP; 23 Jan 2019 00:04:49 -0800 Date: Wed, 23 Jan 2019 16:02:27 +0800 From: Tiwei Bie To: "Michael S. Tsirkin" Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, virtio-dev@lists.oasis-open.org Subject: Re: [PATCH] virtio: support VIRTIO_F_ORDER_PLATFORM Message-ID: <20190123080227.GA23394@dpdk-tbie> References: <20190122170346.6279-1-tiwei.bie@intel.com> <20190122230247-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190122230247-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 11:04:29PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 01:03:46AM +0800, Tiwei Bie wrote: > > This patch introduces the support for VIRTIO_F_ORDER_PLATFORM. > > When this feature is negotiated, driver will use the barriers > > suitable for hardware devices. > > > > Signed-off-by: Tiwei Bie > > Could you pls add a bit more explanation in the commit log? > E.g. which configurations are broken without this patch? > How severe is the problem? Sure. Will do that. Thanks > > I'm trying to decide whether this belongs in 5.0 or 5.1. > > > --- > > drivers/virtio/virtio_ring.c | 8 ++++++++ > > include/uapi/linux/virtio_config.h | 6 ++++++ > > 2 files changed, 14 insertions(+) > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > index cd7e755484e3..27d3f057493e 100644 > > --- a/drivers/virtio/virtio_ring.c > > +++ b/drivers/virtio/virtio_ring.c > > @@ -1609,6 +1609,9 @@ static struct virtqueue *vring_create_virtqueue_packed( > > !context; > > vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX); > > > > + if (virtio_has_feature(vdev, VIRTIO_F_ORDER_PLATFORM)) > > + vq->weak_barriers = false; > > + > > vq->packed.ring_dma_addr = ring_dma_addr; > > vq->packed.driver_event_dma_addr = driver_event_dma_addr; > > vq->packed.device_event_dma_addr = device_event_dma_addr; > > @@ -2079,6 +2082,9 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, > > !context; > > vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX); > > > > + if (virtio_has_feature(vdev, VIRTIO_F_ORDER_PLATFORM)) > > + vq->weak_barriers = false; > > + > > vq->split.queue_dma_addr = 0; > > vq->split.queue_size_in_bytes = 0; > > > > @@ -2213,6 +2219,8 @@ void vring_transport_features(struct virtio_device *vdev) > > break; > > case VIRTIO_F_RING_PACKED: > > break; > > + case VIRTIO_F_ORDER_PLATFORM: > > + break; > > default: > > /* We don't understand this bit. */ > > __virtio_clear_bit(vdev, i); > > diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h > > index 1196e1c1d4f6..ff8e7dc9d4dd 100644 > > --- a/include/uapi/linux/virtio_config.h > > +++ b/include/uapi/linux/virtio_config.h > > @@ -78,6 +78,12 @@ > > /* This feature indicates support for the packed virtqueue layout. */ > > #define VIRTIO_F_RING_PACKED 34 > > > > +/* > > + * This feature indicates that memory accesses by the driver and the > > + * device are ordered in a way described by the platform. > > + */ > > +#define VIRTIO_F_ORDER_PLATFORM 36 > > + > > /* > > * Does the device support Single Root I/O Virtualization? > > */ > > -- > > 2.17.1