summaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-06-26 03:41:34 +0200
committerDavid S. Miller <davem@davemloft.net>2014-06-27 21:50:55 +0200
commit067608e9d019d6477fd45dd948e81af0e5bf599f (patch)
treecb6cdf5cd95365a97087e9baae2cb4e96a12710a /net/tipc/msg.h
parenttipc: make link mtu easily accessible from socket (diff)
downloadlinux-067608e9d019d6477fd45dd948e81af0e5bf599f.tar.xz
linux-067608e9d019d6477fd45dd948e81af0e5bf599f.zip
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>
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 41a05fa8d608..5e1339d60c69 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -737,4 +737,7 @@ bool tipc_msg_bundle(struct sk_buff *bbuf, struct sk_buff *buf, u32 mtu);
bool tipc_msg_make_bundle(struct sk_buff **buf, u32 mtu, u32 dnode);
+int tipc_msg_build2(struct tipc_msg *mhdr, struct iovec const *iov,
+ int offset, int dsz, int mtu , struct sk_buff **chain);
+
#endif