[ovs-dev,v12,6/8] dp-packet: Add 'dp_packet_batch_is_full()' api.

Message ID 1549853790-43330-7-git-send-email-dlu998@gmail.com
State Changes Requested
Headers show
Series
  • Userspace datapath: Add fragmentation support.
Related show

Commit Message

Darrell Ball Feb. 11, 2019, 2:56 a.m.
This new api is used in a subsequent patch and may otherwise be useful.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
---
 lib/dp-packet.h | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index a6e2a4f..034b81b 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -804,6 +804,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)