mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
Minor performance optimisation.
This commit is contained in:
11
src/bbl_io.c
11
src/bbl_io.c
@ -35,11 +35,6 @@ bbl_io_packet_mmap_rx_job (timer_s *timer) {
|
||||
if (!interface) {
|
||||
return;
|
||||
}
|
||||
ctx = interface->ctx;
|
||||
|
||||
|
||||
/* Get RX timestamp */
|
||||
clock_gettime(CLOCK_MONOTONIC, &interface->rx_timestamp);
|
||||
|
||||
frame_ptr = interface->io.ring_rx + (interface->io.cursor_rx * interface->io.req_rx.tp_frame_size);
|
||||
tphdr = (struct tpacket2_hdr*)frame_ptr;
|
||||
@ -52,8 +47,14 @@ bbl_io_packet_mmap_rx_job (timer_s *timer) {
|
||||
LOG(IO, "Failed to RX poll interface %s", interface->name);
|
||||
}
|
||||
interface->stats.poll_rx++;
|
||||
return;
|
||||
}
|
||||
|
||||
ctx = interface->ctx;
|
||||
|
||||
/* Get RX timestamp */
|
||||
clock_gettime(CLOCK_MONOTONIC, &interface->rx_timestamp);
|
||||
|
||||
while ((tphdr->tp_status & TP_STATUS_USER)) {
|
||||
eth_start = (uint8_t*)tphdr + tphdr->tp_mac;
|
||||
eth_len = tphdr->tp_len;
|
||||
|
Reference in New Issue
Block a user