Skip to content

Commit

Permalink
lib: Use nl_attr_get_odp_port().
Browse files Browse the repository at this point in the history
This helper is a little tidier than the alternative. Use it treewide.

Signed-off-by: Joe Stringer <[email protected]>
Acked-by: Simon Horman <[email protected]>
  • Loading branch information
joestringer committed Nov 16, 2016
1 parent 048318e commit 8611f9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,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;
Expand Down Expand Up @@ -4455,7 +4455,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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/odp-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-sflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8611f9a

Please sign in to comment.