That sounds like it would also be possible using rtnetlink. You could
send out a notification whenever you switch the active buffer and have
userspace listen to these and replace the inactive one.

I guess using rtnetlink is possible. However I'm not sure about how to implement it: The first thought was to use RTM_NEWQDISC to send the data to the netem_change() function (similar to tc_qdisc_modify() ). But with this we would need the tcm_handle, tcm_parent arguments etc. which are not known in q_netem.c Therefore we would have to change the parse_qopt() function prototype in order to pass the whole "req" and not only the nlmsghdr.

The second possibility would be to add a new message type, e.g RTM_NETEMDATA. This type would be registered in the netem kernel module with a callback function netem_recv_data(). If this function receives some data it searches for the correct flow, and saves the data in the corresponding buffer.

However, I'm not convinced of any of these options. Do you have an alternative suggestion?


Also, I think you will need a larger cache than 4-8k if you are running higher speeds (100,000 pps, etc), as you probably can't rely on user-space responding reliably every 10ms (or even less time for faster
speeds.)

Increasing the cache size to say 32k for each buffer would be no problem.
Is this enough?



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to