if (netdev_vport_is_patch(ofport->up.netdev)) {
struct ofport_dpif *peer = ofport_get_peer(ofport);
struct flow old_flow = ctx->xin->flow;
- const struct ofproto_dpif *peer_ofproto;
enum slow_path_reason special;
struct ofport_dpif *in_port;
return;
}
- peer_ofproto = ofproto_dpif_cast(peer->up.ofproto);
- if (peer_ofproto->backer != ctx->ofproto->backer) {
- xlate_report(ctx, "Patch port peer on a different datapath");
- return;
- }
-
ctx->ofproto = ofproto_dpif_cast(peer->up.ofproto);
flow->in_port = peer->up.ofp_port;
flow->metadata = htonll(0);
ofport_get_peer(const struct ofport_dpif *ofport_dpif)
{
const struct ofproto_dpif *ofproto;
+ const struct dpif_backer *backer;
const char *peer;
peer = netdev_vport_patch_peer(ofport_dpif->up.netdev);
return NULL;
}
+ backer = ofproto_dpif_cast(ofport_dpif->up.ofproto)->backer;
HMAP_FOR_EACH (ofproto, all_ofproto_dpifs_node, &all_ofproto_dpifs) {
struct ofport *ofport;
+ if (ofproto->backer != backer) {
+ continue;
+ }
+
ofport = shash_find_data(&ofproto->up.port_by_name, peer);
- if (ofport && ofport->ofproto->ofproto_class == &ofproto_dpif_class) {
+ if (ofport) {
return ofport_dpif_cast(ofport);
}
}