* [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion
@ 2015-03-06 10:39 Huawei Xie
[not found] ` <1425638358-26523-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Huawei Xie @ 2015-03-06 10:39 UTC (permalink / raw)
To: dev-VfR2kkLFssw
Previous vhost implementation wrongly name kickfd as callfd and callfd as kickfd.
It is functional correct, but causes confusion.
Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
examples/vhost/main.c | 6 +++---
lib/librte_vhost/rte_virtio_net.h | 4 ++--
lib/librte_vhost/vhost_rxtx.c | 6 +++---
lib/librte_vhost/vhost_user/virtio-net-user.c | 12 ++++++------
lib/librte_vhost/virtio-net.c | 12 ++++++------
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 334e2fe..61ea671 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1434,7 +1434,7 @@ put_desc_to_used_list_zcp(struct vhost_virtqueue *vq, uint16_t desc_idx)
/* Kick the guest if necessary. */
if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
- eventfd_write((int)vq->kickfd, 1);
+ eventfd_write((int)vq->callfd, 1);
}
/*
@@ -1627,7 +1627,7 @@ txmbuf_clean_zcp(struct virtio_net *dev, struct vpool *vpool)
/* Kick guest if required. */
if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
- eventfd_write((int)vq->kickfd, 1);
+ eventfd_write((int)vq->callfd, 1);
return 0;
}
@@ -1775,7 +1775,7 @@ virtio_dev_rx_zcp(struct virtio_net *dev, struct rte_mbuf **pkts,
/* Kick the guest if necessary. */
if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
- eventfd_write((int)vq->kickfd, 1);
+ eventfd_write((int)vq->callfd, 1);
return count;
}
diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h
index 611a3d4..2fc1c44 100644
--- a/lib/librte_vhost/rte_virtio_net.h
+++ b/lib/librte_vhost/rte_virtio_net.h
@@ -86,8 +86,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; /**< Currently unused as polling mode is enabled. */
- eventfd_t kickfd; /**< Used to notify the guest (trigger interrupt). */
+ eventfd_t callfd; /**< Used to notify the guest (trigger interrupt). */
+ eventfd_t kickfd; /**< Currently unused as polling mode is enabled. */
struct buf_vector buf_vec[BUF_VECTOR_MAX]; /**< for scatter RX. */
} __rte_cache_aligned;
diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c
index c7c9550..535c7a1 100644
--- a/lib/librte_vhost/vhost_rxtx.c
+++ b/lib/librte_vhost/vhost_rxtx.c
@@ -180,7 +180,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
/* Kick the guest if necessary. */
if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
- eventfd_write((int)vq->kickfd, 1);
+ eventfd_write((int)vq->callfd, 1);
return count;
}
@@ -507,7 +507,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
/* Kick the guest if necessary. */
if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
- eventfd_write((int)vq->kickfd, 1);
+ eventfd_write((int)vq->callfd, 1);
}
return count;
@@ -725,6 +725,6 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id,
vq->used->idx += entry_success;
/* Kick guest if required. */
if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))
- eventfd_write((int)vq->kickfd, 1);
+ eventfd_write((int)vq->callfd, 1);
return entry_success;
}
diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c
index 97c5177..e0c7394 100644
--- a/lib/librte_vhost/vhost_user/virtio-net-user.c
+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
@@ -286,13 +286,13 @@ user_get_vring_base(struct vhost_device_ctx ctx,
* sent and only sent in vhost_vring_stop.
* TODO: cleanup the vring, it isn't usable since here.
*/
- if (((int)dev->virtqueue[VIRTIO_RXQ]->callfd) >= 0) {
- close(dev->virtqueue[VIRTIO_RXQ]->callfd);
- dev->virtqueue[VIRTIO_RXQ]->callfd = (eventfd_t)-1;
+ if (((int)dev->virtqueue[VIRTIO_RXQ]->kickfd) >= 0) {
+ close(dev->virtqueue[VIRTIO_RXQ]->kickfd);
+ dev->virtqueue[VIRTIO_RXQ]->kickfd = (eventfd_t)-1;
}
- if (((int)dev->virtqueue[VIRTIO_TXQ]->callfd) >= 0) {
- close(dev->virtqueue[VIRTIO_TXQ]->callfd);
- dev->virtqueue[VIRTIO_TXQ]->callfd = (eventfd_t)-1;
+ if (((int)dev->virtqueue[VIRTIO_TXQ]->kickfd) >= 0) {
+ close(dev->virtqueue[VIRTIO_TXQ]->kickfd);
+ dev->virtqueue[VIRTIO_TXQ]->kickfd = (eventfd_t)-1;
}
return 0;
diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index 20567ff..6917fcf 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -595,10 +595,10 @@ set_vring_call(struct vhost_device_ctx ctx, struct vhost_vring_file *file)
/* file->index refers to the queue index. The txq is 1, rxq is 0. */
vq = dev->virtqueue[file->index];
- if ((int)vq->kickfd >= 0)
- close((int)vq->kickfd);
+ if ((int)vq->callfd >= 0)
+ close((int)vq->callfd);
- vq->kickfd = file->fd;
+ vq->callfd = file->fd;
return 0;
}
@@ -621,10 +621,10 @@ set_vring_kick(struct vhost_device_ctx ctx, struct vhost_vring_file *file)
/* file->index refers to the queue index. The txq is 1, rxq is 0. */
vq = dev->virtqueue[file->index];
- if ((int)vq->callfd >= 0)
- close((int)vq->callfd);
+ if ((int)vq->kickfd >= 0)
+ close((int)vq->kickfd);
- vq->callfd = file->fd;
+ vq->kickfd = file->fd;
return 0;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <1425638358-26523-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* [PATCH] test whether file descriptor is valid before close it [not found] ` <1425638358-26523-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2015-03-06 11:05 ` Huawei Xie [not found] ` <1425639943-27157-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2015-03-09 1:28 ` [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion Ouyang, Changchun 2015-03-09 2:23 ` Tetsuya Mukawa 2 siblings, 1 reply; 8+ messages in thread From: Huawei Xie @ 2015-03-06 11:05 UTC (permalink / raw) To: dev-VfR2kkLFssw This avoids closing -1 in our case. Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- lib/librte_vhost/virtio-net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index 6917fcf..4672e67 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -185,13 +185,13 @@ cleanup_device(struct virtio_net *dev) } /* Close any event notifiers opened by device. */ - if (dev->virtqueue[VIRTIO_RXQ]->callfd) + if ((int)dev->virtqueue[VIRTIO_RXQ]->callfd >= 0) close((int)dev->virtqueue[VIRTIO_RXQ]->callfd); - if (dev->virtqueue[VIRTIO_RXQ]->kickfd) + if ((int)dev->virtqueue[VIRTIO_RXQ]->kickfd >= 0) close((int)dev->virtqueue[VIRTIO_RXQ]->kickfd); - if (dev->virtqueue[VIRTIO_TXQ]->callfd) + if ((int)dev->virtqueue[VIRTIO_TXQ]->callfd >= 0) close((int)dev->virtqueue[VIRTIO_TXQ]->callfd); - if (dev->virtqueue[VIRTIO_TXQ]->kickfd) + if ((int)dev->virtqueue[VIRTIO_TXQ]->kickfd >= 0) close((int)dev->virtqueue[VIRTIO_TXQ]->kickfd); } -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <1425639943-27157-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] test whether file descriptor is valid before close it [not found] ` <1425639943-27157-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2015-03-09 1:32 ` Ouyang, Changchun [not found] ` <F52918179C57134FAEC9EA62FA2F962511A0F479-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2015-03-09 2:23 ` Tetsuya Mukawa 1 sibling, 1 reply; 8+ messages in thread From: Ouyang, Changchun @ 2015-03-09 1:32 UTC (permalink / raw) To: Xie, Huawei, dev-VfR2kkLFssw@public.gmane.org > -----Original Message----- > From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Huawei Xie > Sent: Friday, March 6, 2015 7:06 PM > To: dev-VfR2kkLFssw@public.gmane.org > Subject: [dpdk-dev] [PATCH] test whether file descriptor is valid before close > it > > This avoids closing -1 in our case. > > Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Acked-by: Changchun Ouyang <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <F52918179C57134FAEC9EA62FA2F962511A0F479-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] test whether file descriptor is valid before close it [not found] ` <F52918179C57134FAEC9EA62FA2F962511A0F479-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2015-03-09 8:34 ` Thomas Monjalon 0 siblings, 0 replies; 8+ messages in thread From: Thomas Monjalon @ 2015-03-09 8:34 UTC (permalink / raw) To: Xie, Huawei; +Cc: dev-VfR2kkLFssw > > This avoids closing -1 in our case. > > > > Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > Acked-by: Changchun Ouyang <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Applied, thanks ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] test whether file descriptor is valid before close it [not found] ` <1425639943-27157-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2015-03-09 1:32 ` Ouyang, Changchun @ 2015-03-09 2:23 ` Tetsuya Mukawa 1 sibling, 0 replies; 8+ messages in thread From: Tetsuya Mukawa @ 2015-03-09 2:23 UTC (permalink / raw) To: Huawei Xie, dev-VfR2kkLFssw On 2015/03/06 20:05, Huawei Xie wrote: > This avoids closing -1 in our case. > > Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > --- > lib/librte_vhost/virtio-net.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c > index 6917fcf..4672e67 100644 > --- a/lib/librte_vhost/virtio-net.c > +++ b/lib/librte_vhost/virtio-net.c > @@ -185,13 +185,13 @@ cleanup_device(struct virtio_net *dev) > } > > /* Close any event notifiers opened by device. */ > - if (dev->virtqueue[VIRTIO_RXQ]->callfd) > + if ((int)dev->virtqueue[VIRTIO_RXQ]->callfd >= 0) > close((int)dev->virtqueue[VIRTIO_RXQ]->callfd); > - if (dev->virtqueue[VIRTIO_RXQ]->kickfd) > + if ((int)dev->virtqueue[VIRTIO_RXQ]->kickfd >= 0) > close((int)dev->virtqueue[VIRTIO_RXQ]->kickfd); > - if (dev->virtqueue[VIRTIO_TXQ]->callfd) > + if ((int)dev->virtqueue[VIRTIO_TXQ]->callfd >= 0) > close((int)dev->virtqueue[VIRTIO_TXQ]->callfd); > - if (dev->virtqueue[VIRTIO_TXQ]->kickfd) > + if ((int)dev->virtqueue[VIRTIO_TXQ]->kickfd >= 0) > close((int)dev->virtqueue[VIRTIO_TXQ]->kickfd); > } > Acked-by: Tetsuya Mukawa <mukawa-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion [not found] ` <1425638358-26523-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2015-03-06 11:05 ` [PATCH] test whether file descriptor is valid before close it Huawei Xie @ 2015-03-09 1:28 ` Ouyang, Changchun [not found] ` <F52918179C57134FAEC9EA62FA2F962511A0F456-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org> 2015-03-09 2:23 ` Tetsuya Mukawa 2 siblings, 1 reply; 8+ messages in thread From: Ouyang, Changchun @ 2015-03-09 1:28 UTC (permalink / raw) To: Xie, Huawei, dev-VfR2kkLFssw@public.gmane.org > -----Original Message----- > From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Huawei Xie > Sent: Friday, March 6, 2015 6:39 PM > To: dev-VfR2kkLFssw@public.gmane.org > Subject: [dpdk-dev] [PATCH] lib/librte_vhost: exchange kickfd and callfd to > avoid confusion > > Previous vhost implementation wrongly name kickfd as callfd and callfd as > kickfd. > It is functional correct, but causes confusion. > > Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Acked-by: Changchun Ouyang <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <F52918179C57134FAEC9EA62FA2F962511A0F456-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion [not found] ` <F52918179C57134FAEC9EA62FA2F962511A0F456-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2015-03-09 8:33 ` Thomas Monjalon 0 siblings, 0 replies; 8+ messages in thread From: Thomas Monjalon @ 2015-03-09 8:33 UTC (permalink / raw) To: Xie, Huawei; +Cc: dev-VfR2kkLFssw > > Previous vhost implementation wrongly name kickfd as callfd and callfd as > > kickfd. > > It is functional correct, but causes confusion. > > > > Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > Acked-by: Changchun Ouyang <changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Applied, thanks ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion [not found] ` <1425638358-26523-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2015-03-06 11:05 ` [PATCH] test whether file descriptor is valid before close it Huawei Xie 2015-03-09 1:28 ` [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion Ouyang, Changchun @ 2015-03-09 2:23 ` Tetsuya Mukawa 2 siblings, 0 replies; 8+ messages in thread From: Tetsuya Mukawa @ 2015-03-09 2:23 UTC (permalink / raw) To: Huawei Xie, dev-VfR2kkLFssw On 2015/03/06 19:39, Huawei Xie wrote: > Previous vhost implementation wrongly name kickfd as callfd and callfd as kickfd. > It is functional correct, but causes confusion. > > Signed-off-by: Huawei Xie <huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > --- > examples/vhost/main.c | 6 +++--- > lib/librte_vhost/rte_virtio_net.h | 4 ++-- > lib/librte_vhost/vhost_rxtx.c | 6 +++--- > lib/librte_vhost/vhost_user/virtio-net-user.c | 12 ++++++------ > lib/librte_vhost/virtio-net.c | 12 ++++++------ > 5 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index 334e2fe..61ea671 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -1434,7 +1434,7 @@ put_desc_to_used_list_zcp(struct vhost_virtqueue *vq, uint16_t desc_idx) > > /* Kick the guest if necessary. */ > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) > - eventfd_write((int)vq->kickfd, 1); > + eventfd_write((int)vq->callfd, 1); > } > > /* > @@ -1627,7 +1627,7 @@ txmbuf_clean_zcp(struct virtio_net *dev, struct vpool *vpool) > > /* Kick guest if required. */ > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) > - eventfd_write((int)vq->kickfd, 1); > + eventfd_write((int)vq->callfd, 1); > > return 0; > } > @@ -1775,7 +1775,7 @@ virtio_dev_rx_zcp(struct virtio_net *dev, struct rte_mbuf **pkts, > > /* Kick the guest if necessary. */ > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) > - eventfd_write((int)vq->kickfd, 1); > + eventfd_write((int)vq->callfd, 1); > > return count; > } > diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h > index 611a3d4..2fc1c44 100644 > --- a/lib/librte_vhost/rte_virtio_net.h > +++ b/lib/librte_vhost/rte_virtio_net.h > @@ -86,8 +86,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; /**< Currently unused as polling mode is enabled. */ > - eventfd_t kickfd; /**< Used to notify the guest (trigger interrupt). */ > + eventfd_t callfd; /**< Used to notify the guest (trigger interrupt). */ > + eventfd_t kickfd; /**< Currently unused as polling mode is enabled. */ > struct buf_vector buf_vec[BUF_VECTOR_MAX]; /**< for scatter RX. */ > } __rte_cache_aligned; > > diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c > index c7c9550..535c7a1 100644 > --- a/lib/librte_vhost/vhost_rxtx.c > +++ b/lib/librte_vhost/vhost_rxtx.c > @@ -180,7 +180,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, > > /* Kick the guest if necessary. */ > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) > - eventfd_write((int)vq->kickfd, 1); > + eventfd_write((int)vq->callfd, 1); > return count; > } > > @@ -507,7 +507,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, > > /* Kick the guest if necessary. */ > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) > - eventfd_write((int)vq->kickfd, 1); > + eventfd_write((int)vq->callfd, 1); > } > > return count; > @@ -725,6 +725,6 @@ rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, > vq->used->idx += entry_success; > /* Kick guest if required. */ > if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) > - eventfd_write((int)vq->kickfd, 1); > + eventfd_write((int)vq->callfd, 1); > return entry_success; > } > diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c > index 97c5177..e0c7394 100644 > --- a/lib/librte_vhost/vhost_user/virtio-net-user.c > +++ b/lib/librte_vhost/vhost_user/virtio-net-user.c > @@ -286,13 +286,13 @@ user_get_vring_base(struct vhost_device_ctx ctx, > * sent and only sent in vhost_vring_stop. > * TODO: cleanup the vring, it isn't usable since here. > */ > - if (((int)dev->virtqueue[VIRTIO_RXQ]->callfd) >= 0) { > - close(dev->virtqueue[VIRTIO_RXQ]->callfd); > - dev->virtqueue[VIRTIO_RXQ]->callfd = (eventfd_t)-1; > + if (((int)dev->virtqueue[VIRTIO_RXQ]->kickfd) >= 0) { > + close(dev->virtqueue[VIRTIO_RXQ]->kickfd); > + dev->virtqueue[VIRTIO_RXQ]->kickfd = (eventfd_t)-1; > } > - if (((int)dev->virtqueue[VIRTIO_TXQ]->callfd) >= 0) { > - close(dev->virtqueue[VIRTIO_TXQ]->callfd); > - dev->virtqueue[VIRTIO_TXQ]->callfd = (eventfd_t)-1; > + if (((int)dev->virtqueue[VIRTIO_TXQ]->kickfd) >= 0) { > + close(dev->virtqueue[VIRTIO_TXQ]->kickfd); > + dev->virtqueue[VIRTIO_TXQ]->kickfd = (eventfd_t)-1; > } > > return 0; > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c > index 20567ff..6917fcf 100644 > --- a/lib/librte_vhost/virtio-net.c > +++ b/lib/librte_vhost/virtio-net.c > @@ -595,10 +595,10 @@ set_vring_call(struct vhost_device_ctx ctx, struct vhost_vring_file *file) > /* file->index refers to the queue index. The txq is 1, rxq is 0. */ > vq = dev->virtqueue[file->index]; > > - if ((int)vq->kickfd >= 0) > - close((int)vq->kickfd); > + if ((int)vq->callfd >= 0) > + close((int)vq->callfd); > > - vq->kickfd = file->fd; > + vq->callfd = file->fd; > > return 0; > } > @@ -621,10 +621,10 @@ set_vring_kick(struct vhost_device_ctx ctx, struct vhost_vring_file *file) > /* file->index refers to the queue index. The txq is 1, rxq is 0. */ > vq = dev->virtqueue[file->index]; > > - if ((int)vq->callfd >= 0) > - close((int)vq->callfd); > + if ((int)vq->kickfd >= 0) > + close((int)vq->kickfd); > > - vq->callfd = file->fd; > + vq->kickfd = file->fd; > > return 0; > } Acked-by: Tetsuya Mukawa <mukawa-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-03-09 8:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06 10:39 [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion Huawei Xie
[not found] ` <1425638358-26523-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-06 11:05 ` [PATCH] test whether file descriptor is valid before close it Huawei Xie
[not found] ` <1425639943-27157-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-09 1:32 ` Ouyang, Changchun
[not found] ` <F52918179C57134FAEC9EA62FA2F962511A0F479-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-09 8:34 ` Thomas Monjalon
2015-03-09 2:23 ` Tetsuya Mukawa
2015-03-09 1:28 ` [PATCH] lib/librte_vhost: exchange kickfd and callfd to avoid confusion Ouyang, Changchun
[not found] ` <F52918179C57134FAEC9EA62FA2F962511A0F456-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-09 8:33 ` Thomas Monjalon
2015-03-09 2:23 ` Tetsuya Mukawa
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).