From 959e1781aa230aecc90e4deb80117fd9a53dede7 Mon Sep 17 00:00:00 2001 From: Jon Paul Maloy Date: Thu, 22 Oct 2015 08:51:43 -0400 Subject: tipc: introduce jumbo frame support for broadcast Until now, we have only been supporting a fix MTU size of 1500 bytes for all broadcast media, irrespective of their actual capability. We now make the broadcast MTU adaptable to the carrying media, i.e., we use the smallest MTU supported by any of the interfaces attached to TIPC. Signed-off-by: Jon Maloy Reviewed-by: Ying Xue Signed-off-by: David S. Miller --- net/tipc/bcast.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 74ee09ac430d..d8c399d31288 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -148,9 +148,9 @@ void tipc_bclink_input(struct net *net) tipc_sk_mcast_rcv(net, &tn->bcbase->arrvq, &tn->bcbase->inputq); } -uint tipc_bcast_get_mtu(void) +int tipc_bcast_get_mtu(struct net *net) { - return MAX_PKT_DEFAULT_MCAST; + return tipc_link_mtu(tipc_bc_sndlink(net)); } static u16 bcbuf_acks(struct sk_buff *skb) @@ -175,7 +175,7 @@ static void tipc_bcbase_select_primary(struct net *net) { struct tipc_bc_base *bb = tipc_bc_base(net); int all_dests = tipc_link_bc_peers(bb->link); - int i; + int i, mtu; bb->primary_bearer = INVALID_BEARER_ID; @@ -183,6 +183,13 @@ static void tipc_bcbase_select_primary(struct net *net) return; for (i = 0; i < MAX_BEARERS; i++) { + if (!bb->dests[i]) + continue; + + mtu = tipc_bearer_mtu(net, i); + if (mtu < tipc_link_mtu(bb->link)) + tipc_link_set_mtu(bb->link, mtu); + if (bb->dests[i] < all_dests) continue; @@ -1220,7 +1227,7 @@ int tipc_bcast_init(struct net *net) bb->node.net = net; if (!tipc_link_bc_create(&bb->node, 0, 0, - MAX_PKT_DEFAULT_MCAST, + U16_MAX, BCLINK_WIN_DEFAULT, 0, &bb->inputq, -- cgit v1.2.3