[dpdk-dev,v2] vhost: Fix wrong handling of virtqueue array index
Commit Message
The patch fixes wrong handling of virtqueue array index when
GET_VRING_BASE message comes.
---
lib/librte_vhost/vhost_user/virtio-net-user.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Comments
Missed signoff?
On 10/28/2015 11:00 AM, Tetsuya Mukawa wrote:
> The patch fixes wrong handling of virtqueue array index when
> GET_VRING_BASE message comes.
> ---
> lib/librte_vhost/vhost_user/virtio-net-user.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
>
On 2015/10/28 12:35, Xie, Huawei wrote:
> Missed signoff?
> On 10/28/2015 11:00 AM, Tetsuya Mukawa wrote:
>> The patch fixes wrong handling of virtqueue array index when
>> GET_VRING_BASE message comes.
>> ---
>> lib/librte_vhost/vhost_user/virtio-net-user.c | 10 +++-------
>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>
>>
Oops, I forgot it.
@@ -300,13 +300,9 @@ 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 (dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd >= 0) {
- close(dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd);
- dev->virtqueue[state->index + VIRTIO_RXQ]->kickfd = -1;
- }
- if (dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd >= 0) {
- close(dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd);
- dev->virtqueue[state->index + VIRTIO_TXQ]->kickfd = -1;
+ if (dev->virtqueue[state->index]->kickfd >= 0) {
+ close(dev->virtqueue[state->index]->kickfd);
+ dev->virtqueue[state->index]->kickfd = -1;
}
return 0;