@@ -48,6 +48,7 @@
#include "match.h"
#include "netdev.h"
#include "netdev-dpdk.h"
+#include "netdev-provider.h"
#include "netdev-vport.h"
#include "netlink.h"
#include "odp-execute.h"
@@ -2524,7 +2524,9 @@ dp_netdev_process_rxq_port(struct dp_netdev_pmd_thread *pmd,
int error, cnt;
cycles_count_start(pmd);
+ ovs_refcount_ref(&rxq->ref_cnt);
error = netdev_rxq_recv(rxq, packets, &cnt);
+ ovs_assert(ovs_refcount_unref_relaxed(&rxq->ref_cnt) == 2);
cycles_count_end(pmd, PMD_CYCLES_POLLING);
if (!error) {
int i;
@@ -22,6 +22,7 @@
#include "connectivity.h"
#include "netdev.h"
#include "list.h"
+#include "ovs-atomic.h"
#include "ovs-numa.h"
#include "packets.h"
#include "seq.h"
@@ -88,6 +89,7 @@ struct netdev **netdev_get_vports(size_t *size);
struct netdev_rxq {
struct netdev *netdev; /* Owns a reference to the netdev. */
int queue_id;
+ struct ovs_refcount ref_cnt;
};
struct netdev *netdev_rxq_get_netdev(const struct netdev_rxq *);
@@ -601,6 +601,7 @@ netdev_rxq_open(struct netdev *netdev, struct netdev_rxq **rxp, int id)
if (rx) {
rx->netdev = netdev;
rx->queue_id = id;
+ ovs_refcount_init(&rx->ref_cnt);
error = netdev->netdev_class->rxq_construct(rx);
if (!error) {
netdev_ref(netdev);