Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 05:26:01 +0000 (UTC)
From:      Bryan Venteicher <bryanv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268480 - head/sys/dev/virtio
Message-ID:  <201407100526.s6A5Q1IM059855@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bryanv
Date: Thu Jul 10 05:26:01 2014
New Revision: 268480
URL: http://svnweb.freebsd.org/changeset/base/268480

Log:
  Add accessor to get the number of free descriptors in the virtqueue
  
  MFC after:	1 month

Modified:
  head/sys/dev/virtio/virtqueue.c
  head/sys/dev/virtio/virtqueue.h

Modified: head/sys/dev/virtio/virtqueue.c
==============================================================================
--- head/sys/dev/virtio/virtqueue.c	Thu Jul 10 03:10:56 2014	(r268479)
+++ head/sys/dev/virtio/virtqueue.c	Thu Jul 10 05:26:01 2014	(r268480)
@@ -375,6 +375,13 @@ virtqueue_size(struct virtqueue *vq)
 }
 
 int
+virtqueue_nfree(struct virtqueue *vq)
+{
+
+	return (vq->vq_free_cnt);
+}
+
+int
 virtqueue_empty(struct virtqueue *vq)
 {
 

Modified: head/sys/dev/virtio/virtqueue.h
==============================================================================
--- head/sys/dev/virtio/virtqueue.h	Thu Jul 10 03:10:56 2014	(r268479)
+++ head/sys/dev/virtio/virtqueue.h	Thu Jul 10 05:26:01 2014	(r268480)
@@ -86,6 +86,7 @@ vm_paddr_t virtqueue_paddr(struct virtqu
 int	 virtqueue_full(struct virtqueue *vq);
 int	 virtqueue_empty(struct virtqueue *vq);
 int	 virtqueue_size(struct virtqueue *vq);
+int	 virtqueue_nfree(struct virtqueue *vq);
 int	 virtqueue_nused(struct virtqueue *vq);
 void	 virtqueue_notify(struct virtqueue *vq);
 void	 virtqueue_dump(struct virtqueue *vq);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407100526.s6A5Q1IM059855>