Received: by 10.223.185.116 with SMTP id b49csp4852274wrg; Tue, 27 Feb 2018 03:52:14 -0800 (PST) X-Google-Smtp-Source: AH8x224RIVqFixvapsd7bpU/VnckjYryCPFPdvaiQ1adEj954TiHgQnqCxEZVC81D1j9FLMp+6u7 X-Received: by 2002:a17:902:424:: with SMTP id 33-v6mr13778318ple.57.1519732334742; Tue, 27 Feb 2018 03:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519732334; cv=none; d=google.com; s=arc-20160816; b=T+RZkKHPTHjWxjaBSuXIl2IFQ1iPGSAcLmL2QuAYMojfs8Qn/r6NZCwE+iQ2tr2DLX yNpSD+c1s6+XIYNxRyIJ9ic2+2jhuRYT//0nRVXoa38cL4JrkosbAVWB/qmG3SE+oPG1 TCi17beMFwgLTsI5R1FuKubVvIW4DARS9TtMWe9u0PV1lxeZB7D1R2wMaZFPsGQwJRLo q/3Lg/f5g0IOz8ynfXXdilEQ+e8KUGq6fazb5BGkVqkp2KFOBfjUOF9v4DHTKOoy1g0o WwAlQweP6h+wma0MHGY6VgHZO3/YVTG0+Qs5SQyCuF8n6yRvQO/oYdR3Scvle0w9u+8i aqRg== 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=ciGZ3yzy9zX6yHkiPC5sRvJjNXorkAJuv9TMwfyOMkE=; b=qjlk3xd3nj55PWH7zY6xeOmtDqnHeyUVzWnAzliI6maDtIHIF9hPF1jXziYV0KjcsG aATFGVUN15p4yzhRi68sb6ya59WSnI47KST9iOHqX1EeSxhklxxCFWjxZKUOzjjyiZ0O UQiAWOm/kIfs5CiUJoBRPYxSWyu6rqPokSwCB9EyWSf4umU0Zm1PDexSYXhYzhGCvxjs W53KEziNQpV2paJ/znNB+hk0jGqd3kfufV4J6PHkzYFo23WOu1m0z+MUnrRixPSG1U8X NHrnGwAV1m2gz3aW9Dz6L2J8QuWochZNe04ofhHrQ9/TX9nnzP1Lqv+UD57/BtnE1sK0 zr/w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si8522757pll.459.2018.02.27.03.52.00; Tue, 27 Feb 2018 03:52:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752260AbeB0LdO (ORCPT + 99 others); Tue, 27 Feb 2018 06:33:14 -0500 Received: from mga05.intel.com ([192.55.52.43]:64718 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751093AbeB0LdN (ORCPT ); Tue, 27 Feb 2018 06:33:13 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2018 03:33:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,400,1515484800"; d="scan'208";a="33961564" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by fmsmga001.fm.intel.com with ESMTP; 27 Feb 2018 03:33:11 -0800 Date: Tue, 27 Feb 2018 19:31:39 +0800 From: Tiwei Bie To: David Laight Cc: "mst@redhat.com" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "jasowang@redhat.com" , "wexu@redhat.com" , "jfreimann@redhat.com" Subject: Re: [PATCH RFC 1/2] virtio: introduce packed ring defines Message-ID: <20180227113138.4untitgk6ufnatvb@debian> References: <20180223111801.15240-1-tiwei.bie@intel.com> <20180223111801.15240-2-tiwei.bie@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 27, 2018 at 09:26:27AM +0000, David Laight wrote: > From: Tiwei Bie > > Sent: 23 February 2018 11:18 > ... > > +struct vring_packed_desc_event { > > + /* Descriptor Event Offset */ > > + __virtio16 desc_event_off : 15, > > + /* Descriptor Event Wrap Counter */ > > + desc_event_wrap : 1; > > + /* Descriptor Event Flags */ > > + __virtio16 desc_event_flags : 2; > > +}; > > This looks like you are assuming that a bit-field has a defined > layout and can be used to map a 'hardware' structure. > The don't, don't use them like that. > > David > Thanks for the comments! Above definition isn't used in this RFC, and the corresponding parts (event suppression) haven't been implemented yet. It's more like some pseudo code (I should add some comments about this in the code). I planned to change it to something like this in the next version: struct vring_packed_desc_event { __virtio16 off_wrap; __virtio16 flags; // XXX maybe not a good name for future }; // extension. Only 2bits are used now. But it seems that I had a misunderstanding about the spec on this previously: https://lists.oasis-open.org/archives/virtio-dev/201802/msg00173.html Anyway, it will be addressed. Thank you very much! ;-) Best regards, Tiwei Bie