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


Groups > linux.kernel > #1396294

RE: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets

From Dexuan Cui <decui@microsoft.com>
Newsgroups linux.kernel
Subject RE: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets
Date 2016-05-07 12:50 +0200
Message-ID <rw7Y5-8qa-9@gated-at.bofh.it> (permalink)
References <rv6KK-6s5-35@gated-at.bofh.it> <rvRqi-Q6-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> From: David Miller [mailto:davem@davemloft.net]
> Sent: Saturday, May 7, 2016 1:04
> 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 v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets
> 
> From: Dexuan Cui <decui@microsoft.com>
> Date: Wed,  4 May 2016 09:56:57 -0700
> 
> > +#define VMBUS_RINGBUFFER_SIZE_HVSOCK_RECV (5 * PAGE_SIZE)
> > +#define VMBUS_RINGBUFFER_SIZE_HVSOCK_SEND (5 * PAGE_SIZE)
> > +
> > +#define HVSOCK_RCV_BUF_SZ
> 	VMBUS_RINGBUFFER_SIZE_HVSOCK_RECV
>  ...
> > +struct hvsock_sock {
>  ...
> > +	/* The 'hdr' and 'buf' in the below 'send' and 'recv' definitions must
> > +	 * be consecutive: see hvsock_send_data() and hvsock_recv_data().
> > +	 */
> > +	struct {
> > +		struct vmpipe_proto_header hdr;
> > +		u8 buf[HVSOCK_SND_BUF_SZ];
> > +	} send;
> > +
> > +	struct {
> > +		struct vmpipe_proto_header hdr;
> > +		u8 buf[HVSOCK_RCV_BUF_SZ];
> > +
> > +		unsigned int data_len;
> > +		unsigned int data_offset;
> > +	} recv;
> 
> I don't think allocating 5 pages of unswappable memory for every Hyper-V
> socket
> created is reasonable.

Thanks for the comment, David!

I should be able to make 'send', 'recv' here to pointers and use vmalloc()
to allocate the memory for them.  I will do this.

Thanks,
-- Dexuan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets David Miller <davem@davemloft.net> - 2016-05-06 19:10 +0200
  RE: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets Dexuan Cui <decui@microsoft.com> - 2016-05-07 12:50 +0200
    Re: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets David Miller <davem@davemloft.net> - 2016-05-07 19:50 +0200
      RE: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets Dexuan Cui <decui@microsoft.com> - 2016-05-08 08:20 +0200
        Re: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets David Miller <davem@davemloft.net> - 2016-05-08 19:50 +0200
          RE: [PATCH v9 net-next 1/2] hv_sock: introduce Hyper-V Sockets Dexuan Cui <decui@microsoft.com> - 2016-05-09 17:30 +0200

csiph-web