Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753851AbcDNCad (ORCPT ); Wed, 13 Apr 2016 22:30:33 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:33399 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbcDNCaa (ORCPT ); Wed, 13 Apr 2016 22:30:30 -0400 Date: Wed, 13 Apr 2016 22:30:27 -0400 (EDT) Message-Id: <20160413.223027.844777521863481943.davem@davemloft.net> To: decui@microsoft.com Cc: gregkh@linuxfoundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, cavery@redhat.com, kys@microsoft.com, haiyangz@microsoft.com, joe@perches.com, vkuznets@redhat.com Subject: Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets From: David Miller In-Reply-To: <1460079411-31982-1-git-send-email-decui@microsoft.com> References: <1460079411-31982-1-git-send-email-decui@microsoft.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 13 Apr 2016 19:30:29 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1031 Lines: 32 From: Dexuan Cui Date: Thu, 7 Apr 2016 18:36:51 -0700 > +struct vmpipe_proto_header { > + u32 pkt_type; > + u32 data_size; > +} __packed; There is no reason to specify __packed here. The types are strongly sized to word aligned quantities. No holes are possible in this structure, nor is any padding possible either. Do not ever slap __packed onto protocol or HW defined structures, simply just define them properly with proper types and explicit padding when necessary. > + struct { > + struct vmpipe_proto_header hdr; > + char buf[HVSOCK_SND_BUF_SZ]; > + } __packed send; And so on, and so forth.. I'm really disappointed that I couldn't even get one hunk into this patch submission without finding a major problem. I expect this patch to take several more iterations before I can even come close to applying it. So please set your expectations properly, and also it seems like nobody else wants to even review this stuff either. It is you who needs to find a way to change all of this, not me.