}
do {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
uint64_t buf_stub[4096 / 8];
struct ofpbuf buf;
}
shash_destroy(&device_shash);
} else if (error != EAGAIN) {
- VLOG_WARN_RL(&rl, "error reading or parsing netlink (%s)",
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_WARN_RL(&rll, "error reading or parsing netlink (%s)",
ovs_strerror(error));
}
ofpbuf_uninit(&buf);
struct netdev_linux *netdev = netdev_linux_cast(netdev_);
const char *name = netdev_->name;
if (!strcmp(name, "default") || !strcmp(name, "all")) {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
- VLOG_WARN_RL(&rl, "%s: Linux forbids network device with this name",
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 1);
+ VLOG_WARN_RL(&rll, "%s: Linux forbids network device with this name",
name);
return EINVAL;
}
const struct vl_mff_map *vl_mff_map, uint64_t *tlv_bitmap,
struct ofpbuf *ofpacts)
{
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
struct ofpact_bundle *bundle;
uint32_t slave_type;
size_t slaves_size, i;
error = OFPERR_OFPBAC_BAD_ARGUMENT;
if (!flow_hash_fields_valid(bundle->fields)) {
- VLOG_WARN_RL(&rl, "unsupported fields %d", (int) bundle->fields);
+ VLOG_WARN_RL(&rll, "unsupported fields %d", (int) bundle->fields);
} else if (bundle->n_slaves > BUNDLE_MAX_SLAVES) {
- VLOG_WARN_RL(&rl, "too many slaves");
+ VLOG_WARN_RL(&rll, "too many slaves");
} else if (bundle->algorithm != NX_BD_ALG_HRW
&& bundle->algorithm != NX_BD_ALG_ACTIVE_BACKUP) {
- VLOG_WARN_RL(&rl, "unsupported algorithm %d", (int) bundle->algorithm);
+ VLOG_WARN_RL(&rll, "unsupported algorithm %d", (int) bundle->algorithm);
} else if (slave_type != mf_nxm_header(MFF_IN_PORT)) {
- VLOG_WARN_RL(&rl, "unsupported slave type %"PRIu32, slave_type);
+ VLOG_WARN_RL(&rll, "unsupported slave type %"PRIu32, slave_type);
} else {
error = 0;
}
if (!is_all_zeros(nab->zero, sizeof nab->zero)) {
- VLOG_WARN_RL(&rl, "reserved field is nonzero");
+ VLOG_WARN_RL(&rll, "reserved field is nonzero");
error = OFPERR_OFPBAC_BAD_ARGUMENT;
}
}
if (bundle->dst.n_bits < 16) {
- VLOG_WARN_RL(&rl, "bundle_load action requires at least 16 bit "
+ VLOG_WARN_RL(&rll, "bundle_load action requires at least 16 bit "
"destination.");
error = OFPERR_OFPBAC_BAD_ARGUMENT;
}
} else {
if (nab->ofs_nbits || nab->dst) {
- VLOG_WARN_RL(&rl, "bundle action has nonzero reserved fields");
+ VLOG_WARN_RL(&rll, "bundle action has nonzero reserved fields");
error = OFPERR_OFPBAC_BAD_ARGUMENT;
}
}
if (slaves_size < bundle->n_slaves * sizeof(ovs_be16)) {
- VLOG_WARN_RL(&rl, "Nicira action %s only has %"PRIuSIZE" bytes "
+ VLOG_WARN_RL(&rll, "Nicira action %s only has %"PRIuSIZE" bytes "
"allocated for slaves. %"PRIuSIZE" bytes are required "
"for %u slaves.",
load ? "bundle_load" : "bundle", slaves_size,
} else {
*ofp10_port = OFPP_NONE;
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
- VLOG_WARN_RL(&rl, "port %"PRIu32" is outside the supported "
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_WARN_RL(&rll, "port %"PRIu32" is outside the supported "
"range 0 through %d or 0x%"PRIx32" through 0x%"PRIx32,
ofp11_port_h, ofp_to_u16(OFPP_MAX) - 1,
ofp11_to_u32(OFPP11_MAX), UINT32_MAX);
LIST_FOR_EACH_POP (pin, list_node, txq) {
if (rconn_send_with_limit(ofconn->rconn, pin,
ofconn->packet_in_counter, 100) == EAGAIN) {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(5, 5);
- VLOG_INFO_RL(&rl, "%s: dropping packet-in due to queue overflow",
+ VLOG_INFO_RL(&rll, "%s: dropping packet-in due to queue overflow",
rconn_get_name(ofconn->rconn));
}
}
const struct nlattr *userdata, struct ofpbuf *actions,
struct flow_wildcards *wc, struct ofpbuf *put_actions, void *aux)
{
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
struct udpif *udpif = aux;
struct upcall upcall;
bool megaflow;
}
if (upcall.ukey && !ukey_install(udpif, upcall.ukey)) {
- VLOG_WARN_RL(&rl, "upcall_cb failure: ukey installation fails");
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 1);
+ VLOG_WARN_RL(&rll, "upcall_cb failure: ukey installation fails");
error = ENOSPC;
}
out:
error = xlate_key(udpif, key, key_len, push, &ctx);
if (error) {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
-
- VLOG_WARN_RL(&rl, "xlate_key failed (%s)!",
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_WARN_RL(&rll, "xlate_key failed (%s)!",
ovs_strerror(error));
} else {
xlate_out_uninit(&ctx.xout);
static void
log_unexpected_flow(const struct dpif_flow *flow, int error)
{
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 60);
struct ds ds = DS_EMPTY_INITIALIZER;
ds_put_format(&ds, "Failed to acquire udpif_key corresponding to "
"unexpected flow (%s): ", ovs_strerror(error));
odp_format_ufid(&flow->ufid, &ds);
- VLOG_WARN_RL(&rl, "%s", ds_cstr(&ds));
+
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(10, 60);
+ VLOG_WARN_RL(&rll, "%s", ds_cstr(&ds));
+
ds_destroy(&ds);
}
static void
send_pdu_cb(void *port_, const void *pdu, size_t pdu_size)
{
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 10);
struct ofport_dpif *port = port_;
struct eth_addr ea;
int error;
ofproto_dpif_send_packet(port, false, &packet);
dp_packet_uninit(&packet);
} else {
- VLOG_ERR_RL(&rl, "port %s: cannot obtain Ethernet address of iface "
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 10);
+ VLOG_ERR_RL(&rll, "port %s: cannot obtain Ethernet address of iface "
"%s (%s)", port->bundle->name,
netdev_get_name(port->up.netdev), ovs_strerror(error));
}
}
if (n_errors) {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
- VLOG_WARN_RL(&rl, "bond %s: %d errors sending %d gratuitous learning "
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_WARN_RL(&rll, "bond %s: %d errors sending %d gratuitous learning "
"packets, last error was: %s",
bundle->name, n_errors, n_packets, ovs_strerror(error));
} else {
static void
report_unsupported_act(const char *action, const char *detail)
{
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
- VLOG_WARN_RL(&rl, "Rejecting %s action because datapath does not support"
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_WARN_RL(&rll, "Rejecting %s action because datapath does not support"
"%s%s (your kernel module may be out of date)",
action, detail ? " " : "", detail ? detail : "");
}
ofproto_flow_mod_learn_finish(ofm, NULL);
}
} else {
- static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
- VLOG_INFO_RL(&rl, "Learn limit for flow %"PRIu64" reached.",
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_INFO_RL(&rll, "Learn limit for flow %"PRIu64" reached.",
rule->flow_cookie);
ofproto_flow_mod_uninit(ofm);