Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1933507imm; Wed, 16 May 2018 05:26:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo6MS6wZqwgSNq++GLjkNnBrfe8wVcUADXVV5Bi9eZoehziQexshZOYl9/dCgPY0NPfXaaA X-Received: by 2002:a65:424d:: with SMTP id d13-v6mr597077pgq.234.1526473589554; Wed, 16 May 2018 05:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526473589; cv=none; d=google.com; s=arc-20160816; b=OLeFVRCFTKF1Drw0sqztwI+z1CZ+1ueEowkDX/6jQQ2EdpVYbWWqk0ArkjqR6gU/+1 ecB9xTv4TUo8qFk5MwROvJVhKHMqRCe8LSrvzNLpm/moLZ9Wjly9oeboQSJamGme93Cw Af9orDmny72qu2z7xl11dHayzNtQahm9MgZKzqv1gBQG8nQX4Tsk9qQID1I45L1W67eD +aNeRZZbfuQvhu8JgJ2SxvnteYdyaG+IoDvBda9pviF5XGWic8jUt/W4rXfM/CWQQt6U a/NwunY/HORiR1yym3Te9oKwj3WW8pcxal3Oq+hHy1GAMefhdgLkoF9/mulLX9CSw93m 5ZJg== 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:arc-authentication-results; bh=UrUkJuN4iPfwv3sxPRoDOOwQFOG0KEul/2ZQGIc6rgs=; b=yryO3kkPv4KN4l946Ie/2MpdpZ9dZ0Y8FYCjOPHSG/X9cve6XbdfmNEt6sgX5VRTbk zFu4v8rAF4p6eltLotnWVOaNAm5qtnUaLE4b706qlendmkJcZJXFsq9KjwsXdGC8DzI0 Yv1uciXd4yISdoXjsjtAALW/i4eiM2A3TooxprIWzfKQjQvFBQqFOypkJqV+ZsB9wWM+ JUr1Lo/hcSdS9o98gAfiT7v2q0mjOf1V2iw99CPsM2D0CRHNh/jg0wHmxA0bp5Zk01da UtreQfAtHMphKJvLFhT0SFMaVR9jdWDj1IxO2+kZziHk2z/6T6cwVTn2cjwF6gkb7ELF cXaw== 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 j6-v6si2587698pfc.351.2018.05.16.05.26.15; Wed, 16 May 2018 05:26:29 -0700 (PDT) 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 S1752387AbeEPMZ5 (ORCPT + 99 others); Wed, 16 May 2018 08:25:57 -0400 Received: from mga11.intel.com ([192.55.52.93]:62149 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbeEPMZ4 (ORCPT ); Wed, 16 May 2018 08:25:56 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 05:25:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="229056167" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.203]) by fmsmga006.fm.intel.com with ESMTP; 16 May 2018 05:25:54 -0700 Date: Wed, 16 May 2018 20:26:21 +0800 From: Tiwei Bie To: Sergei Shtylyov Cc: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, wexu@redhat.com, jfreimann@redhat.com Subject: Re: [RFC v4 5/5] virtio_ring: enable packed ring Message-ID: <20180516122621.GA986@debian> References: <20180516083737.26504-1-tiwei.bie@intel.com> <20180516083737.26504-6-tiwei.bie@intel.com> <27dfb4e8-6d63-bf7d-0f97-ac51559f8040@cogentembedded.com> <20180516102159.GA11467@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 16, 2018 at 02:42:53PM +0300, Sergei Shtylyov wrote: > On 05/16/2018 01:21 PM, Tiwei Bie wrote: > > >>> Signed-off-by: Tiwei Bie > >>> --- > >>> drivers/virtio/virtio_ring.c | 2 ++ > >>> 1 file changed, 2 insertions(+) > >>> > >>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > >>> index de3839f3621a..b158692263b0 100644 > >>> --- a/drivers/virtio/virtio_ring.c > >>> +++ b/drivers/virtio/virtio_ring.c > >>> @@ -1940,6 +1940,8 @@ void vring_transport_features(struct virtio_device *vdev) > >>> break; > >>> case VIRTIO_F_IOMMU_PLATFORM: > >>> break; > >>> + case VIRTIO_F_RING_PACKED: > >>> + break; > >> > >> Why not just add this *case* under the previous *case*? > > > > Do you mean fallthrough? Something like: > > > > case VIRTIO_F_IOMMU_PLATFORM: > > case VIRTIO_F_RING_PACKED: > > break; > > Yes, exactly. :-) Using fallthrough in this case will make the code more compact. I like such coding style. But unfortunately, it's not consistent with the existing code. :( The whole function will become something like this: void vring_transport_features(struct virtio_device *vdev) { unsigned int i; for (i = VIRTIO_TRANSPORT_F_START; i < VIRTIO_TRANSPORT_F_END; i++) { switch (i) { case VIRTIO_RING_F_INDIRECT_DESC: break; case VIRTIO_RING_F_EVENT_IDX: break; case VIRTIO_F_VERSION_1: break; case VIRTIO_F_IOMMU_PLATFORM: case VIRTIO_F_RING_PACKED: break; default: /* We don't understand this bit. */ __virtio_clear_bit(vdev, i); } } } Best regards, Tiwei Bie > > > Best regards, > > Tiwei Bie > > [...] > > MBR, Sergei >