bcast.c (d392da5207352f09030e95d9ea335a4225667ec0) bcast.c (8f92df6ad49da958d97e171762d0a97a3dc738f1)
1/*
2 * net/tipc/bcast.c: TIPC broadcast code
3 *
4 * Copyright (c) 2004-2006, Ericsson AB
5 * Copyright (c) 2004, Intel Corporation.
6 * Copyright (c) 2005, Wind River Systems
7 * All rights reserved.
8 *

--- 22 unchanged lines hidden (view full) ---

31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include "core.h"
1/*
2 * net/tipc/bcast.c: TIPC broadcast code
3 *
4 * Copyright (c) 2004-2006, Ericsson AB
5 * Copyright (c) 2004, Intel Corporation.
6 * Copyright (c) 2005, Wind River Systems
7 * All rights reserved.
8 *

--- 22 unchanged lines hidden (view full) ---

31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include "core.h"
39#include "msg.h"
40#include "dbg.h"
41#include "link.h"
39#include "link.h"
42#include "net.h"
43#include "node.h"
44#include "port.h"
40#include "port.h"
45#include "addr.h"
46#include "node_subscr.h"
47#include "name_distr.h"
41#include "name_distr.h"
48#include "bearer.h"
49#include "name_table.h"
50#include "bcast.h"
51
52#define MAX_PKT_DEFAULT_MCAST 1500 /* bcast link max packet size (fixed) */
53
54#define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */
55
56#define BCLINK_LOG_BUF_SIZE 0
57

--- 56 unchanged lines hidden (view full) ---

114};
115
116
117static struct bcbearer *bcbearer = NULL;
118static struct bclink *bclink = NULL;
119static struct link *bcl = NULL;
120static DEFINE_SPINLOCK(bc_lock);
121
42#include "bcast.h"
43
44#define MAX_PKT_DEFAULT_MCAST 1500 /* bcast link max packet size (fixed) */
45
46#define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */
47
48#define BCLINK_LOG_BUF_SIZE 0
49

--- 56 unchanged lines hidden (view full) ---

106};
107
108
109static struct bcbearer *bcbearer = NULL;
110static struct bclink *bclink = NULL;
111static struct link *bcl = NULL;
112static DEFINE_SPINLOCK(bc_lock);
113
114/* broadcast-capable node map */
115struct tipc_node_map tipc_bcast_nmap;
116
122const char tipc_bclink_name[] = "broadcast-link";
123
124static void tipc_nmap_diff(struct tipc_node_map *nm_a,
125 struct tipc_node_map *nm_b,
126 struct tipc_node_map *nm_diff);
127
128static u32 buf_seqno(struct sk_buff *buf)
129{

--- 439 unchanged lines hidden (view full) ---

569{
570 int bp_index;
571
572 /* Prepare buffer for broadcasting (if first time trying to send it) */
573
574 if (likely(!msg_non_seq(buf_msg(buf)))) {
575 struct tipc_msg *msg;
576
117const char tipc_bclink_name[] = "broadcast-link";
118
119static void tipc_nmap_diff(struct tipc_node_map *nm_a,
120 struct tipc_node_map *nm_b,
121 struct tipc_node_map *nm_diff);
122
123static u32 buf_seqno(struct sk_buff *buf)
124{

--- 439 unchanged lines hidden (view full) ---

564{
565 int bp_index;
566
567 /* Prepare buffer for broadcasting (if first time trying to send it) */
568
569 if (likely(!msg_non_seq(buf_msg(buf)))) {
570 struct tipc_msg *msg;
571
577 assert(tipc_cltr_bcast_nodes.count != 0);
578 bcbuf_set_acks(buf, tipc_cltr_bcast_nodes.count);
572 assert(tipc_bcast_nmap.count != 0);
573 bcbuf_set_acks(buf, tipc_bcast_nmap.count);
579 msg = buf_msg(buf);
580 msg_set_non_seq(msg, 1);
581 msg_set_mc_netid(msg, tipc_net_id);
582 bcl->stats.sent_info++;
583 }
584
585 /* Send buffer over bearers until all targets reached */
586
574 msg = buf_msg(buf);
575 msg_set_non_seq(msg, 1);
576 msg_set_mc_netid(msg, tipc_net_id);
577 bcl->stats.sent_info++;
578 }
579
580 /* Send buffer over bearers until all targets reached */
581
587 bcbearer->remains = tipc_cltr_bcast_nodes;
582 bcbearer->remains = tipc_bcast_nmap;
588
589 for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) {
590 struct bearer *p = bcbearer->bpairs[bp_index].primary;
591 struct bearer *s = bcbearer->bpairs[bp_index].secondary;
592
593 if (!p)
594 break; /* no more bearers to try */
595

--- 352 unchanged lines hidden ---
583
584 for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) {
585 struct bearer *p = bcbearer->bpairs[bp_index].primary;
586 struct bearer *s = bcbearer->bpairs[bp_index].secondary;
587
588 if (!p)
589 break; /* no more bearers to try */
590

--- 352 unchanged lines hidden ---