Skip to content

Commit

Permalink
tc: Send csum action only if we need to update csum
Browse files Browse the repository at this point in the history
Currently we send the tc csum action even if it's not needed.
Fix that by sending it only if csum update flags isn't zero.

Signed-off-by: Paul Blakey <[email protected]>
Reviewed-by: Roi Dayan <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
Paul Blakey authored and shorman-netronome committed Nov 23, 2017
1 parent fbaf1bf commit a7ce5b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,11 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct tc_flower *flower)
}
nl_msg_end_nested(request, act_offset);

act_offset = nl_msg_start_nested(request, act_index++);
nl_msg_put_act_csum(request, flower->csum_update_flags);
nl_msg_end_nested(request, act_offset);
if (flower->csum_update_flags) {
act_offset = nl_msg_start_nested(request, act_index++);
nl_msg_put_act_csum(request, flower->csum_update_flags);
nl_msg_end_nested(request, act_offset);
}
}
if (flower->set.set) {
act_offset = nl_msg_start_nested(request, act_index++);
Expand Down

0 comments on commit a7ce5b8

Please sign in to comment.