@@ -6162,7 +6162,7 @@ xlate_wc_init(struct xlate_ctx *ctx)
netflow_mask_wc(&ctx->xin->flow, ctx->wc);
}
- tnl_wc_init(&ctx->xin->flow, ctx->wc);
+ tnl_wc_init(&ctx->xin->flow, ctx->wc, ctx->xbridge->packet_type_aware);
}
static void
@@ -361,7 +361,8 @@ tnl_process_ecn(struct flow *flow)
}
void
-tnl_wc_init(struct flow *flow, struct flow_wildcards *wc)
+tnl_wc_init(struct flow *flow, struct flow_wildcards *wc,
+ bool packet_type_aware)
{
if (tnl_port_should_receive(flow)) {
wc->masks.tunnel.tun_id = OVS_BE64_MAX;
@@ -386,8 +387,10 @@ tnl_wc_init(struct flow *flow, struct flow_wildcards *wc)
&& IP_ECN_is_ce(flow->tunnel.ip_tos)) {
wc->masks.nw_tos |= IP_ECN_MASK;
}
- /* Match on packet_type for tunneled packets.*/
- wc->masks.packet_type = OVS_BE32_MAX;
+ if (!packet_type_aware) {
+ /* Match on packet_type for tunneled packets.*/
+ wc->masks.packet_type = OVS_BE32_MAX;
+ }
}
}
@@ -566,8 +569,16 @@ tnl_find(const struct flow *flow) OVS_REQ_RDLOCK(rwlock)
match.in_key_flow = in_key_flow;
match.ip_dst_flow = ip_dst_flow;
match.ip_src_flow = ip_src == IP_SRC_FLOW;
- match.is_layer3 = flow->packet_type != htonl(PT_ETH);
-
+ if (pt_ns(flow->packet_type) == OFPHTN_ETHERTYPE) {
+ /* Try to find a layer3 port first. */
+ match.is_layer3 = true;
+ tnl_port = tnl_find_exact(&match, map);
+ if (tnl_port) {
+ return tnl_port;
+ }
+ }
+ /* Check for a non-layer3 or versatile tunnel port. */
+ match.is_layer3 = false;
tnl_port = tnl_find_exact(&match, map);
if (tnl_port) {
return tnl_port;
@@ -39,7 +39,7 @@ int tnl_port_add(const struct ofport_dpif *, const struct netdev *,
void tnl_port_del(const struct ofport_dpif *);
const struct ofport_dpif *tnl_port_receive(const struct flow *);
-void tnl_wc_init(struct flow *, struct flow_wildcards *);
+void tnl_wc_init(struct flow *, struct flow_wildcards *, bool);
bool tnl_process_ecn(struct flow *);
odp_port_t tnl_port_send(const struct ofport_dpif *, struct flow *,
struct flow_wildcards *wc);