Skip to content

Commit

Permalink
dp-packet: Add 'do_not_steal' packet batch flag.
Browse files Browse the repository at this point in the history
This is needed in a subsequent patch and may otherwise be useful.

Signed-off-by: Darrell Ball <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
darball1 authored and blp committed Feb 14, 2019
1 parent 1aa7bbc commit 9f17f10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/dp-packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ enum { NETDEV_MAX_BURST = 32 }; /* Maximum number packets in a batch. */
struct dp_packet_batch {
size_t count;
bool trunc; /* true if the batch needs truncate. */
bool do_not_steal; /* Indicate that the packets should not be stolen. */
struct dp_packet *packets[NETDEV_MAX_BURST];
};

Expand All @@ -762,6 +763,7 @@ dp_packet_batch_init(struct dp_packet_batch *batch)
{
batch->count = 0;
batch->trunc = false;
batch->do_not_steal = false;
}

static inline void
Expand Down
1 change: 1 addition & 0 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,7 @@ dpif_netdev_execute(struct dpif *dpif, struct dpif_execute *execute)
}

dp_packet_batch_init_packet(&pp, execute->packet);
pp.do_not_steal = true;
dp_netdev_execute_actions(pmd, &pp, false, execute->flow,
execute->actions, execute->actions_len);
dp_netdev_pmd_flush_output_packets(pmd, true);
Expand Down

0 comments on commit 9f17f10

Please sign in to comment.