tipc: introduce direct iovec to buffer chain fragmentation function
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 26 Jun 2014 01:41:34 +0000 (20:41 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jun 2014 19:50:55 +0000 (12:50 -0700)
commit067608e9d019d6477fd45dd948e81af0e5bf599f
treecb6cdf5cd95365a97087e9baae2cb4e96a12710a
parent16e166b88cdfd508b88934ec0c8a0ec97e6b30f8
tipc: introduce direct iovec to buffer chain fragmentation function

Fragmentation at message sending is currently performed in two
places in link.c, depending on whether data to be transmitted
is delivered in the form of an iovec or as a big sk_buff. Those
functions are also tightly entangled with the send functions
that are using them.

We now introduce a re-entrant, standalone function, tipc_msg_build2(),
that builds a packet chain directly from an iovec. Each fragment is
sized according to the MTU value given by the caller, and is prepended
with a correctly built fragment header, when needed. The function is
independent from who is calling and where the chain will be delivered,
as long as the caller is able to indicate a correct MTU.

The function is tested, but not called by anybody yet. Since it is
incompatible with the existing tipc_msg_build(), and we cannot yet
remove that function, we have given it a temporary name.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/msg.c
net/tipc/msg.h