Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp873209imu; Fri, 7 Dec 2018 10:11:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/XTcdH59rxa6xuv4cPmB0qvT8b7fGlRlkCZ7EJuMGmR4hepHAagxciemWzUCy753DVAg4nC X-Received: by 2002:a17:902:9006:: with SMTP id a6mr3040211plp.334.1544206315881; Fri, 07 Dec 2018 10:11:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544206315; cv=none; d=google.com; s=arc-20160816; b=ZGXq2jWbGnzFgzsdHUdqlQBkIowPgJ/0bkAsEx1kf+rl4gaCc3wptCOpKyWJjUH3i3 unZcjv7FPa5ez8O3vj4B6WVVW3yBOhn+cieY9OGJgL5rziph6a1gZW2aAHcn0FrZY/Wo 4CgfZqMX0yWcNOCriF9SKN1KaVcH4Bf2ZdPVj4Hto1Fsfu8JfJesmz94AsS/vzrQodlN vY2iTtRui3gpWvTxFhR26pZxTCOtq1+c3KIghCCPfn+8LkwrJkru4o3sRZkD7eCjxJRg xETUXqB9/8s59/u9xyMbhQV5oX5TWXytJs7pntbEBCV1VBDUelyFQdl1UBSIBBE8FoQr UFOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=w8mIJb6Ne7VAl75kvJDcF55OyuDXEIvMY69iRO9GSdk=; b=KwfWINJllzyJN/9EFrd64w0oDyuYbIoPnW0YeqwMsM6u+T/koNwdS97tWUWq4NfjRz +fwZyZ+rDP3hdR0KZIh7JE6G9QiHKhTaQCp0RhTlMBCCYdAk1vtnjlEEtVce+4PuiJ1f hIOepRkaVql0X5BqinJ+5B0x3joa1qL2C7sv3W3iZ1g9gnlA+J+tqZAM6I4FGfL95Dl4 lGegV9CCf23K6J2vzIilDyUl0gsbBUgG6nUNi/uEDh9nqrEo+skLKmGSQdzVGKrJyW72 48un8LT7YPhQSJvn3PuajywMUEnOrZ6H4s7esYBPqD0P+GwJkqs/urRj+u1+EuTISFf5 6o6Q== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si3753775pfj.153.2018.12.07.10.11.40; Fri, 07 Dec 2018 10:11:55 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726235AbeLGSK4 (ORCPT + 99 others); Fri, 7 Dec 2018 13:10:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbeLGSK4 (ORCPT ); Fri, 7 Dec 2018 13:10:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43927C049D5B; Fri, 7 Dec 2018 18:10:56 +0000 (UTC) Received: from redhat.com (ovpn-124-251.rdu2.redhat.com [10.10.124.251]) by smtp.corp.redhat.com (Postfix) with SMTP id 864F019C7F; Fri, 7 Dec 2018 18:10:49 +0000 (UTC) Date: Fri, 7 Dec 2018 13:10:48 -0500 From: "Michael S. Tsirkin" To: Tiwei Bie Cc: jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, virtio-dev@lists.oasis-open.org, wexu@redhat.com, jfreimann@redhat.com, maxime.coquelin@redhat.com Subject: Re: [RFC 3/3] virtio_ring: use new vring flags Message-ID: <20181207130822-mutt-send-email-mst@kernel.org> References: <20181207084842.13133-1-tiwei.bie@intel.com> <20181207084842.13133-4-tiwei.bie@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181207084842.13133-4-tiwei.bie@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 07 Dec 2018 18:10:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 07, 2018 at 04:48:42PM +0800, Tiwei Bie wrote: > Switch to using the _SPLIT_ and _PACKED_ variants of vring flags > in split ring and packed ring respectively. > > Signed-off-by: Tiwei Bie > --- > @@ -502,7 +505,8 @@ static inline int virtqueue_add_split(struct virtqueue *_vq, > } > } > /* Last one doesn't continue. */ > - desc[prev].flags &= cpu_to_virtio16(_vq->vdev, ~VRING_DESC_F_NEXT); > + desc[prev].flags &= cpu_to_virtio16(_vq->vdev, > + (u16)~BIT(VRING_SPLIT_DESC_F_NEXT)); > > if (indirect) { > /* Now that the indirect table is filled in, map it. */ I kind of dislike it that this forces use of a cast here. Kind of makes it more fragile. Let's use a temporary instead? > -- > 2.17.1