Lines Matching +defs:link +defs:stats +defs:attrs
2 * net/tipc/link.c: TIPC link code
39 #include "link.h"
82 * struct tipc_link - TIPC link data structure
83 * @addr: network address of link's peer node
84 * @name: link name character string
86 * @peer_session: link session # being used by peer end of link
87 * @peer_bearer_id: bearer id used by link's peer endpoint
88 * @bearer_id: local bearer id used by link
89 * @tolerance: minimum link continuity loss needed to reset link [in ms]
90 * @abort_limit: # of unacknowledged continuity probes needed to reset link
91 * @state: current state of link FSM
94 * @priority: current link priority
95 * @net_plane: current link network plane ('A' through 'H')
96 * @mon_state: cookie with information needed by link monitor
97 * @mtu: current maximum packet size for this link
98 * @advertised_mtu: advertised own mtu when link is being established
105 * @wakeupq: linked list of wakeup msgs waiting for link congestion to abate
107 * @stats: collects statistics regarding link activity
108 * @session: session to be used by link
112 * @active: link is active
114 * @rst_cnt: link reset counter
118 * @transmq: the link's transmit queue
119 * @backlog: link's backlog by priority (importance)
124 * @min_win: minimal send window to be used by link
126 * @max_win: maximal send window to be used by link
132 * @bc_rcvlink: the peer specific link used for broadcast reception
133 * @bc_sndlink: the namespace global link used for broadcast sending
142 /* Management and link supervision data */
212 struct tipc_stats stats;
219 static const char *link_rst_msg = "Resetting link ";
266 * Simple non-static link routines (i.e. referenced outside this file)
453 * tipc_link_create - create a new link
457 * @tolerance: link tolerance to be used by link
458 * @net_plane: network plane (A,B,c..) this link belongs to
459 * @mtu: mtu to be advertised by link
460 * @priority: priority to be used by link
461 * @min_win: minimal send window to be used by link
462 * @max_win: maximal send window to be used by link
463 * @session: session to be used by link
466 * @bc_sndlink: the namespace global link used for broadcast sending
467 * @bc_rcvlink: the peer specific link used for broadcast reception
470 * @link: return value, pointer to put the created link
471 * @self: local unicast link id
474 * Return: true if link was created, otherwise false
484 struct tipc_link **link)
493 *link = l;
496 /* Set link name for unicast links only */
537 * tipc_link_bc_create - create new link to be used for broadcast
540 * @min_win: minimal send window to be used by link
541 * @max_win: maximal send window to be used by link
544 * @link: return value, pointer to put the created link
549 * @bc_sndlink: the namespace global link used for broadcast sending
551 * Return: true if link was created, otherwise false
558 struct tipc_link **link)
564 bc_sndlink, NULL, inputq, namedq, link))
567 l = *link;
573 /* Broadcast receiver link name: "broadcast-link:<peer>" */
585 /* Broadcast send link is always up */
597 * tipc_link_fsm_evt - link finite state machine
598 * @l: pointer to link
755 pr_err("Illegal FSM event %x in state %x on link %s\n",
770 l->stats.accu_queue_sz += skb_queue_len(&l->transmq);
771 l->stats.queue_sz_counts++;
784 l->stats.msg_lengths_total += length;
785 l->stats.msg_length_counts++;
787 l->stats.msg_length_profile[0]++;
789 l->stats.msg_length_profile[1]++;
791 l->stats.msg_length_profile[2]++;
793 l->stats.msg_length_profile[3]++;
795 l->stats.msg_length_profile[4]++;
797 l->stats.msg_length_profile[5]++;
799 l->stats.msg_length_profile[6]++;
803 * tipc_link_too_silent - check if link is "too silent"
804 * @l: tipc link to be checked
806 * Return: true if the link 'silent_intv_cnt' is about to reach the
877 * @l: congested link
895 l->stats.link_congs++;
902 * @l: congested link
939 * @l: link the skb will be transmitted on
1003 * @l: link to use
1045 pr_warn("%s<%s>, link overflow", link_rst_msg, l->name);
1053 l->stats.sent_fragmented++;
1054 l->stats.sent_fragments += pkt_cnt;
1075 l->stats.sent_pkts++;
1088 l->stats.sent_bundles++;
1089 l->stats.sent_bundled++;
1091 l->stats.sent_bundled++;
1180 l->stats.sent_pkts++;
1188 * @l: tipc link sender
1189 * @r: tipc link receiver (= l in case of unicast)
1215 pr_warn("Retransmission failure on link <%s>\n", l->name);
1216 link_print(l, "State of link ");
1291 /* tipc_link_input - process packet that has passed link protocol check
1307 l->stats.recv_bundles++;
1308 l->stats.recv_bundled += msg_msgcnt(hdr);
1314 l->stats.recv_fragments++;
1316 l->stats.recv_fragmented++;
1334 * inner message along with the ones in the old link's
1336 * @l: tunnel link
1408 * @l: the tipc link
1483 * @l: tipc unicast link
1500 /* Start with broadcast link first */
1507 /* Now for unicast link, but an explicit NACK only (???) */
1517 /* tipc_link_advance_transmq - advance TIPC link transmq queue by releasing
1520 * @l: tipc link with transmq queue to be advanced
1521 * @r: tipc link "receiver" i.e. in case of broadcast (= "l" if unicast)
1530 * Return: the number of packets released from the link transmq
1554 /* Determine Gap ACK blocks if any for the particular link */
1574 /* Advance the link transmq */
1633 l->stats.retransmitted++;
1635 r->stats.retransmitted++;
1683 /* tipc_link_build_state_msg: prepare link state message for transmission
1693 /* Broadcast ACK must be sent via a unicast link => defer to caller */
1699 /* Use snd_nxt to store peer's snd_nxt in broadcast rcv link */
1705 l->stats.sent_acks++;
1710 /* tipc_link_build_reset_msg: prepare link RESET or ACTIVATE message
1728 /* tipc_link_build_nack_msg: prepare link nack message for transmission
1735 u32 def_cnt = ++l->stats.deferred_recv;
1758 * @l: the link that should handle the message
1771 /* Verify and update link state */
1793 l->stats.duplicates++;
1803 l->stats.duplicates++;
1810 l->stats.recv_pkts++;
1847 /* Don't send protocol message during reset or link failover */
1892 l->stats.sent_states++;
1906 l->stats.sent_probes++;
1908 l->stats.sent_nacks++;
1910 bcl->stats.sent_nacks++;
1947 * with contents of the link's transmit and backlog queues.
2022 /* Tunnel link MTU is not large enough? This could be
2084 /* Failover the link's deferdq */
2095 * tipc_link_failover_prepare() - prepare tnl for link failover
2100 * @l: failover link
2101 * @tnl: tunnel link
2111 /* This failover link endpoint was never established before,
2120 /* Initiate the link's failover deferdq */
2128 /* tipc_link_validate_msg(): validate message against current link state
2169 /* tipc_link_proto_rcv(): receive link level protocol message :
2222 /* Complete own link name with peer's interface name */
2255 /* ACTIVATE_MSG serves as PEER_RESET if link is already down */
2259 /* ACTIVATE_MSG takes up link if it was already locally reset */
2291 l->stats.recv_states++;
2293 l->stats.recv_probes++;
2317 l->stats.recv_nacks++;
2358 /* tipc_link_build_bc_init_msg() - synchronize broadcast link endpoints.
2402 /* tipc_link_bc_sync_rcv - update rcv link according to peer's send state
2474 l->stats.recv_nacks++;
2475 r->stats.recv_nacks++;
2518 l->stats.recv_nacks++;
2545 * tipc_link_reset_stats - reset link statistics
2546 * @l: pointer to link
2550 memset(&l->stats, 0, sizeof(l->stats));
2565 /* Parse and validate nested (link) properties valid for media, bearer and link
2606 struct nlattr *stats;
2651 stats = nla_nest_start_noflag(skb, TIPC_NLA_LINK_STATS);
2652 if (!stats)
2659 nla_nest_end(skb, stats);
2663 nla_nest_cancel(skb, stats);
2668 /* Caller should hold appropriate locks to protect the link */
2670 struct tipc_link *link, int nlflags)
2673 struct nlattr *attrs;
2683 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_LINK);
2684 if (!attrs)
2687 if (nla_put_string(msg->skb, TIPC_NLA_LINK_NAME, link->name))
2691 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_MTU, link->mtu))
2693 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_RX, link->stats.recv_pkts))
2695 if (nla_put_u32(msg->skb, TIPC_NLA_LINK_TX, link->stats.sent_pkts))
2698 if (tipc_link_is_up(link))
2701 if (link->active)
2708 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, link->priority))
2710 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_TOL, link->tolerance))
2713 link->window))
2715 if (nla_put_u32(msg->skb, TIPC_NLA_PROP_PRIO, link->priority))
2719 err = __tipc_nl_add_stats(msg->skb, &link->stats);
2723 nla_nest_end(msg->skb, attrs);
2731 nla_nest_cancel(msg->skb, attrs);
2739 struct tipc_stats *stats)
2750 {TIPC_NLA_STATS_RX_INFO, stats->recv_pkts},
2751 {TIPC_NLA_STATS_RX_FRAGMENTS, stats->recv_fragments},
2752 {TIPC_NLA_STATS_RX_FRAGMENTED, stats->recv_fragmented},
2753 {TIPC_NLA_STATS_RX_BUNDLES, stats->recv_bundles},
2754 {TIPC_NLA_STATS_RX_BUNDLED, stats->recv_bundled},
2755 {TIPC_NLA_STATS_TX_INFO, stats->sent_pkts},
2756 {TIPC_NLA_STATS_TX_FRAGMENTS, stats->sent_fragments},
2757 {TIPC_NLA_STATS_TX_FRAGMENTED, stats->sent_fragmented},
2758 {TIPC_NLA_STATS_TX_BUNDLES, stats->sent_bundles},
2759 {TIPC_NLA_STATS_TX_BUNDLED, stats->sent_bundled},
2760 {TIPC_NLA_STATS_RX_NACKS, stats->recv_nacks},
2761 {TIPC_NLA_STATS_RX_DEFERRED, stats->deferred_recv},
2762 {TIPC_NLA_STATS_TX_NACKS, stats->sent_nacks},
2763 {TIPC_NLA_STATS_TX_ACKS, stats->sent_acks},
2764 {TIPC_NLA_STATS_RETRANSMITTED, stats->retransmitted},
2765 {TIPC_NLA_STATS_DUPLICATES, stats->duplicates},
2766 {TIPC_NLA_STATS_LINK_CONGS, stats->link_congs},
2767 {TIPC_NLA_STATS_MAX_QUEUE, stats->max_queue_sz},
2768 {TIPC_NLA_STATS_AVG_QUEUE, stats->queue_sz_counts ?
2769 (stats->accu_queue_sz / stats->queue_sz_counts) : 0}
2794 struct nlattr *attrs;
2811 attrs = nla_nest_start_noflag(msg->skb, TIPC_NLA_LINK);
2812 if (!attrs)
2815 /* The broadcast link is always up */
2841 err = __tipc_nl_add_bc_link_stat(msg->skb, &bcl->stats);
2846 nla_nest_end(msg->skb, attrs);
2854 nla_nest_cancel(msg->skb, attrs);
2885 * tipc_link_dump - dump TIPC link data
2886 * @l: tipc link to be dumped
2887 * @dqueues: bitmask to decide if any link queue to be dumped?
2888 * - TIPC_DUMP_NONE: don't dump link queues
2889 * - TIPC_DUMP_TRANSMQ: dump link transmq queue
2890 * - TIPC_DUMP_BACKLOGQ: dump link backlog queue
2891 * - TIPC_DUMP_DEFERDQ: dump link deferd queue
2892 * - TIPC_DUMP_INPUTQ: dump link input queue
2893 * - TIPC_DUMP_WAKEUP: dump link wakeup queue
2894 * - TIPC_DUMP_ALL: dump all the link queues above
2906 i += scnprintf(buf, sz, "link data: (null)\n");
2910 i += scnprintf(buf, sz, "link data: %x", l->addr);