Skip to content

Commit

Permalink
dp-packet: Copy flow mark on packet clone.
Browse files Browse the repository at this point in the history
Dummy interfaces clones dp-packet while 'receive' appctl processing.
In general, we should do this anyway to avoid any possible issues in
the future with real interfaces.

Acked-by: Flavio Leitner <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: Ian Stokes <[email protected]>
  • Loading branch information
igsilya authored and istokes committed Mar 13, 2019
1 parent 0f706b3 commit 761398f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/dp-packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct dp_packet *
dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom)
{
struct dp_packet *new_buffer;
uint32_t mark;

new_buffer = dp_packet_clone_data_with_headroom(dp_packet_data(buffer),
dp_packet_size(buffer),
Expand All @@ -179,6 +180,9 @@ dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom)
if (dp_packet_rss_valid(buffer)) {
dp_packet_set_rss_hash(new_buffer, dp_packet_get_rss_hash(buffer));
}
if (dp_packet_has_flow_mark(buffer, &mark)) {
dp_packet_set_flow_mark(new_buffer, mark);
}

return new_buffer;
}
Expand Down

0 comments on commit 761398f

Please sign in to comment.