summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2023-02-07 15:06:07 +0100
committerIlya Maximets <i.maximets@ovn.org>2023-02-09 00:32:55 +0100
commitd57299fc6cb3fc802faaa56e41514f28b87477de (patch)
tree97b8c6aadc254fe5179cd9fe13674431e4aab671 /lib
parent25b6f5585ba04e92560ef7f5cd37826caf54cc68 (diff)
downloadopenvswitch-d57299fc6cb3fc802faaa56e41514f28b87477de.tar.gz
odp-util: Make odp_flow_key_from_flow__ nlattr order the same as the kernel.
Make the order of the Netlink attributes for odp_flow_key_from_flow__() the same as the kernel will return them. This will make sure the attributes displayed in the dpctl/dump-flows output appear in the same order for all datapath. Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Tested-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/odp-util.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c
index 5fc312f8c..dbd4554d0 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -6204,6 +6204,11 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
const struct flow *mask = parms->mask;
const struct flow *data = export_mask ? mask : flow;
+ if (parms->support.recirc) {
+ nl_msg_put_u32(buf, OVS_KEY_ATTR_RECIRC_ID, data->recirc_id);
+ nl_msg_put_u32(buf, OVS_KEY_ATTR_DP_HASH, data->dp_hash);
+ }
+
nl_msg_put_u32(buf, OVS_KEY_ATTR_PRIORITY, data->skb_priority);
if (flow_tnl_dst_is_set(&flow->tunnel) ||
@@ -6212,6 +6217,12 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
parms->key_buf, NULL);
}
+ /* Add an ingress port attribute if this is a mask or 'in_port.odp_port'
+ * is not the magical value "ODPP_NONE". */
+ if (export_mask || flow->in_port.odp_port != ODPP_NONE) {
+ nl_msg_put_odp_port(buf, OVS_KEY_ATTR_IN_PORT, data->in_port.odp_port);
+ }
+
nl_msg_put_u32(buf, OVS_KEY_ATTR_SKB_MARK, data->pkt_mark);
if (parms->support.ct_state) {
@@ -6255,16 +6266,6 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms,
ct->ipv6_proto = data->ct_nw_proto;
}
}
- if (parms->support.recirc) {
- nl_msg_put_u32(buf, OVS_KEY_ATTR_RECIRC_ID, data->recirc_id);
- nl_msg_put_u32(buf, OVS_KEY_ATTR_DP_HASH, data->dp_hash);
- }
-
- /* Add an ingress port attribute if this is a mask or 'in_port.odp_port'
- * is not the magical value "ODPP_NONE". */
- if (export_mask || flow->in_port.odp_port != ODPP_NONE) {
- nl_msg_put_odp_port(buf, OVS_KEY_ATTR_IN_PORT, data->in_port.odp_port);
- }
nl_msg_put_be32(buf, OVS_KEY_ATTR_PACKET_TYPE, data->packet_type);