This helper is a little tidier than the alternative. Use it treewide. Signed-off-by: Joe Stringer <j...@ovn.org> --- lib/dpif-netdev.c | 4 ++-- lib/odp-util.c | 2 +- ofproto/ofproto-dpif-sflow.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 5049b40fed87..ab95952611d1 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -4380,7 +4380,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_, switch ((enum ovs_action_attr)type) { case OVS_ACTION_ATTR_OUTPUT: - p = pmd_tx_port_cache_lookup(pmd, u32_to_odp(nl_attr_get_u32(a))); + p = pmd_tx_port_cache_lookup(pmd, nl_attr_get_odp_port(a)); if (OVS_LIKELY(p)) { int tx_qid; bool dynamic_txqs; @@ -4425,7 +4425,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_, case OVS_ACTION_ATTR_TUNNEL_POP: if (*depth < MAX_RECIRC_DEPTH) { struct dp_packet_batch *orig_packets_ = packets_; - odp_port_t portno = u32_to_odp(nl_attr_get_u32(a)); + odp_port_t portno = nl_attr_get_odp_port(a); p = pmd_tx_port_cache_lookup(pmd, portno); if (p) { diff --git a/lib/odp-util.c b/lib/odp-util.c index 332698bfed64..626a82ca2c98 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2770,7 +2770,7 @@ format_odp_key_attr(const struct nlattr *a, const struct nlattr *ma, case OVS_KEY_ATTR_IN_PORT: if (portno_names && verbose && is_exact) { char *name = odp_portno_names_get(portno_names, - u32_to_odp(nl_attr_get_u32(a))); + nl_attr_get_odp_port(a)); if (name) { ds_put_format(ds, "%s", name); } else { diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index 9ea8851419b3..37992b4305ea 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -1089,7 +1089,7 @@ dpif_sflow_read_actions(const struct flow *flow, /* Capture the output port in case we need it * to get the output tunnel type. */ - sflow_actions->out_port = u32_to_odp(nl_attr_get_u32(a)); + sflow_actions->out_port = nl_attr_get_odp_port(a); break; case OVS_ACTION_ATTR_TUNNEL_POP: -- 2.9.3 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev