DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ouyang, Changchun" <changchun.ouyang@intel.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 4/4] vhost: define callfd and kickfd as int type
Date: Wed, 9 Sep 2015 02:37:33 +0000	[thread overview]
Message-ID: <F52918179C57134FAEC9EA62FA2F962511D06BFF@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20150909015455.GD2925@yliu-dev.sh.intel.com>



> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Wednesday, September 9, 2015 9:55 AM
> To: Ouyang, Changchun
> Cc: dev@dpdk.org; Xie, Huawei
> Subject: Re: [PATCH 4/4] vhost: define callfd and kickfd as int type
> 
> On Wed, Sep 09, 2015 at 01:43:06AM +0000, Ouyang, Changchun wrote:
> >
> >
> > > -----Original Message-----
> > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> > > Sent: Monday, August 24, 2015 11:55 AM
> > > To: dev@dpdk.org
> > > Cc: Xie, Huawei; Ouyang, Changchun; Yuanhan Liu
> > > Subject: [PATCH 4/4] vhost: define callfd and kickfd as int type
> > >
> > > So that we can remove the redundant (int) cast.
> > >
> > > Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> > > ---
> >
> > > diff --git a/lib/librte_vhost/rte_virtio_net.h
> > > b/lib/librte_vhost/rte_virtio_net.h
> > > index b9bf320..a037c15 100644
> > > --- a/lib/librte_vhost/rte_virtio_net.h
> > > +++ b/lib/librte_vhost/rte_virtio_net.h
> > > @@ -87,8 +87,8 @@ struct vhost_virtqueue {
> > >  	uint16_t		vhost_hlen;		/**< Vhost header
> > > length (varies depending on RX merge buffers. */
> > >  	volatile uint16_t	last_used_idx;		/**< Last index used
> > > on the available ring */
> > >  	volatile uint16_t	last_used_idx_res;	/**< Used for
> > > multiple devices reserving buffers. */
> > > -	eventfd_t		callfd;			/**< Used to notify
> > > the guest (trigger interrupt). */
> > > -	eventfd_t		kickfd;			/**< Currently
> > > unused as polling mode is enabled. */
> > > +	int			callfd;			/**< Used to notify
> > > the guest (trigger interrupt). */
> > > +	int			kickfd;			/**< Currently
> > > unused as polling mode is enabled. */
> >
> > I don't think we have to change it from 8B(eventfd_t is defined as
> > uint64_t) to 4B, Any benefit for this change?
> 
> As I stated in the commit log, to remove the redundant (int) cast. Casts like
> following are a bit ugly:
> 
>         if ((int)dev->virtqueue[VIRTIO_RXQ]->callfd >= 0)
>                 close((int)dev->virtqueue[VIRTIO_RXQ]->callfd);
> 
> On the other hand, why it has to be uint64_t? The caller side sends the
> message(be more precisely, qemu) actually uses int type.
> 

Agree, qemu use 32 bit for the callfd and kickfd.
It could use int.
Well, there is another comment in other place in this patch, I will send out soon.


> 	--yliu

  reply	other threads:[~2015-09-09  2:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  3:54 [dpdk-dev] [PATCH 1/4] vhost: remove redundant ; Yuanhan Liu
2015-08-24  3:54 ` [dpdk-dev] [PATCH 2/4] vhost: fix typo Yuanhan Liu
2015-09-09  1:24   ` Ouyang, Changchun
2015-09-09  5:19   ` Xie, Huawei
2015-08-24  3:54 ` [dpdk-dev] [PATCH 3/4] vhost: get rid of duplicate code Yuanhan Liu
2015-09-09  1:28   ` Ouyang, Changchun
2015-09-09  5:19   ` Xie, Huawei
2015-08-24  3:54 ` [dpdk-dev] [PATCH 4/4] vhost: define callfd and kickfd as int type Yuanhan Liu
2015-09-09  1:43   ` Ouyang, Changchun
2015-09-09  1:54     ` Yuanhan Liu
2015-09-09  2:37       ` Ouyang, Changchun [this message]
2015-09-09  2:41   ` Ouyang, Changchun
2015-09-09  2:52     ` Yuanhan Liu
2015-09-09  1:49 ` [dpdk-dev] [PATCH 1/4] vhost: remove redundant ; Ouyang, Changchun
2015-09-09  5:20 ` Xie, Huawei

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=F52918179C57134FAEC9EA62FA2F962511D06BFF@shsmsx102.ccr.corp.intel.com \
    --to=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    --cc=yuanhan.liu@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).