Re: Regarding bottlenecks for high speed packet generation
flat view
From: Ajith Adapa <hidden>
Date: 2012-10-27 03:56:25
Hi,
The network core needs to account and limit how much memory is allocated to socket buffers. Completed TX buffers should therefore be freed promptly, to avoid blocking the sending socket unnecessarily. It doesn't strictly matter whether this is triggered by an IRQ from the NIC or by a timer, but it certainly must not be triggered by the next TX initiation as this may result in a kind of deadlock.
My understanding is when an SKB is created we create it from the amount of socket send buffer and sent to device driver which sends to the hardware for transmission. Once the NIC is done transmitting the packet an interrupt allows the SKB to be freed returning the same amount of memory back to socket send buffer. I can see that even if I allocate 150MB for socket TX buffer size after generating around 14k packets the memory is exhausted. So ideally it means NIC is not able to transmit the data at the rate it is being received data from user. As @dan mentioned earlier I have tried pktgen generating a 1500byte packets. I can reach not more than 72MB/s but the CPU utilization has peaked 80% on the core on which pktgen is binded with. Regards, Ajith