summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDarrell Ball <dlu998@gmail.com>2019-02-13 15:34:19 -0800
committerBen Pfaff <blp@ovn.org>2019-02-14 11:39:21 -0800
commit1aa7bbca923fc6633b0912143d0f3c481cbf027f (patch)
treec9947121e4ca1c767576db891abde0b480e3e876 /lib
parente981a45a6cae409260612d8619769e37cf553668 (diff)
downloadopenvswitch-1aa7bbca923fc6633b0912143d0f3c481cbf027f.tar.gz
dp-packet: Add 'dp_packet_batch_is_full()' api.
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/dp-packet.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index 26cfcb93d..31c26e53a 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -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)