summaryrefslogtreecommitdiff
path: root/lib/odp-util.c
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2022-02-22 16:26:55 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-21 00:37:41 +0100
commit31b467a751892df2dd938338d91d39e995a6a18c (patch)
treee0518d478cf1595a5f27c9b46bf895b30595afc7 /lib/odp-util.c
parent6d76cfc4449eb9cb850098c23c784a5cb233a77f (diff)
downloadopenvswitch-31b467a751892df2dd938338d91d39e995a6a18c.tar.gz
odp-util: Fix output for tc to be equal to kernel.
When the same flow is programmed in the kernel and tc, they look different due to the way they are translated. They take the userspace approach by always including the packet type attribute. To make the outputs the same, show the ethernet header when the packet type is wildcarded, and not printed. So without the fix the kernel would show (ovs-appctl dpctl/dump-flows): in_port(3),eth(),eth_type(0x0800),ipv4(frag=no), ..., actions:output Where as TC would show: in_port(3),eth_type(0x0800),ipv4(frag=no), ..., actions:output Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/odp-util.c')
-rw-r--r--lib/odp-util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c
index 9a705cffa..3ae850b66 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -4630,6 +4630,11 @@ odp_flow_format(const struct nlattr *key, size_t key_len,
ds_put_char(ds, ',');
}
ds_put_cstr(ds, "eth()");
+ } else if (attr_type == OVS_KEY_ATTR_PACKET_TYPE && is_wildcard) {
+ /* See the above help text, however in the case where the
+ * packet type is not shown, we still need to display the
+ * eth() header if the packets type is wildcarded. */
+ has_packet_type_key = false;
}
ofpbuf_clear(&ofp);
}