On 04/19/2018 01:27 AM, Thomas Huth wrote:
Ah, that's not a memory leak, though it might look like one if you don't know what the vring_send_buf function is doing: vring_send_buf adds a buffer to a virtio ring for later use. So the buffer is not unused after this function, but gets filled in later by the virtio-net device. Thus we must not free the buffer here. We could free it in the "uninit" function after shutting down the device, but OTOH we are then leaving the firmware code anyway by jumping into the OS kernel, so it does not really matter whether we free()ed the buffers or not. Thomas
That makes a lot of sense now :) thanks a lot for that explanation and sorry for my ignorance.