All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"driverdev-devel@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"apw@canonical.com" <apw@canonical.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	KY Srinivasan <kys@microsoft.com>,
	"pebolle@tiscali.nl" <pebolle@tiscali.nl>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>
Subject: RE: [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets
Date: Tue, 5 Jan 2016 15:53:46 +0000	[thread overview]
Message-ID: <9165bc8a50f742c79d9b62d00d68aedd@HKXPR3004MB0088.064d.mgd.msft.net> (raw)
In-Reply-To: <87mvsk19qx.fsf@vitty.brq.redhat.com>

> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Tuesday, January 5, 2016 20:39
> ...
> > +/*
> > + * vmbus_sendpacket_hvsock - Send the hvsock payload 'buf' of a length 'len'
> > + */
> > +int vmbus_sendpacket_hvsock(struct vmbus_channel *channel, void *buf,
> u32 len)
> > ...
> > +
> > +	bufferlist[0].iov_base = &desc;
> > +	bufferlist[0].iov_len  = sizeof(struct vmpacket_descriptor);
> > +	bufferlist[1].iov_base = &pipe_hdr;
> > +	bufferlist[1].iov_len  = sizeof(struct vmpipe_proto_header);
> > +	bufferlist[2].iov_base = buf;
> > +	bufferlist[2].iov_len  = len;
> > +	bufferlist[3].iov_base = &aligned_data;
> > +	bufferlist[3].iov_len  = packetlen_aligned - packetlen;
> > +
> > +	ret = hv_ringbuffer_write(&channel->outbound, bufferlist, 4,
> > &signal);
> 
> Using ARRAY_SIZE(bufferlist) instead of 4 would allow us to keep this
> line untouched when we decide to add something (and compiler will
> optimize it to 4 anyway).

Thanks for the suggestion! I'll fix it.

-- Dexuan

WARNING: multiple messages have this Message-ID (diff)
From: Dexuan Cui <decui@microsoft.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
	"pebolle@tiscali.nl" <pebolle@tiscali.nl>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"driverdev-devel@linuxdriverproject.org"
	<driverdev-devel@linuxdriverproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>
Subject: RE: [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets
Date: Tue, 5 Jan 2016 15:53:46 +0000	[thread overview]
Message-ID: <9165bc8a50f742c79d9b62d00d68aedd@HKXPR3004MB0088.064d.mgd.msft.net> (raw)
In-Reply-To: <87mvsk19qx.fsf@vitty.brq.redhat.com>

> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Tuesday, January 5, 2016 20:39
> ...
> > +/*
> > + * vmbus_sendpacket_hvsock - Send the hvsock payload 'buf' of a length 'len'
> > + */
> > +int vmbus_sendpacket_hvsock(struct vmbus_channel *channel, void *buf,
> u32 len)
> > ...
> > +
> > +	bufferlist[0].iov_base = &desc;
> > +	bufferlist[0].iov_len  = sizeof(struct vmpacket_descriptor);
> > +	bufferlist[1].iov_base = &pipe_hdr;
> > +	bufferlist[1].iov_len  = sizeof(struct vmpipe_proto_header);
> > +	bufferlist[2].iov_base = buf;
> > +	bufferlist[2].iov_len  = len;
> > +	bufferlist[3].iov_base = &aligned_data;
> > +	bufferlist[3].iov_len  = packetlen_aligned - packetlen;
> > +
> > +	ret = hv_ringbuffer_write(&channel->outbound, bufferlist, 4,
> > &signal);
> 
> Using ARRAY_SIZE(bufferlist) instead of 4 would allow us to keep this
> line untouched when we decide to add something (and compiler will
> optimize it to 4 anyway).

Thanks for the suggestion! I'll fix it.

-- Dexuan

WARNING: multiple messages have this Message-ID (diff)
From: Dexuan Cui <decui@microsoft.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
	"pebolle@tiscali.nl" <pebolle@tiscali.nl>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"driverdev-devel@linuxdriverproject.org"
	<driverdev-devel@linuxdriverproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>
Subject: RE: [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets
Date: Tue, 5 Jan 2016 15:53:46 +0000	[thread overview]
Message-ID: <9165bc8a50f742c79d9b62d00d68aedd@HKXPR3004MB0088.064d.mgd.msft.net> (raw)
In-Reply-To: <87mvsk19qx.fsf@vitty.brq.redhat.com>

> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
> Sent: Tuesday, January 5, 2016 20:39
> ...
> > +/*
> > + * vmbus_sendpacket_hvsock - Send the hvsock payload 'buf' of a length 'len'
> > + */
> > +int vmbus_sendpacket_hvsock(struct vmbus_channel *channel, void *buf,
> u32 len)
> > ...
> > +
> > +	bufferlist[0].iov_base = &desc;
> > +	bufferlist[0].iov_len  = sizeof(struct vmpacket_descriptor);
> > +	bufferlist[1].iov_base = &pipe_hdr;
> > +	bufferlist[1].iov_len  = sizeof(struct vmpipe_proto_header);
> > +	bufferlist[2].iov_base = buf;
> > +	bufferlist[2].iov_len  = len;
> > +	bufferlist[3].iov_base = &aligned_data;
> > +	bufferlist[3].iov_len  = packetlen_aligned - packetlen;
> > +
> > +	ret = hv_ringbuffer_write(&channel->outbound, bufferlist, 4,
> > &signal);
> 
> Using ARRAY_SIZE(bufferlist) instead of 4 would allow us to keep this
> line untouched when we decide to add something (and compiler will
> optimize it to 4 anyway).

Thanks for the suggestion! I'll fix it.

-- Dexuan
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2016-01-05 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-24 14:14 [PATCH V5 5/9] Drivers: hv: vmbus: add APIs to send/recv hvsock packets Dexuan Cui
2015-12-24 14:14 ` Dexuan Cui
2016-01-05 12:39 ` Vitaly Kuznetsov
2016-01-05 15:53   ` Dexuan Cui [this message]
2016-01-05 15:53     ` Dexuan Cui
2016-01-05 15:53     ` Dexuan Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9165bc8a50f742c79d9b62d00d68aedd@HKXPR3004MB0088.064d.mgd.msft.net \
    --to=decui@microsoft.com \
    --cc=apw@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=pebolle@tiscali.nl \
    --cc=stefanha@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.