#include "pvector.h"
#include "random.h"
#include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
#include "sset.h"
#include "timeval.h"
#include "tnl-neigh-cache.h"
pthread_t thread;
unsigned core_id; /* CPU core id of this pmd thread. */
int numa_id; /* numa node id of this pmd thread. */
- atomic_int tx_qid; /* Queue id used by this pmd thread to
- * send packets on all netdevs */
+
+ /* Queue id used by this pmd thread to send packets on all netdevs.
+ * All tx_qid's are unique and less than 'ovs_numa_get_n_cores() + 1'. */
+ atomic_int tx_qid;
struct ovs_mutex port_mutex; /* Mutex for 'poll_list' and 'tx_ports'. */
/* List of rx queues to poll. */
}
}
-static bool
-cmask_equals(const char *a, const char *b)
-{
- if (a && b) {
- return !strcmp(a, b);
- }
-
- return a == NULL && b == NULL;
-}
-
/* Changes the number or the affinity of pmd threads. The changes are actually
* applied in dpif_netdev_run(). */
static int
{
struct dp_netdev *dp = get_dp_netdev(dpif);
- if (!cmask_equals(dp->requested_pmd_cmask, cmask)) {
+ if (!nullable_string_is_equal(dp->requested_pmd_cmask, cmask)) {
free(dp->requested_pmd_cmask);
dp->requested_pmd_cmask = nullable_xstrdup(cmask);
}
dp_netdev_pmd_unref(non_pmd);
- if (!cmask_equals(dp->pmd_cmask, dp->requested_pmd_cmask)
+ if (!nullable_string_is_equal(dp->pmd_cmask, dp->requested_pmd_cmask)
|| ports_require_restart(dp)) {
reconfigure_pmd_threads(dp);
}
int poll_cnt;
int i;
- poll_cnt = 0;
poll_list = NULL;
/* Stores the pmd thread's 'pmd' to 'per_pmd_key'. */
lc = 0;
- emc_cache_slow_sweep(&pmd->flow_cache);
coverage_try_clear();
- ovsrcu_quiesce();
+ if (!ovsrcu_try_quiesce()) {
+ emc_cache_slow_sweep(&pmd->flow_cache);
+ }
atomic_read_relaxed(&pmd->change_seq, &seq);
if (seq != port_seq) {