All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH 4/4] vhost: define callfd and kickfd as int type
Date: Wed, 9 Sep 2015 09:54:55 +0800	[thread overview]
Message-ID: <20150909015455.GD2925@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <F52918179C57134FAEC9EA62FA2F962511D06ACE@shsmsx102.ccr.corp.intel.com>

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.

	--yliu

  reply	other threads:[~2015-09-09  1:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  3:54 [PATCH 1/4] vhost: remove redundant ; Yuanhan Liu
2015-08-24  3:54 ` [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 ` [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 ` [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 [this message]
2015-09-09  2:37       ` Ouyang, Changchun
2015-09-09  2:41   ` Ouyang, Changchun
2015-09-09  2:52     ` Yuanhan Liu
2015-09-09  1:49 ` [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=20150909015455.GD2925@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    /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.