projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netdev-linux: Fix strict aliasing warnings.
[openvswitch]
/
ofproto
/
ofproto.c
diff --git
a/ofproto/ofproto.c
b/ofproto/ofproto.c
index e4bc1992706c21dead3af54527ccd491b860bd6d..df5850f19d94473927311495b445f8d7ea2b9d25 100644
(file)
--- a/
ofproto/ofproto.c
+++ b/
ofproto/ofproto.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009, 2010 Nicira Networks.
+ * Copyright (c) 2009, 2010
, 2011
Nicira Networks.
* Copyright (c) 2010 Jean Tourrilhes - HP-Labs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Copyright (c) 2010 Jean Tourrilhes - HP-Labs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-1481,7
+1481,8
@@
ofproto_flush_flows(struct ofproto *ofproto)
static void
reinit_ports(struct ofproto *p)
{
static void
reinit_ports(struct ofproto *p)
{
- struct svec devnames;
+ struct shash_node *node;
+ struct shash devnames;
struct ofport *ofport;
struct odp_port *odp_ports;
size_t n_odp_ports;
struct ofport *ofport;
struct odp_port *odp_ports;
size_t n_odp_ports;
@@
-1489,21
+1490,20
@@
reinit_ports(struct ofproto *p)
COVERAGE_INC(ofproto_reinit_ports);
COVERAGE_INC(ofproto_reinit_ports);
- s
vec
_init(&devnames);
+ s
hash
_init(&devnames);
HMAP_FOR_EACH (ofport, hmap_node, &p->ports) {
HMAP_FOR_EACH (ofport, hmap_node, &p->ports) {
- s
vec_add (&devnames, ofport->opp.name
);
+ s
hash_add_once (&devnames, ofport->opp.name, NULL
);
}
dpif_port_list(p->dpif, &odp_ports, &n_odp_ports);
for (i = 0; i < n_odp_ports; i++) {
}
dpif_port_list(p->dpif, &odp_ports, &n_odp_ports);
for (i = 0; i < n_odp_ports; i++) {
- s
vec_add (&devnames, odp_ports[i].devname
);
+ s
hash_add_once (&devnames, odp_ports[i].devname, NULL
);
}
free(odp_ports);
}
free(odp_ports);
- svec_sort_unique(&devnames);
- for (i = 0; i < devnames.n; i++) {
- update_port(p, devnames.names[i]);
+ SHASH_FOR_EACH (node, &devnames) {
+ update_port(p, node->name);
}
}
- s
vec
_destroy(&devnames);
+ s
hash
_destroy(&devnames);
}
static struct ofport *
}
static struct ofport *
@@
-2515,7
+2515,7
@@
static void
send_error_oh(const struct ofconn *ofconn, const struct ofp_header *oh,
int error)
{
send_error_oh(const struct ofconn *ofconn, const struct ofp_header *oh,
int error)
{
- struct ofpbuf *buf =
make_ofp
_error_msg(error, oh);
+ struct ofpbuf *buf =
ofputil_encode
_error_msg(error, oh);
if (buf) {
COVERAGE_INC(ofproto_error);
queue_tx(buf, ofconn, ofconn->reply_counter);
if (buf) {
COVERAGE_INC(ofproto_error);
queue_tx(buf, ofconn, ofconn->reply_counter);
@@
-2623,7
+2623,7
@@
handle_set_config(struct ofconn *ofconn, const struct ofp_switch_config *osc)
/* Maximum depth of flow table recursion (due to NXAST_RESUBMIT actions) in a
* flow translation. */
/* Maximum depth of flow table recursion (due to NXAST_RESUBMIT actions) in a
* flow translation. */
-#define MAX_RESUBMIT_RECURSION
8
+#define MAX_RESUBMIT_RECURSION
16
static void do_xlate_actions(const union ofp_action *in, size_t n_in,
struct action_xlate_ctx *ctx);
static void do_xlate_actions(const union ofp_action *in, size_t n_in,
struct action_xlate_ctx *ctx);
@@
-2681,7
+2681,7
@@
xlate_table_action(struct action_xlate_ctx *ctx, uint16_t in_port)
ctx->recurse--;
}
} else {
ctx->recurse--;
}
} else {
- struct vlog_rate_limit recurse_rl = VLOG_RATE_LIMIT_INIT(1, 1);
+ st
atic st
ruct vlog_rate_limit recurse_rl = VLOG_RATE_LIMIT_INIT(1, 1);
VLOG_ERR_RL(&recurse_rl, "NXAST_RESUBMIT recursed over %d times",
MAX_RESUBMIT_RECURSION);
VLOG_ERR_RL(&recurse_rl, "NXAST_RESUBMIT recursed over %d times",
MAX_RESUBMIT_RECURSION);