mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
vswitchd: Log all tunnel parameters of given flow.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
@@ -979,6 +979,16 @@ regs_fully_wildcarded(const struct flow_wildcards *wc)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
tun_parms_fully_wildcarded(const struct flow_wildcards *wc)
|
||||
{
|
||||
return (!wc->masks.tunnel.ip_src &&
|
||||
!wc->masks.tunnel.ip_dst &&
|
||||
!wc->masks.tunnel.ip_ttl &&
|
||||
!wc->masks.tunnel.ip_tos &&
|
||||
!wc->masks.tunnel.flags);
|
||||
}
|
||||
|
||||
/* Returns a bit-mask of ofputil_protocols that can be used for sending 'match'
|
||||
* to a switch (e.g. to add or remove a flow). Only NXM can handle tunnel IDs,
|
||||
* registers, or fixing the Ethernet multicast bit. Otherwise, it's better to
|
||||
@@ -990,6 +1000,11 @@ ofputil_usable_protocols(const struct match *match)
|
||||
|
||||
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 18);
|
||||
|
||||
/* tunnel params other than tun_id can't be sent in a flow_mod */
|
||||
if (!tun_parms_fully_wildcarded(wc)) {
|
||||
return OFPUTIL_P_NONE;
|
||||
}
|
||||
|
||||
/* NXM, OXM, and OF1.1 support bitwise matching on ethernet addresses. */
|
||||
if (!eth_mask_is_exact(wc->masks.dl_src)
|
||||
&& !eth_addr_is_zero(wc->masks.dl_src)) {
|
||||
@@ -1630,7 +1645,6 @@ ofputil_flow_mod_usable_protocols(const struct ofputil_flow_mod *fms,
|
||||
usable_protocols &= OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF12_OXM;
|
||||
}
|
||||
}
|
||||
assert(usable_protocols);
|
||||
|
||||
return usable_protocols;
|
||||
}
|
||||
|
Reference in New Issue
Block a user