Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1711946imu; Sat, 8 Dec 2018 05:50:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ugl6Gxc2ClFRXKk1wCV8UioC3xSyTlol1hE4JPjFsN8n3Z5giab8xQEsICElJcwMlj/2lW X-Received: by 2002:a63:f959:: with SMTP id q25mr5221239pgk.315.1544277023206; Sat, 08 Dec 2018 05:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544277023; cv=none; d=google.com; s=arc-20160816; b=LC+QCdPQGZAauWkMCg0vUuz7zjpRbneTxk8lYZ/ATxdyRtYXWLi9simlQUsnrZZYZI TgfWN0xPlRTM+n+q08FL28ydugpHu3VXYD0ySjZIqLOeEumtjC2ogUnVGUT9BY2LbI7A DCwrCmxPrY5XGjwyfXDVki9L1RmTTHRdEFh19KsToJ9H6WbuCiUjjsQy18dHZPH+vNpL 5BaNK3IPc71BE2igKlzC9Zai5iWPGGwfkOi2fo221dP8P1E1hX5KyTSJcrCyGMSTcUai NYJQy0bQZqd4NINh5wObjTVnYPlrdjVKB+z0A6AAUKzDINS2CR2J3doc8nzn8j8xGPjj YvmQ== 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=c1r4Bp5kp6iwJH7AR0n0oU8iJdFEHzwqcu0jadfXjMg=; b=slmwA2dQIXfiXbtnI80gyaISnDh65k76/tJ3MspOAmd02y33OUBzYRLNDm3DzQgEnz 03tvHwllHnVcSXd5nEFTqA2yqJJiJ4XrDy8lcyempoTQ2I37V5WhPopOFaMvB/Vm40Ep ho/lugjA2V2DmwZXHpxXjkQB5h4I1FiQXdhdAPZChcsogqarGPNDBxpzLFuLyqp/8xzn AewGnSyPEAzOLvHgI1KUD8vnFdDOSbtBtOrNw/vclLN9Lyz9nJVKS8YmziA9pVk4LCPW lA36J95qiH+ndMdF2G7VP60jlSfSRMH420liJzU3toGvsLtIziVOHEG4jkdKWzcHA+7g TS0w== 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 g1si5580293pld.197.2018.12.08.05.50.07; Sat, 08 Dec 2018 05:50:23 -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 S1726185AbeLHNtY (ORCPT + 99 others); Sat, 8 Dec 2018 08:49:24 -0500 Received: from mga12.intel.com ([192.55.52.136]:33858 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbeLHNtY (ORCPT ); Sat, 8 Dec 2018 08:49:24 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Dec 2018 05:49:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,330,1539673200"; d="scan'208";a="124143071" Received: from btwcube1.sh.intel.com (HELO dpdk-tbie) ([10.67.104.173]) by fmsmga002.fm.intel.com with ESMTP; 08 Dec 2018 05:49:21 -0800 Date: Sat, 8 Dec 2018 21:47:29 +0800 From: Tiwei Bie To: "Michael S. Tsirkin" 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: <20181208134728.GC29772@dpdk-tbie> References: <20181207084842.13133-1-tiwei.bie@intel.com> <20181207084842.13133-4-tiwei.bie@intel.com> <20181207130822-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181207130822-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 Fri, Dec 07, 2018 at 01:10:48PM -0500, Michael S. Tsirkin wrote: > 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? I tried something like this: u16 mask = ~BIT(VRING_SPLIT_DESC_F_NEXT); And it will still cause the warning: warning: large integer implicitly truncated to unsigned type [-Woverflow] u16 mask = ~BIT(VRING_SPLIT_DESC_F_NEXT); If the cast isn't wanted, maybe use ~(1 << VRING_SPLIT_DESC_F_NEXT) directly? > > > -- > > 2.17.1