There was little point in taking the dp_mutex farther down in the
code than dp_genl_openflow, since that function is already completely
serialized by genl_rcv across the genl_mutex. We could get rid of
dp_mutex completely, except that we still need it to serialize timeout.
This has two notable omissions. First, only at most 4k of flow statistics
are reported. Second, aggregate statistics are not yet supported. Both
of these are fairly easily fixable, just not fixed yet.
We want to allow multiple OpenFlow connections to a switch, so that
dpctl and other management tools can also connect to a switch that
is connecte to the controller. These tools will want to fetch the
information in the data_hello message, but currently this can only
be done by sending a control_hello message, which changes the
switch configuration state. So breaking the hello messages up into
multiple different messages, only some of which affect configuration
state, cures the problem.
Also, clean up the kernel datapath a bit, by adding helper functions
for allocating and resizing Generic Netlink messages that encapsulate
OpenFlow messages.
This is required on the Quanta platform, which needs to down a semaphore
inside the timeout implementation.
Also, add a 2.4 compatibility implementation of kthread so that both
2.4 and 2.6 can use the kthread API.