[ovs-dev] [PATCH 1/3] netdev: Reuse netdev_ref() in netdev_rxq_open().

Joe Stringer joestringer at nicira.com
Fri May 2 01:13:41 UTC 2014


netdev_rxq_open() open-codes much of netdev_ref(), so re-use that
function instead.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
 lib/netdev.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/netdev.c b/lib/netdev.c
index 2fc1834..6f997fd 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -554,10 +554,7 @@ netdev_rxq_open(struct netdev *netdev, struct netdev_rxq **rxp, int id)
             rx->queue_id = id;
             error = netdev->netdev_class->rxq_construct(rx);
             if (!error) {
-                ovs_mutex_lock(&netdev_mutex);
-                netdev->ref_cnt++;
-                ovs_mutex_unlock(&netdev_mutex);
-
+                netdev_ref(netdev);
                 *rxp = rx;
                 return 0;
             }
-- 
1.7.10.4




More information about the dev mailing list