VLOG_WARN_RL(&rl, "%s: cannot send BPDU on port %d "
"with unknown MAC", ofproto->up.name, port_num);
} else {
- int error = netdev_send(ofport->up.netdev, pkt);
- if (error) {
- VLOG_WARN_RL(&rl, "%s: sending BPDU on port %s failed (%s)",
- ofproto->up.name,
- netdev_get_name(ofport->up.netdev),
- strerror(error));
- }
+ send_packet(ofproto_dpif_cast(ofport->up.ofproto),
+ ofport->odp_port, pkt);
}
}
ofpbuf_delete(pkt);
if (sp) {
ofport->stp_port = NULL;
stp_port_disable(sp);
+ update_stp_port_state(ofport);
}
return 0;
} else if (sp && stp_port_no(sp) != s->port_num
pdu_size);
memcpy(packet_pdu, pdu, pdu_size);
- error = netdev_send(port->up.netdev, &packet);
- if (error) {
- VLOG_WARN_RL(&rl, "port %s: sending LACP PDU on iface %s failed "
- "(%s)", port->bundle->name,
- netdev_get_name(port->up.netdev), strerror(error));
- }
+ send_packet(ofproto_dpif_cast(port->up.ofproto), port->odp_port,
+ &packet);
ofpbuf_uninit(&packet);
} else {
VLOG_ERR_RL(&rl, "port %s: cannot obtain Ethernet address of iface "
error = n_packets = n_errors = 0;
LIST_FOR_EACH (e, lru_node, &ofproto->ml->lrus) {
if (e->port.p != bundle) {
- int ret = bond_send_learning_packet(bundle->bond, e->mac, e->vlan);
+ struct ofpbuf *learning_packet;
+ struct ofport_dpif *port;
+ int ret;
+
+ learning_packet = bond_compose_learning_packet(bundle->bond, e->mac,
+ e->vlan,
+ (void **)&port);
+ ret = send_packet(ofproto_dpif_cast(port->up.ofproto),
+ port->odp_port, learning_packet);
+ ofpbuf_delete(learning_packet);
if (ret) {
error = ret;
n_errors++;
}
cls = &ofproto->up.tables[table_id];
- if (flow->tos_frag & FLOW_FRAG_ANY
+ if (flow->frag & FLOW_FRAG_ANY
&& ofproto->up.frag_handling == OFPC_FRAG_NORMAL) {
/* For OFPC_NORMAL frag_handling, we must pretend that transport ports
* are unavailable. */
commit_set_nw_action(const struct flow *flow, struct flow *base,
struct ofpbuf *odp_actions)
{
- int frag = base->tos_frag & FLOW_FRAG_MASK;
struct ovs_key_ipv4 ipv4_key;
if (base->dl_type != htons(ETH_TYPE_IP) ||
if (base->nw_src == flow->nw_src &&
base->nw_dst == flow->nw_dst &&
- base->tos_frag == flow->tos_frag) {
+ base->tos == flow->tos &&
+ base->frag == flow->frag) {
return;
}
ipv4_key.ipv4_src = base->nw_src = flow->nw_src;
ipv4_key.ipv4_dst = base->nw_dst = flow->nw_dst;
ipv4_key.ipv4_proto = base->nw_proto;
- ipv4_key.ipv4_tos = flow->tos_frag & IP_DSCP_MASK;
- ipv4_key.ipv4_frag = (frag == 0 ? OVS_FRAG_TYPE_NONE
- : frag == FLOW_FRAG_ANY ? OVS_FRAG_TYPE_FIRST
+ ipv4_key.ipv4_tos = flow->tos;
+ ipv4_key.ipv4_frag = (base->frag == 0 ? OVS_FRAG_TYPE_NONE
+ : base->frag == FLOW_FRAG_ANY ? OVS_FRAG_TYPE_FIRST
: OVS_FRAG_TYPE_LATER);
commit_action__(odp_actions, OVS_ACTION_ATTR_SET,
break;
case OFPUTIL_OFPAT_SET_NW_TOS:
- ctx->flow.tos_frag &= ~IP_DSCP_MASK;
- ctx->flow.tos_frag |= ia->nw_tos.nw_tos & IP_DSCP_MASK;
+ ctx->flow.tos &= ~IP_DSCP_MASK;
+ ctx->flow.tos |= ia->nw_tos.nw_tos & IP_DSCP_MASK;
break;
case OFPUTIL_OFPAT_SET_TP_SRC:
ctx->table_id = 0;
ctx->exit = false;
- if (ctx->flow.tos_frag & FLOW_FRAG_ANY) {
+ if (ctx->flow.frag & FLOW_FRAG_ANY) {
switch (ctx->ofproto->up.frag_handling) {
case OFPC_FRAG_NORMAL:
/* We must pretend that transport ports are unavailable. */
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
int error;
+ if (flow->in_port >= ofproto->max_ports && flow->in_port < OFPP_MAX) {
+ return ofp_mkerr_nicira(OFPET_BAD_REQUEST, NXBRC_BAD_IN_PORT);
+ }
+
error = validate_actions(ofp_actions, n_ofp_actions, flow,
ofproto->max_ports);
if (!error) {
: NULL);
}
+static void
+ofproto_unixctl_fdb_flush(struct unixctl_conn *conn,
+ const char *args, void *aux OVS_UNUSED)
+{
+ const struct ofproto_dpif *ofproto;
+
+ ofproto = ofproto_dpif_lookup(args);
+ if (!ofproto) {
+ unixctl_command_reply(conn, 501, "no such bridge");
+ return;
+ }
+ mac_learning_flush(ofproto->ml);
+
+ unixctl_command_reply(conn, 200, "table successfully flushed");
+}
+
static void
ofproto_unixctl_fdb_show(struct unixctl_conn *conn,
const char *args, void *aux OVS_UNUSED)
unixctl_command_register("ofproto/trace",
"bridge {tun_id in_port packet | odp_flow [-generate]}",
ofproto_unixctl_trace, NULL);
+ unixctl_command_register("fdb/flush", "bridge", ofproto_unixctl_fdb_flush,
+ NULL);
unixctl_command_register("fdb/show", "bridge", ofproto_unixctl_fdb_show,
NULL);
unixctl_command_register("ofproto/clog", "", ofproto_dpif_clog, NULL);