Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378416 > unrolled thread

Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets

Started byDavid Miller <davem@davemloft.net>
First post2016-04-14 04:40 +0200
Last post2016-04-14 06:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets David Miller <davem@davemloft.net> - 2016-04-14 04:40 +0200
    RE: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets Dexuan Cui <decui@microsoft.com> - 2016-04-14 06:20 +0200

#1378416 — Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets

FromDavid Miller <davem@davemloft.net>
Date2016-04-14 04:40 +0200
SubjectRe: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets
Message-ID<rnFmi-2VI-15@gated-at.bofh.it>
From: Dexuan Cui <decui@microsoft.com>
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.

[toc] | [next] | [standalone]


#1378469

FromDexuan Cui <decui@microsoft.com>
Date2016-04-14 06:20 +0200
Message-ID<rnGV3-48i-1@gated-at.bofh.it>
In reply to#1378416
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Thursday, April 14, 2016 10:30
> To: Dexuan Cui <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; KY
> Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>;
> joe@perches.com; vkuznets@redhat.com
> Subject: Re: [PATCH v8 net-next 1/1] hv_sock: introduce Hyper-V Sockets
> 
> From: Dexuan Cui <decui@microsoft.com>
> 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.

Hi David,
Thank you very much for taking a look at the patch!
I'll remove all the 3 __packed usages in my patch.

> > +	struct {
> > +		struct vmpipe_proto_header hdr;
> > +		char buf[HVSOCK_SND_BUF_SZ];
> > +	} __packed send;
> 
> And so on, and so forth..
I'll remove __packed and use u8 to replace the 'char' here.
 
> I'm really disappointed that I couldn't even get one hunk into this
> patch submission without finding a major problem.
David,
Could you please point out more issues in the patch? 
I'm definitely happy to fix them. :-)
 
> 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.

A few people took a look at the early versions of the patch and did
give me good suggestions on the interface APIs with VMBus and
some coding style issues, especially Vitaly from Redhat.

Cathy from Redhat was also looking into the patch recently and
gave me some good feedbacks.

I'll try to invite more people to review the patch.

And, I'm updating the patch to address some issues:

1) the feature is only properly supported on Windows 10/2016
build 14290 and later, so I'm going to not enable the feature on
old hosts.

2) there is actually some mechanism we can use to simplify 
hvsock_open_connection() and help to better support 
hvsock_shutdown().

Thanks,
-- Dexuan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web