@@ -561,23 +561,23 @@ int main(int argc, char **argv)
561561 while (!nm_ring_empty (rxring )) {
562562 struct overflow_queue * q ;
563563 struct netmap_slot * rs = next_slot ;
564- next_cur = nm_ring_next (rxring , next_cur );
565- next_slot = & rxring -> slot [next_cur ];
566564
567565 // CHOOSE THE CORRECT OUTPUT PIPE
568- next_buf = NETMAP_BUF (rxring , next_slot -> buf_idx );
569- __builtin_prefetch (next_buf );
570- // 'B' is just a hashing seed
571566 uint32_t hash = pkt_hdr_hash ((const unsigned char * )next_buf , 4 , 'B' );
572567 if (hash == 0 )
573568 non_ip ++ ; // XXX ??
569+ // prefetch the buffer for the next round
570+ next_cur = nm_ring_next (rxring , next_cur );
571+ next_slot = & rxring -> slot [next_cur ];
572+ next_buf = NETMAP_BUF (rxring , next_slot -> buf_idx );
573+ __builtin_prefetch (next_buf );
574+ // 'B' is just a hashing seed
574575 uint32_t output_port = hash % glob_arg .output_rings ;
575576 struct port_des * port = & ports [output_port ];
576577 struct netmap_ring * ring = port -> ring ;
577578 uint32_t free_buf ;
578579
579580 // Move the packet to the output pipe.
580- retry :
581581 if (nm_ring_space (ring )) {
582582 struct netmap_slot * ts = & ring -> slot [ring -> cur ];
583583 free_buf = ts -> buf_idx ;
@@ -590,17 +590,6 @@ int main(int argc, char **argv)
590590 goto forward ;
591591 }
592592
593- /* try to push packets down to free some space
594- * in the pipe (no more than once per loop on
595- * the same pipe, to make sure that there is a
596- * reasonable amount of time between syncs)
597- */
598- if (port -> last_sync != iter ) {
599- port -> last_sync = iter ;
600- ioctl (port -> nmd -> fd , NIOCTXSYNC , NULL );
601- goto retry ;
602- }
603-
604593 /* use the overflow queue, if available */
605594 if (!oq ) {
606595 dropped ++ ;
0 commit comments