Received: by 10.223.185.116 with SMTP id b49csp4732517wrg; Tue, 27 Feb 2018 01:27:10 -0800 (PST) X-Google-Smtp-Source: AH8x226THgK6Z+UujmD0ojJD6GWSCvKiZ7kERLo9ye5kx/uhHOKGJKec+6biNrKCna2l4AjvePuI X-Received: by 10.98.252.22 with SMTP id e22mr13491064pfh.235.1519723630466; Tue, 27 Feb 2018 01:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519723630; cv=none; d=google.com; s=arc-20160816; b=SZCfFk8lKATa23EgdiEnx6VyZmTlKqMTngtyHPhZfMrpS07IzrSjHrPmeLv0IJnmVJ DOpfc8r4RutQ1F49Uo03FOVyh43ALM7gynH08Q/PJ0NaIps9Pe+RPBRzf9bERNJo4sAK E+TA9emQVSc4FZnSzz2dTFeI4v2kqOyEN342xoVhFp24gVUXRoS5kGajU7Zc9LQAMAny UdeDmm3kzueCtoWqq2h9gbtz4QtC1ID/1XnKOiJeRLwpCSHRSS8vOAdr60fGxe9gNo0u 2icp+/oQLoxYwrEXYIBCI+mgEgtJF5R5kfp3sJ7hPvFWB7h2SyTv5t0Sp241KS0dW3pO EJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=5qMkb+81o26PAACc10L+zQsNUN9Z4J+C6XyNrPgnf28=; b=x6v2gIcOZWELzahnQzNhTC/apEKTjVD/0o7PoX08V+VMeLndeucLM7HmV1Ov0sxNO0 H/a6pRuhFnj09MNv93MNYo7jLUnbq9nBxpDH4zaScgC+6Pvuodi9dkaKyMkw9oL3bzbp 6m7JiMi+AO+sOSnDDozQYed/Ni45r77NEZ463LJE/bMq1vZ1sZxSTo/UX8r+SPQokTP9 ZE+alnobgixo7b1WmxWRPZZhrOEhMtVKaSt2oOm4Q69+6IPgyV3TggnAi0NE+zEjpYVr J0rE0k1E7jyTR+8hKhXsbR44bfVWPStYFGTo7QvMKIJ5+ZBJOny88ZcreyB4g96xu94v tOtQ== 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 r13si6712382pgp.504.2018.02.27.01.26.54; Tue, 27 Feb 2018 01:27:10 -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 S1752392AbeB0JZs convert rfc822-to-8bit (ORCPT + 99 others); Tue, 27 Feb 2018 04:25:48 -0500 Received: from smtp-out4.electric.net ([192.162.216.185]:60349 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956AbeB0JZq (ORCPT ); Tue, 27 Feb 2018 04:25:46 -0500 Received: from 1eqbVr-0002sZ-Vr by out4c.electric.net with emc1-ok (Exim 4.87) (envelope-from ) id 1eqbW3-00045y-TL; Tue, 27 Feb 2018 01:25:43 -0800 Received: by emcmailer; Tue, 27 Feb 2018 01:25:43 -0800 Received: from [156.67.243.126] (helo=AcuMS.aculab.com) by out4c.electric.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.87) (envelope-from ) id 1eqbVr-0002sZ-Vr; Tue, 27 Feb 2018 01:25:31 -0800 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 27 Feb 2018 09:26:27 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Tue, 27 Feb 2018 09:26:27 +0000 From: David Laight To: 'Tiwei Bie' , "mst@redhat.com" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" CC: "jasowang@redhat.com" , "wexu@redhat.com" , "jfreimann@redhat.com" Subject: RE: [PATCH RFC 1/2] virtio: introduce packed ring defines Thread-Topic: [PATCH RFC 1/2] virtio: introduce packed ring defines Thread-Index: AQHTrJhawi/1jB/uq0q3lsGi4wUZ3aO4ADyQ Date: Tue, 27 Feb 2018 09:26:27 +0000 Message-ID: References: <20180223111801.15240-1-tiwei.bie@intel.com> <20180223111801.15240-2-tiwei.bie@intel.com> In-Reply-To: <20180223111801.15240-2-tiwei.bie@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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