Skip to content

Commit

Permalink
dp-packet: Add 'dp_packet_batch_is_full()' api.
Browse files Browse the repository at this point in the history
This new api is used in a subsequent patch and may otherwise be useful.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
darball1 authored and blp committed Feb 14, 2019
1 parent e981a45 commit 1aa7bbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/dp-packet.h
Expand Up @@ -817,6 +817,12 @@ dp_packet_batch_is_empty(const struct dp_packet_batch *batch)
return !dp_packet_batch_size(batch);
}

static inline bool
dp_packet_batch_is_full(const struct dp_packet_batch *batch)
{
return dp_packet_batch_size(batch) == NETDEV_MAX_BURST;
}

#define DP_PACKET_BATCH_FOR_EACH(IDX, PACKET, BATCH) \
for (size_t IDX = 0; IDX < dp_packet_batch_size(BATCH); IDX++) \
if (PACKET = BATCH->packets[IDX], true)
Expand Down

0 comments on commit 1aa7bbc

Please sign in to comment.