On 4/1/2020 2:10 PM, Matteo Croce wrote: > DPDK polls the packet in a busy loop. This means that CPU constantly spins > looking for packets, regardless of the network traffic. > DPDK does this to reduce latency and avoid using interrupts, at expense of > efficiency: this might consume more processing power and generate more heat > than needed, potentially increasing the TCO of a DPDK appliance. > > Here comes DPDKoin. DPDKoin is a DPDK PMD, which instead of moving > packets, mines cryptocurrencies. > DPDKoin just does a few calculations to every poll cycle, this means that > when the network is loaded, DPDKoin consumes just a few cycles, but when > there is no traffic, DPDKoin mines currencies in a busy loop. > The coins are mined with no extra consumption, as the CPU would spin > anyway.
:) <...> > + /* finally assign rx and tx ops */ > + if (packet_copy) { > + eth_dev->rx_pkt_burst = eth_dpdkoin_copy_rx; > + eth_dev->tx_pkt_burst = eth_dpdkoin_copy_tx; > + } else { > + eth_dev->rx_pkt_burst = eth_dpdkoin_rx; > + eth_dev->tx_pkt_burst = eth_dpdkoin_tx; > + } This is the biggest give away, but still good job :)