test-conntrack: Restore packet batching to pcap test.
The test accepted but then ignored the batch count argument.
Reported-by: Bhanuprakash Bodireddy
Fixes: ("dp-packet: Enhance packet batch APIs.")
Acked-by: Andy Zhou
@@ -211,17 +211,22 @@ test_pcap(struct ovs_cmdl_context *ctx)
conntrack_init(&ct);
total_count = 0;
- while (!err) {
+ for (;;) {
struct dp_packet *packet;
struct dp_packet_batch pkt_batch_;
struct dp_packet_batch *batch = &pkt_batch_;
dp_packet_batch_init(batch);
+ for (int i = 0; i < batch_size; i++) {
err = ovs_pcap_read(pcap, &packet, NULL);
if (err) {
break;
}
dp_packet_batch_add(batch, packet);
+ }
+ if (!batch->count) {
+ break;
+ }
pcap_batch_execute_conntrack(&ct, batch);
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
