Message ID | 1549853790-43330-7-git-send-email-dlu998@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
Series | Userspace datapath: Add fragmentation support. | expand |
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)
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(+)