@@ -60,47 +60,43 @@ struct task_result QueueInc::RunTask(void *arg) {
6060 const queue_t qid = (queue_t )(uintptr_t )arg;
6161
6262 bess::PacketBatch batch;
63- struct task_result ret;
6463
6564 uint64_t received_bytes = 0 ;
6665
6766 const int burst = ACCESS_ONCE (burst_);
6867 const int pkt_overhead = 24 ;
6968
70- uint64_t cnt;
7169 batch.set_cnt (p->RecvPackets (qid, batch.pkts (), burst));
72- cnt = batch.cnt ();
70+ uint32_t cnt = batch.cnt ();
7371
7472 if (cnt == 0 ) {
75- ret.packets = 0 ;
76- ret.bits = 0 ;
77- return ret;
73+ return { .block = true , .packets = 0 , .bits = 0 };
7874 }
7975
80- /* NOTE: we cannot skip this step since it might be used by scheduler */
76+ // NOTE: we cannot skip this step since it might be used by scheduler.
8177 if (prefetch_) {
82- for (uint64_t i = 0 ; i < cnt; i++) {
78+ for (uint32_t i = 0 ; i < cnt; i++) {
8379 received_bytes += batch.pkts ()[i]->total_len ();
8480 rte_prefetch0 (batch.pkts ()[i]->head_data ());
8581 }
8682 } else {
87- for (uint64_t i = 0 ; i < cnt; i++) {
83+ for (uint32_t i = 0 ; i < cnt; i++) {
8884 received_bytes += batch.pkts ()[i]->total_len ();
8985 }
9086 }
9187
92- ret = (struct task_result ){
93- .packets = cnt, .bits = (received_bytes + cnt * pkt_overhead) * 8 ,
94- };
95-
9688 if (!(p->GetFlags () & DRIVER_FLAG_SELF_INC_STATS )) {
9789 p->queue_stats [PACKET_DIR_INC ][qid].packets += cnt;
9890 p->queue_stats [PACKET_DIR_INC ][qid].bytes += received_bytes;
9991 }
10092
10193 RunNextModule (&batch);
10294
103- return ret;
95+ return {
96+ .block = false ,
97+ .packets = cnt,
98+ .bits = (received_bytes + cnt * pkt_overhead) * 8
99+ };
104100}
105101
106102CommandResponse QueueInc::CommandSetBurst (
0 commit comments