/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "coverage.h"
#include "dpctl.h"
#include "dp-packet.h"
+#include "dpif-netdev.h"
#include "dynamic-string.h"
#include "flow.h"
#include "netdev.h"
#include "shash.h"
#include "sset.h"
#include "timeval.h"
-#include "tnl-arp-cache.h"
+#include "tnl-neigh-cache.h"
#include "tnl-ports.h"
#include "util.h"
+#include "uuid.h"
#include "valgrind.h"
#include "openvswitch/vlog.h"
tnl_conf_seq = seq_create();
dpctl_unixctl_register();
tnl_port_map_init();
- tnl_arp_cache_init();
+ tnl_neigh_cache_init();
route_table_init();
for (i = 0; i < ARRAY_SIZE(base_dpif_classes); i++) {
ovsthread_once_done(&once);
}
hash_bytes128(key, key_len, secret, hash);
+ uuid_set_bits_v4((struct uuid *)hash);
}
/* Deletes all flows from 'dpif'. Returns 0 if successful, otherwise a
error = dpif_flow_get(dpif, key->data, key->size, ufid,
PMD_ID_NULL, &reply, &flow);
if (!error
- && (!ufid || (flow.ufid_present && ovs_u128_equal(ufid, &flow.ufid)))) {
+ && (!ufid || (flow.ufid_present
+ && ovs_u128_equals(ufid, &flow.ufid)))) {
enable_feature = true;
}
ovs_assert(cnt == 1);
switch ((enum ovs_action_attr)type) {
+ case OVS_ACTION_ATTR_CT:
case OVS_ACTION_ATTR_OUTPUT:
case OVS_ACTION_ATTR_TUNNEL_PUSH:
case OVS_ACTION_ATTR_TUNNEL_POP:
struct ofpbuf execute_actions;
uint64_t stub[256 / 8];
struct pkt_metadata *md = &packet->md;
+ bool dst_set;
- if (md->tunnel.ip_dst) {
+ dst_set = flow_tnl_dst_is_set(&md->tunnel);
+ if (dst_set) {
/* The Linux kernel datapath throws away the tunnel information
* that we supply as metadata. We have to use a "set" action to
* supply it. */
execute.packet = packet;
execute.needs_help = false;
execute.probe = false;
+ execute.mtu = 0;
aux->error = dpif_execute(aux->dpif, &execute);
log_execute_message(aux->dpif, &execute, true, aux->error);
- if (md->tunnel.ip_dst) {
+ if (dst_set) {
ofpbuf_uninit(&execute_actions);
}
break;
return error;
}
+void
+dpif_register_dp_purge_cb(struct dpif *dpif, dp_purge_callback *cb, void *aux)
+{
+ if (dpif->dpif_class->register_dp_purge_cb) {
+ dpif->dpif_class->register_dp_purge_cb(dpif, cb, aux);
+ }
+}
+
void
dpif_register_upcall_cb(struct dpif *dpif, upcall_callback *cb, void *aux)
{
/* If 'dpif' creates its own I/O polling threads, refreshes poll threads
* configuration. */
int
-dpif_poll_threads_set(struct dpif *dpif, unsigned int n_rxqs,
- const char *cmask)
+dpif_poll_threads_set(struct dpif *dpif, const char *cmask)
{
int error = 0;
if (dpif->dpif_class->poll_threads_set) {
- error = dpif->dpif_class->poll_threads_set(dpif, n_rxqs, cmask);
+ error = dpif->dpif_class->poll_threads_set(dpif, cmask);
if (error) {
log_operation(dpif, "poll_threads_set", error);
}
static bool
should_log_flow_message(int error)
{
- return !vlog_should_drop(THIS_MODULE, flow_message_log_level(error),
+ return !vlog_should_drop(&this_module, flow_message_log_level(error),
error ? &error_rl : &dpmsg_rl);
}
ds_put_cstr(&ds, ", actions:");
format_odp_actions(&ds, actions, actions_len);
}
- vlog(THIS_MODULE, flow_message_log_level(error), "%s", ds_cstr(&ds));
+ vlog(&this_module, flow_message_log_level(error), "%s", ds_cstr(&ds));
ds_destroy(&ds);
}
ds_put_format(&ds, " failed (%s)", ovs_strerror(error));
}
ds_put_format(&ds, " on packet %s", packet);
- vlog(THIS_MODULE, error ? VLL_WARN : VLL_DBG, "%s", ds_cstr(&ds));
+ ds_put_format(&ds, " mtu %d", execute->mtu);
+ vlog(&this_module, error ? VLL_WARN : VLL_DBG, "%s", ds_cstr(&ds));
ds_destroy(&ds);
free(packet);
}
bool
dpif_supports_tnl_push_pop(const struct dpif *dpif)
{
- return !strcmp(dpif->dpif_class->type, "netdev") ||
- !strcmp(dpif->dpif_class->type, "dummy");
+ return dpif_is_netdev(dpif);
}