[tipc-discussion] [PATCH iproute2 v3 07/10] tipc: add link monitor summary

2016-06-02 Thread Parthasarathy Bhuvaragan
The monitor summary command prints the basic attributes
specific to the local node.
A sample usage is shown below:
$ tipc link monitor summary

bearer eth:data0
table 8
members 8
state active

bearer eth:data1
table 8
members 8
state active

$ tipc link monitor summary -h
Usage: tipc monitor summary

Signed-off-by: Parthasarathy Bhuvaragan 
---
 include/linux/tipc_netlink.h | 25 
 tipc/link.c  | 45 +++-
 2 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/include/linux/tipc_netlink.h b/include/linux/tipc_netlink.h
index d07c6ec76062..5f3f6d09fb79 100644
--- a/include/linux/tipc_netlink.h
+++ b/include/linux/tipc_netlink.h
@@ -58,6 +58,7 @@ enum {
TIPC_NL_NAME_TABLE_GET,
TIPC_NL_MON_SET,
TIPC_NL_MON_GET,
+   TIPC_NL_MON_PEER_GET,
 
__TIPC_NL_CMD_MAX,
TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 1
@@ -75,6 +76,7 @@ enum {
TIPC_NLA_NET,   /* nest */
TIPC_NLA_NAME_TABLE,/* nest */
TIPC_NLA_MON,   /* nest */
+   TIPC_NLA_MON_PEER,  /* nest */
 
__TIPC_NLA_MAX,
TIPC_NLA_MAX = __TIPC_NLA_MAX - 1
@@ -173,6 +175,11 @@ enum {
 enum {
TIPC_NLA_MON_UNSPEC,
TIPC_NLA_MON_ACTIVATION_THRESHOLD,  /* u32 */
+   TIPC_NLA_MON_REF,   /* u32 */
+   TIPC_NLA_MON_ACTIVE,/* flag */
+   TIPC_NLA_MON_BEARER_NAME,   /* string */
+   TIPC_NLA_MON_PEERCNT,   /* u32 */
+   TIPC_NLA_MON_LISTGEN,   /* u32 */
 
__TIPC_NLA_MON_MAX,
TIPC_NLA_MON_MAX = __TIPC_NLA_MON_MAX - 1
@@ -194,6 +201,24 @@ enum {
TIPC_NLA_PUBL_MAX = __TIPC_NLA_PUBL_MAX - 1
 };
 
+/* Monitor peer info */
+enum {
+   TIPC_NLA_MON_PEER_UNSPEC,
+
+   TIPC_NLA_MON_PEER_ADDR, /* u32 */
+   TIPC_NLA_MON_PEER_DOMGEN,   /* u32 */
+   TIPC_NLA_MON_PEER_APPLIED,  /* u32 */
+   TIPC_NLA_MON_PEER_UPMAP,/* u64 */
+   TIPC_NLA_MON_PEER_MEMBERS,  /* tlv */
+   TIPC_NLA_MON_PEER_UP,   /* flag */
+   TIPC_NLA_MON_PEER_HEAD, /* flag */
+   TIPC_NLA_MON_PEER_LOCAL,/* flag */
+   TIPC_NLA_MON_PEER_PAD,  /* flag */
+
+   __TIPC_NLA_MON_PEER_MAX,
+   TIPC_NLA_MON_PEER_MAX = __TIPC_NLA_MON_PEER_MAX - 1
+};
+
 /* Nest, connection info */
 enum {
TIPC_NLA_CON_UNSPEC,
diff --git a/tipc/link.c b/tipc/link.c
index a09444912515..46a25b314311 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -515,6 +515,47 @@ static int cmd_link_mon_set_prop(struct nlmsghdr *nlh, 
const struct cmd *cmd,
return msg_doit(nlh, NULL, NULL);
 }
 
+static int link_mon_summary_cb(const struct nlmsghdr *nlh, void *data)
+{
+   struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
+   struct nlattr *info[TIPC_NLA_MAX + 1] = {};
+   struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {};
+
+   mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
+   if (!info[TIPC_NLA_MON])
+   return MNL_CB_ERROR;
+
+   mnl_attr_parse_nested(info[TIPC_NLA_MON], parse_attrs, attrs);
+
+   printf("\nbearer %s\n",
+   mnl_attr_get_str(attrs[TIPC_NLA_MON_BEARER_NAME]));
+
+   printf("table %u\nmembers %u\nstate %s\n",
+   mnl_attr_get_u32(attrs[TIPC_NLA_MON_LISTGEN]),
+   mnl_attr_get_u32(attrs[TIPC_NLA_MON_PEERCNT]),
+   attrs[TIPC_NLA_MON_ACTIVE] ? "active" : "inactive");
+
+   return MNL_CB_OK;
+}
+
+static int cmd_link_mon_summary(struct nlmsghdr *nlh, const struct cmd *cmd,
+   struct cmdl *cmdl, void *data)
+{
+   char buf[MNL_SOCKET_BUFFER_SIZE];
+
+   if (help_flag) {
+   fprintf(stderr, "Usage: %s monitor summary\n", cmdl->argv[0]);
+   return -EINVAL;
+   }
+
+   if (!(nlh = msg_init(buf, TIPC_NL_MON_GET))) {
+   fprintf(stderr, "error, message initialisation failed\n");
+   return -1;
+   }
+
+   return msg_dumpit(nlh, link_mon_summary_cb, NULL);
+}
+
 static void cmd_link_mon_set_help(struct cmdl *cmdl)
 {
fprintf(stderr, "Usage: %s monitor set PPROPERTY\n\n"
@@ -592,7 +633,8 @@ static void cmd_link_mon_help(struct cmdl *cmdl)
"Usage: %s montior COMMAND [ARGS] ...\n\n"
"COMMANDS\n"
" set   - Set monitor properties\n"
-   " get   - Get monitor properties\n",
+   " get   - Get monitor properties\n"
+   " summary   - Show local node monitor summary\n",
cmdl->argv[0]);
 }
 
@@ -602,6 +644,7 @@ static int cmd_link_mon(struct nlmsghdr *nlh, const struct 

[tipc-discussion] [PATCH iproute2 v3 09/10] tipc: add link monitor list

2016-06-02 Thread Parthasarathy Bhuvaragan
In this commit, we list the monitor attributes for the specified
bearer.
A sample usage is shown below:
$ tipc link monitor list media eth dev data0-br
Node  S D Dom Applied Node Status [Non-Applied Node:Status]
1.1.14U Y 19U,U []
1.1.15U Y 20U,U []
1.1.16U Y 26U,U []
1.1.130   U Y 4 U,U []
1.1.131   U Y 4 U,U []
1.1.230   U Y 5 U,U []
1.1.231   U Y 6 U,U []
1.1.330   U Y 6 U,U []
1.1.331   U N 6 U,U []
1.1.430   U N 8 U,U []
1.1.431   U N 8 U,U []
1.1.530   U N 6 U,U []
1.1.531   U N 8 U,U []
1.1.630   U N 8 U,U []
1.1.631   U Y 11U,U []
1.1.730   U N 9 U,U []
1.1.731   U N 10U,U []
1.1.830   U N 9 U,U []
1.1.831   U N 12U,U []
1.1.930   U N 12U,U []
1.1.931   U N 12U,U []
1.1.1030  U Y 13U,U []
1.1.1031  U N 13U,U []
1.1.1130  U N 13U,U []
1.1.1131  U N 11U,U []
1.1.1230  U N 8 U,U []
1.1.1231  U N 7 U,U []
1.1.1330  U N 15U,U []
1.1.1331  U Y 11U,U []
1.1.1430  U N 16U,U []
1.1.1431  U N 10U,U []
1.1.1530  U N 9 U,U []
1.1.1531  U N 8 U,U []
1.1.1630  U N 12U,U []
1.1.1631  U N 9 U,U []
1.1.1 U Y 5 U,U []
1.1.2 U N 7 U,U []
1.1.3 U N 11U,U []
1.1.4 U N 11U,U []
1.1.5 U N 13U,U []
1.1.6 U N 12U,U []
1.1.7 U N 16U,U []
1.1.8 U Y 19U,U []
1.1.9 U N 20U,U []
1.1.10U N 21U,U []
1.1.11U N 22U,U []
1.1.12U N 18U,U []
1.1.13U N 22U,U []

$ tipc link monitor list -h
Usage: tipc monitor list media MEDIA ARGS...

MEDIA
 udp   - User Datagram Protocol
 ib- Infiniband
 eth   - Ethernet

Signed-off-by: Parthasarathy Bhuvaragan 
---
 tipc/link.c | 207 
 1 file changed, 207 insertions(+)

diff --git a/tipc/link.c b/tipc/link.c
index 46a25b314311..0d15a7124d0c 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -22,6 +22,7 @@
 #include "cmdl.h"
 #include "msg.h"
 #include "link.h"
+#include "bearer.h"
 
 static int link_list_cb(const struct nlmsghdr *nlh, void *data)
 {
@@ -556,6 +557,210 @@ static int cmd_link_mon_summary(struct nlmsghdr *nlh, 
const struct cmd *cmd,
return msg_dumpit(nlh, link_mon_summary_cb, NULL);
 }
 
+#define STATUS_WIDTH 2
+#define MAX_NODE_WIDTH 14 /* 255.4095.4095 */
+#define MAX_DOM_GEN_WIDTH 6 /* 65535 */
+#define DIRECTLY_MON_WIDTH 2
+
+#define APPL_NODE_STATUS_WIDTH 5
+
+static int map_get(uint64_t up_map, int i)
+{
+   return (up_map & (1 << i)) >> i;
+}
+
+/* print the applied members, since we know the the members
+ * are listed in ascending order, we print only the state */
+static void link_mon_print_applied(uint16_t applied, uint64_t up_map)
+{
+   int i;
+   char state;
+
+   for (i = 0; i < applied; i++) {
+   /* print the delimiter for every -n- entry */
+   if (i && !(i % APPL_NODE_STATUS_WIDTH))
+   printf(",");
+
+   state = map_get(up_map, i) ? 'U' : 'D';
+   printf("%c", state);
+   }
+}
+
+/* print the non applied members, since we dont know
+ * the members, we print them along with the state */
+static void link_mon_print_non_applied(uint16_t applied, uint16_t member_cnt,
+  uint64_t up_map,  uint32_t *members)
+{
+   int i;
+   char state;
+
+   printf(" [");
+   for (i = applied; i < member_cnt; i++) {
+   char addr_str[16];
+
+   /* print the delimiter for every entry */
+   if (i != applied)
+   printf(",");
+
+   sprintf(addr_str, "%u.%u.%u:", tipc_zone(members[i]),
+   tipc_cluster(members[i]), tipc_node(members[i]));
+   state = map_get(up_map, i) ? 'U' : 'D';
+   printf("%s%c", addr_str, state);
+   }
+   printf("]");
+}
+
+static void link_mon_print_peer_state(uint32_t addr, const char status,
+ const char direct, uint32_t dom)
+{
+   char addr_str[16];
+
+   sprintf(addr_str, "%u.%u.%u", tipc_zone(addr), tipc_cluster(addr),
+   tipc_node(addr));
+
+   printf("%-*s", MAX_NODE_WIDTH, addr_str);
+   printf("%-*c", STATUS_WIDTH, status);
+   printf("%-*c", DIRECTLY_MON_WIDTH, direct);
+   printf("%-*u", MAX_DOM_GEN_WIDTH, dom);
+}
+
+static int link_mon_peer_list_cb(const struct nlmsghdr *nlh, void *data)
+{
+   struct genlmsghdr *genl = 

[tipc-discussion] [PATCH iproute2 v3 10/10] tipc: update man page for link monitor

2016-06-02 Thread Parthasarathy Bhuvaragan
Signed-off-by: Parthasarathy Bhuvaragan 
---
 man/man8/tipc-link.8 | 101 +++
 1 file changed, 101 insertions(+)

diff --git a/man/man8/tipc-link.8 b/man/man8/tipc-link.8
index 3be8c9ad4b16..f023b095a01a 100644
--- a/man/man8/tipc-link.8
+++ b/man/man8/tipc-link.8
@@ -39,6 +39,32 @@ tipc-link \- show links or modify link properties
 .B tipc link list
 .br
 
+.ti -8
+.B tipc link monitor set
+.RB "{ " "threshold" " } "
+
+.ti -8
+.B tipc link monitor get
+.RB "{ " "threshold" " } "
+
+.ti -8
+.B tipc link monitor summary
+.br
+
+.ti -8
+.B tipc link monitor list media
+.br
+.RB "{ { " eth " | " ib " } " device
+.IR "DEVICE" " }"
+.RB "|"
+.br
+.RB "{ " udp
+.B name
+.IR NAME
+.B localip
+.IR LOCALIP " } }"
+.br
+
 .SH OPTIONS
 Options (flags) that can be passed anywhere in the command chain.
 .TP
@@ -204,6 +230,81 @@ The link window controls how many unacknowledged messages 
a link endpoint can
 have in its transmit queue before TIPC's congestion control mechanism is
 activated.
 
+.SS Monitor properties
+
+.TP
+.B threshold
+.br
+The threshold specifies the cluster size exceeding which the link monitoring
+algorithm will switch from "full mesh" to "overlapping ring". The default value
+is 32. Threshold value of 0, implies that ring monitoring is always on.
+
+.SS Monitor information
+
+.TP
+.B table
+.br
+Represents the event count in a node's local monitoring list. It steps every
+time something changes in the local monitor list, including changes in the
+local domain.
+
+.TP
+.B members
+.br
+Represents the total count of nodes which are cluster members.
+
+.TP
+.B state
+.br
+The current state of "overlapping ring" supervision algorithm for the bearer.
+The value active implies that the overlapping ring supervision algorithm is
+currently being used by the bearer.
+
+.TP
+.B S - Current Node Status
+.br
+The Node status derived by the local node. Possible values are:
+U-Up, D-Down.
+
+.TP
+.B D - Directly monitored
+.br
+Is the Node actively monitored from the local node. Possible values are:
+Y-Yes, N-No.
+
+.TP
+.B Dom - Domain Generation
+.br
+Represents the event count in a node's local domain. It steps every time
+something changes (peer add/remove/up/down). This helps the receiver of
+a domain record to know if it should ignore or process the record.
+
+.TP
+.B Applied Node Status
+.br
+The Node status reported by the peer node for the preceeding peers in
+the Node list. The Node list is a circular list of ascending addresses
+begining with the local node. Possible values are: U-Up, D-Down.
+
+.TP
+.B [Non-Applied Node:Status]
+.br
+Represents the Nodes which cannot be applied to the monitoring list
+for this peer node. These are usually transient node states during
+the cluster startup phase or network partition.
+
+.SH EXAMPLES
+.PP
+tipc link monitor list media eth dev data0
+.RS 4
+Shows the link monitoring information for cluster members on device data0.
+.RE
+.PP
+tipc link monitor summary
+.RS 4
+The monitor summary command prints the basic attributes.
+.RE
+
 .SH EXIT STATUS
 Exit status is 0 if command was successful or a positive integer upon failure.
 
-- 
2.1.4


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


[tipc-discussion] [PATCH iproute2 v3 06/10] tipc: add link monitor get threshold

2016-06-02 Thread Parthasarathy Bhuvaragan
The command prints the monitor activation threshold.
A sample usage is shown below:
$ tipc link monitor get threshold
32

$ tipc link monitor get -h
Usage: tipc monitor get PPROPERTY

PROPERTIES
 threshold  - Get monitor activation threshold

Signed-off-by: Parthasarathy Bhuvaragan 
---
 include/linux/tipc_netlink.h |  1 +
 tipc/link.c  | 56 +++-
 2 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/include/linux/tipc_netlink.h b/include/linux/tipc_netlink.h
index d387b65a0d97..d07c6ec76062 100644
--- a/include/linux/tipc_netlink.h
+++ b/include/linux/tipc_netlink.h
@@ -57,6 +57,7 @@ enum {
TIPC_NL_NET_SET,
TIPC_NL_NAME_TABLE_GET,
TIPC_NL_MON_SET,
+   TIPC_NL_MON_GET,
 
__TIPC_NL_CMD_MAX,
TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 1
diff --git a/tipc/link.c b/tipc/link.c
index 6ee14c3c8a4c..a09444912515 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -534,12 +534,65 @@ static int cmd_link_mon_set(struct nlmsghdr *nlh, const 
struct cmd *cmd,
return run_cmd(nlh, cmd, cmds, cmdl, NULL);
 }
 
+static void cmd_link_mon_get_help(struct cmdl *cmdl)
+{
+   fprintf(stderr, "Usage: %s monitor get PPROPERTY \n\n"
+   "PROPERTIES\n"
+   " threshold - Get monitor activation threshold\n",
+   cmdl->argv[0]);
+}
+
+static int link_mon_get_cb(const struct nlmsghdr *nlh, void *data)
+{
+   struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
+   struct nlattr *info[TIPC_NLA_MAX + 1] = {};
+   struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {};
+
+   mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
+   if (!info[TIPC_NLA_MON])
+   return MNL_CB_ERROR;
+
+   mnl_attr_parse_nested(info[TIPC_NLA_MON], parse_attrs, attrs);
+   if (!attrs[TIPC_NLA_MON_ACTIVATION_THRESHOLD])
+   return MNL_CB_ERROR;
+
+   printf("%u\n",
+  mnl_attr_get_u32(attrs[TIPC_NLA_MON_ACTIVATION_THRESHOLD]));
+
+   return MNL_CB_OK;
+}
+
+static int cmd_link_mon_get_prop(struct nlmsghdr *nlh, const struct cmd *cmd,
+struct cmdl *cmdl, void *data)
+{
+   char buf[MNL_SOCKET_BUFFER_SIZE];
+
+   if (!(nlh = msg_init(buf, TIPC_NL_MON_GET))) {
+   fprintf(stderr, "error, message initialisation failed\n");
+   return -1;
+   }
+
+   return msg_doit(nlh,link_mon_get_cb,NULL);
+}
+
+static int cmd_link_mon_get(struct nlmsghdr *nlh, const struct cmd *cmd,
+   struct cmdl *cmdl, void *data)
+{
+   const struct cmd cmds[] = {
+   { "threshold",  cmd_link_mon_get_prop,  NULL},
+   { NULL }
+   };
+
+   return run_cmd(nlh, cmd, cmds, cmdl, NULL);
+}
+
 static void cmd_link_mon_help(struct cmdl *cmdl)
 {
fprintf(stderr,
"Usage: %s montior COMMAND [ARGS] ...\n\n"
"COMMANDS\n"
-   " set  - Set monitor properties\n",
+   " set   - Set monitor properties\n"
+   " get   - Get monitor properties\n",
cmdl->argv[0]);
 }
 
@@ -548,6 +601,7 @@ static int cmd_link_mon(struct nlmsghdr *nlh, const struct 
cmd *cmd, struct cmdl
 {
const struct cmd cmds[] = {
{ "set",cmd_link_mon_set,   cmd_link_mon_set_help },
+   { "get",cmd_link_mon_get,   cmd_link_mon_get_help },
{ NULL }
};
 
-- 
2.1.4


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


[tipc-discussion] [PATCH iproute2 v3 05/10] tipc: add link monitor set threshold

2016-06-02 Thread Parthasarathy Bhuvaragan
The command sets the activation threshold for the new
cluster ring supervision.
A sample usage is shown below:
$ tipc link monitor set threshold 4

$ tipc link monitor set -h
Usage: tipc monitor set PPROPERTY

PROPERTIES
 threshold SIZE - Set activation threshold for monitor

Signed-off-by: Parthasarathy Bhuvaragan 
---
 include/linux/tipc_netlink.h | 11 +++
 tipc/link.c  | 69 +++-
 2 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/include/linux/tipc_netlink.h b/include/linux/tipc_netlink.h
index d4c8f142ba63..d387b65a0d97 100644
--- a/include/linux/tipc_netlink.h
+++ b/include/linux/tipc_netlink.h
@@ -56,6 +56,7 @@ enum {
TIPC_NL_NET_GET,
TIPC_NL_NET_SET,
TIPC_NL_NAME_TABLE_GET,
+   TIPC_NL_MON_SET,
 
__TIPC_NL_CMD_MAX,
TIPC_NL_CMD_MAX = __TIPC_NL_CMD_MAX - 1
@@ -72,6 +73,7 @@ enum {
TIPC_NLA_NODE,  /* nest */
TIPC_NLA_NET,   /* nest */
TIPC_NLA_NAME_TABLE,/* nest */
+   TIPC_NLA_MON,   /* nest */
 
__TIPC_NLA_MAX,
TIPC_NLA_MAX = __TIPC_NLA_MAX - 1
@@ -166,6 +168,15 @@ enum {
TIPC_NLA_NAME_TABLE_MAX = __TIPC_NLA_NAME_TABLE_MAX - 1
 };
 
+/* Monitor info */
+enum {
+   TIPC_NLA_MON_UNSPEC,
+   TIPC_NLA_MON_ACTIVATION_THRESHOLD,  /* u32 */
+
+   __TIPC_NLA_MON_MAX,
+   TIPC_NLA_MON_MAX = __TIPC_NLA_MON_MAX - 1
+};
+
 /* Publication info */
 enum {
TIPC_NLA_PUBL_UNSPEC,
diff --git a/tipc/link.c b/tipc/link.c
index a9d256e1b9a8..6ee14c3c8a4c 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -489,6 +489,71 @@ static int cmd_link_set(struct nlmsghdr *nlh, const struct 
cmd *cmd,
return run_cmd(nlh, cmd, cmds, cmdl, NULL);
 }
 
+static int cmd_link_mon_set_prop(struct nlmsghdr *nlh, const struct cmd *cmd,
+struct cmdl *cmdl, void *data)
+{
+   int size;
+   char buf[MNL_SOCKET_BUFFER_SIZE];
+   struct nlattr *attrs;
+
+   if (cmdl->argc != cmdl->optind + 1) {
+   fprintf(stderr, "error, missing value\n");
+   return -EINVAL;
+   }
+   size = atoi(shift_cmdl(cmdl));
+
+   if (!(nlh = msg_init(buf, TIPC_NL_MON_SET))) {
+   fprintf(stderr, "error, message initialisation failed\n");
+   return -1;
+   }
+   attrs = mnl_attr_nest_start(nlh, TIPC_NLA_MON);
+
+   mnl_attr_put_u32(nlh, TIPC_NLA_MON_ACTIVATION_THRESHOLD, size);
+
+   mnl_attr_nest_end(nlh, attrs);
+
+   return msg_doit(nlh, NULL, NULL);
+}
+
+static void cmd_link_mon_set_help(struct cmdl *cmdl)
+{
+   fprintf(stderr, "Usage: %s monitor set PPROPERTY\n\n"
+   "PROPERTIES\n"
+   " threshold SIZE- Set monitor activation threshold\n",
+   cmdl->argv[0]);
+}
+
+static int cmd_link_mon_set(struct nlmsghdr *nlh, const struct cmd *cmd,
+   struct cmdl *cmdl, void *data)
+{
+   const struct cmd cmds[] = {
+   { "threshold",  cmd_link_mon_set_prop,  NULL },
+   { NULL }
+   };
+
+   return run_cmd(nlh, cmd, cmds, cmdl, NULL);
+}
+
+static void cmd_link_mon_help(struct cmdl *cmdl)
+{
+   fprintf(stderr,
+   "Usage: %s montior COMMAND [ARGS] ...\n\n"
+   "COMMANDS\n"
+   " set  - Set monitor properties\n",
+   cmdl->argv[0]);
+}
+
+static int cmd_link_mon(struct nlmsghdr *nlh, const struct cmd *cmd, struct 
cmdl *cmdl,
+   void *data)
+{
+   const struct cmd cmds[] = {
+   { "set",cmd_link_mon_set,   cmd_link_mon_set_help },
+   { NULL }
+   };
+
+   return run_cmd(nlh, cmd, cmds, cmdl, NULL);
+}
+
 void cmd_link_help(struct cmdl *cmdl)
 {
fprintf(stderr,
@@ -498,7 +563,8 @@ void cmd_link_help(struct cmdl *cmdl)
" list  - List links\n"
" get   - Get various link properties\n"
" set   - Set various link properties\n"
-   " statistics- Show or reset statistics\n",
+   " statistics- Show or reset statistics\n"
+   " monitor   - Show or set link supervision\n",
cmdl->argv[0]);
 }
 
@@ -510,6 +576,7 @@ int cmd_link(struct nlmsghdr *nlh, const struct cmd *cmd, 
struct cmdl *cmdl,
{ "list",   cmd_link_list,  NULL },
{ "set",cmd_link_set,   cmd_link_set_help },
{ "statistics", cmd_link_stat,  cmd_link_stat_help },
+   { "monitor",cmd_link_mon,   cmd_link_mon_help },
{ NULL }
};
 
-- 
2.1.4


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and 

[tipc-discussion] [PATCH iproute2 v3 01/10] tipc: remove dead code

2016-06-02 Thread Parthasarathy Bhuvaragan
remove dead code and a newline.

Signed-off-by: Parthasarathy Bhuvaragan 
---
 tipc/link.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tipc/link.c b/tipc/link.c
index 89fb4ff4e7f9..a9d256e1b9a8 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -90,7 +90,6 @@ static int link_get_cb(const struct nlmsghdr *nlh, void *data)
return MNL_CB_OK;
 }
 
-
 static int cmd_link_get_prop(struct nlmsghdr *nlh, const struct cmd *cmd,
 struct cmdl *cmdl, void *data)
 {
@@ -475,8 +474,6 @@ static int cmd_link_set_prop(struct nlmsghdr *nlh, const 
struct cmd *cmd,
mnl_attr_nest_end(nlh, attrs);
 
return msg_doit(nlh, link_get_cb, );
-
-   return 0;
 }
 
 static int cmd_link_set(struct nlmsghdr *nlh, const struct cmd *cmd,
-- 
2.1.4


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


[tipc-discussion] [PATCH iproute2 v3 04/10] tipc: fix bearer operations with media=ib

2016-06-02 Thread Parthasarathy Bhuvaragan
In this commit, we fix several bearer operations for infiniband
media in a generic way.

Signed-off-by: Parthasarathy Bhuvaragan 
---
 tipc/bearer.c | 257 ++
 1 file changed, 152 insertions(+), 105 deletions(-)

diff --git a/tipc/bearer.c b/tipc/bearer.c
index c3494e96d3e3..89477c09a68f 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -26,6 +26,18 @@
 #include "msg.h"
 #include "bearer.h"
 
+struct tipc_bearer_ops {
+   char *name;
+   int (*add) (struct nlmsghdr *nlh, struct opt *opts,
+   struct cmdl *cmdl, char *bname);
+   void (*enable_help) (struct cmdl *cmdl);
+   void (*disable_help) (struct cmdl *cmdl);
+   void (*set_help) (struct cmdl *cmdl);
+   void (*get_help) (struct cmdl *cmdl);
+};
+
+static int cmd_find_bearer_ops(const struct cmd *cmd, struct cmdl *cmdl,
+  struct opt *opts, struct tipc_bearer_ops **bops);
 static int cmd_get_unique_bearer_name(const struct cmd *cmd, struct cmdl *cmdl,
  struct opt *opts, char *bname);
 
@@ -47,10 +59,20 @@ static void _print_bearer_media(void)
" eth   - Ethernet\n");
 }
 
-static void cmd_bearer_enable_l2_help(struct cmdl *cmdl)
+static void cmd_bearer_enable_eth_help(struct cmdl *cmdl)
 {
fprintf(stderr,
-   "Usage: %s bearer enable media MEDIA device DEVICE [OPTIONS]\n"
+   "Usage: %s bearer enable media eth device DEVICE [OPTIONS]\n"
+   "\nOPTIONS\n"
+   " domain DOMAIN - Discovery domain\n"
+   " priority PRIORITY - Bearer priority\n",
+   cmdl->argv[0]);
+}
+
+static void cmd_bearer_enable_ib_help(struct cmdl *cmdl)
+{
+   fprintf(stderr,
+   "Usage: %s bearer enable media ib device DEVICE [OPTIONS]\n"
"\nOPTIONS\n"
" domain DOMAIN - Discovery domain\n"
" priority PRIORITY - Bearer priority\n",
@@ -128,12 +150,6 @@ static int enable_udp_bearer(struct nlmsghdr *nlh, struct 
opt *opts,
.ai_socktype = SOCK_DGRAM
};
 
-   if (help_flag) {
-   cmd_bearer_enable_udp_help(cmdl);
-   /* TODO find a better error code? */
-   return -EINVAL;
-   }
-
if (!(opt = get_opt(opts, "localip"))) {
fprintf(stderr, "error, udp bearer localip missing\n");
cmd_bearer_enable_udp_help(cmdl);
@@ -187,6 +203,24 @@ static int enable_udp_bearer(struct nlmsghdr *nlh, struct 
opt *opts,
return 0;
 }
 
+static int add_bearer_name(struct nlmsghdr *nlh, struct opt *opts,
+   struct cmdl *cmdl, char *bname)
+{
+   mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
+   return 0;
+}
+
+static int add_udp_bearer(struct nlmsghdr *nlh, struct opt *opts,
+struct cmdl *cmdl, char *bname)
+{
+   int err;
+
+   if ((err = add_bearer_name(nlh, opts, cmdl, bname)))
+   return err;
+
+   return enable_udp_bearer(nlh, opts, cmdl);
+}
+
 static void cmd_bearer_enable_help(struct cmdl *cmdl)
 {
fprintf(stderr,
@@ -206,7 +240,7 @@ static int cmd_bearer_enable(struct nlmsghdr *nlh, const 
struct cmd *cmd,
struct nlattr *nest;
char buf[MNL_SOCKET_BUFFER_SIZE];
char bname[TIPC_MAX_BEARER_NAME];
-   char *media;
+   struct tipc_bearer_ops *bearer_oper;
struct opt opts[] = {
{ "device", NULL },
{ "domain", NULL },
@@ -226,14 +260,13 @@ static int cmd_bearer_enable(struct nlmsghdr *nlh, const 
struct cmd *cmd,
return -EINVAL;
}
 
-   if (!(opt = get_opt(opts, "media"))) {
-   if (help_flag)
-   (cmd->help)(cmdl);
-   else
-   fprintf(stderr, "error, missing bearer media\n");
+   if ((err = cmd_find_bearer_ops(cmd, cmdl, opts, _oper)))
+   return err;
+
+   if (help_flag) {
+   bearer_oper->enable_help(cmdl);
return -EINVAL;
}
-   media = opt->val;
 
if ((err = cmd_get_unique_bearer_name(cmd, cmdl, opts, bname)))
return err;
@@ -255,32 +288,23 @@ static int cmd_bearer_enable(struct nlmsghdr *nlh, const 
struct cmd *cmd,
mnl_attr_nest_end(nlh, props);
}
 
-   mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
+   if ((err = bearer_oper->add(nlh, opts, cmdl, bname)))
+   return err;
 
-   if (strcmp(media, "udp") == 0) {
-   if (help_flag) {
-   cmd_bearer_enable_udp_help(cmdl);
-   return -EINVAL;
-   }
-   if ((err = enable_udp_bearer(nlh, opts, cmdl)))
-   return err;
-   } else if 

[tipc-discussion] [PATCH iproute2 v3 03/10] tipc: validate bearer arguments early

2016-06-02 Thread Parthasarathy Bhuvaragan
In this commit, we validate the arguments as early as possible.
There is no functional change.

Signed-off-by: Parthasarathy Bhuvaragan 
---
 tipc/bearer.c | 51 ++-
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/tipc/bearer.c b/tipc/bearer.c
index d6f1edf5b4c5..c3494e96d3e3 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -331,14 +331,6 @@ static int cmd_bearer_disable(struct nlmsghdr *nlh, const 
struct cmd *cmd,
if ((err = cmd_get_unique_bearer_name(cmd, cmdl, opts, bname)))
return err;
 
-   if (!(nlh = msg_init(buf, TIPC_NL_BEARER_DISABLE))) {
-   fprintf(stderr, "error, message initialisation failed\n");
-   return -1;
-   }
-
-   nest = mnl_attr_nest_start(nlh, TIPC_NLA_BEARER);
-   mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
-
if (strcmp(media, "udp") == 0) {
if (help_flag) {
cmd_bearer_disable_udp_help(cmdl);
@@ -353,6 +345,15 @@ static int cmd_bearer_disable(struct nlmsghdr *nlh, const 
struct cmd *cmd,
fprintf(stderr, "error, invalid media type \"%s\"\n", media);
return -EINVAL;
}
+
+   if (!(nlh = msg_init(buf, TIPC_NL_BEARER_DISABLE))) {
+   fprintf(stderr, "error, message initialisation failed\n");
+   return -1;
+   }
+
+   nest = mnl_attr_nest_start(nlh, TIPC_NLA_BEARER);
+   mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
+
mnl_attr_nest_end(nlh, nest);
 
return msg_doit(nlh, NULL, NULL);
@@ -424,6 +425,15 @@ static int cmd_bearer_set_prop(struct nlmsghdr *nlh, const 
struct cmd *cmd,
if (parse_opts(opts, cmdl) < 0)
return -EINVAL;
 
+   if (!(opt = get_opt(opts, "media"))) {
+   fprintf(stderr, "error, missing media\n");
+   return -EINVAL;
+   }
+   media = opt->val;
+
+   if ((err = cmd_get_unique_bearer_name(cmd, cmdl, opts, bname)))
+   return err;
+
if (!(nlh = msg_init(buf, TIPC_NL_BEARER_SET))) {
fprintf(stderr, "error, message initialisation failed\n");
return -1;
@@ -434,15 +444,6 @@ static int cmd_bearer_set_prop(struct nlmsghdr *nlh, const 
struct cmd *cmd,
mnl_attr_put_u32(nlh, prop, val);
mnl_attr_nest_end(nlh, props);
 
-   if (!(opt = get_opt(opts, "media"))) {
-   fprintf(stderr, "error, missing media\n");
-   return -EINVAL;
-   }
-   media = opt->val;
-
-   if ((err = cmd_get_unique_bearer_name(cmd, cmdl, opts, bname)))
-   return err;
-
mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
 
if (strcmp(media, "udp") == 0) {
@@ -559,11 +560,6 @@ static int cmd_bearer_get_prop(struct nlmsghdr *nlh, const 
struct cmd *cmd,
if (parse_opts(opts, cmdl) < 0)
return -EINVAL;
 
-   if (!(nlh = msg_init(buf, TIPC_NL_BEARER_GET))) {
-   fprintf(stderr, "error, message initialisation failed\n");
-   return -1;
-   }
-
if (!(opt = get_opt(opts, "media"))) {
fprintf(stderr, "error, missing media\n");
return -EINVAL;
@@ -573,9 +569,6 @@ static int cmd_bearer_get_prop(struct nlmsghdr *nlh, const 
struct cmd *cmd,
if ((err = cmd_get_unique_bearer_name(cmd, cmdl, opts, bname)))
return err;
 
-   attrs = mnl_attr_nest_start(nlh, TIPC_NLA_BEARER);
-   mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
-
if (strcmp(media, "udp") == 0) {
if (help_flag) {
cmd_bearer_get_udp_help(cmdl);
@@ -590,6 +583,14 @@ static int cmd_bearer_get_prop(struct nlmsghdr *nlh, const 
struct cmd *cmd,
fprintf(stderr, "error, invalid media type \"%s\"\n", media);
return -EINVAL;
}
+
+   if (!(nlh = msg_init(buf, TIPC_NL_BEARER_GET))) {
+   fprintf(stderr, "error, message initialisation failed\n");
+   return -1;
+   }
+
+   attrs = mnl_attr_nest_start(nlh, TIPC_NLA_BEARER);
+   mnl_attr_put_strz(nlh, TIPC_NLA_BEARER_NAME, bname);
mnl_attr_nest_end(nlh, attrs);
 
return msg_doit(nlh, bearer_get_cb, );
-- 
2.1.4


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net

[tipc-discussion] [PATCH iproute2 v3 00/10] tipc: updates for neighbour monitor

2016-06-02 Thread Parthasarathy Bhuvaragan
This commit series requires the following kernel patch set:
"[PATCH net-next v2 0/5] tipc: netlink updates for neighbour monitor"

v3: - simplified the header layouts in commit#9.
- updated man pages.

v2: - split patches into self-contained complete commits.
- address review comments from richard alpe.
- cleanup of tipc bearer.
- introduce tipc link monitor summary

Note:
1. I have issues compiling the latest iproute2 package, so compiled
   on commit c13b6b097ab3 "add coverity model file".
2. This series conflicts with:
   "[PATCH iproute2 0/4] introduce bearer get and bearer add".
   needs rebase when submiting to net-next.

regards
Partha

Parthasarathy Bhuvaragan (10):
  tipc: remove dead code
  tipc: introduce cmd_get_unique_bearer_name() function
  tipc: validate bearer arguments early
  tipc: fix bearer operations with media=ib
  tipc: add link monitor set threshold
  tipc: add link monitor get threshold
  tipc: add link monitor summary
  tipc: export some bearer helper functions
  tipc: add link monitor list
  tipc: update man page for link monitor

 include/linux/tipc_netlink.h |  37 
 man/man8/tipc-link.8 | 101 +++
 tipc/bearer.c| 412 ---
 tipc/bearer.h|   3 +
 tipc/link.c  | 376 ++-
 5 files changed, 744 insertions(+), 185 deletions(-)

-- 
2.1.4


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


Re: [tipc-discussion] [RFC PATCH] tipc: fix timer handling when socket is owned

2016-06-02 Thread Jon Maloy


From: Erik Hugne [mailto:erik.hu...@gmail.com] 
Sent: Thursday, 02 June, 2016 14:11
To: Ying Xue
Cc: Richard Alpe; Parthasarathy Bhuvaragan; Jon Maloy; 
tipc-discussion@lists.sourceforge.net
Subject: RE: [RFC PATCH] tipc: fix timer handling when socket is owned


On Jun 2, 2016 1:03 PM, "Xue, Ying"  wrote:
>>
>> Acked-by: Ying Xue 
>>
>> Jon, whatever the patch can fix Guna's issue or not, I think the change is 
>> right because there is an obvious error that we deliver message through 
>> tipc_node_xmit_skb() when "owner" flag is set.
>> So, I suggest that the patch should be submitted to upstream as soon as 
>> possible.
>>
>If you think the change is reasonable, could you please help me test it?
>My crappy AMD A10 laptop does not handle VM's well..
>I have one concern about it, locking policy have changed slightly since 
>tipc_node_xmit_skb is now called with the socket spinlock held. And i dont 
>know if this introduces a new race..

Logically it should be ok, since it only means that the response message always 
ends up in the backlog queue. But it is still an unnecessary change. 
Personally I liked better the first proposal, which I think was simpler.

Why not
1) grab the lock and the mutex, if necessary after several attempts.
2) fetch all relevant socket fields to the stack.
3) release the lock and the mutex
4) create the message
5) send the message

This would give only one timeout function and minimal time spent inside the 
lock/mutex.
I  you do so you should also extend the wait period for retrial to more e.g., 1 
 second until you retry. The risk of finding the socket busy again after a 
longer period is lower.

///jon


>//E
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


Re: [tipc-discussion] [RFC PATCH] tipc: fix timer handling when socket is owned

2016-06-02 Thread Erik Hugne
On Jun 2, 2016 1:03 PM, "Xue, Ying"  wrote:
>
> Acked-by: Ying Xue 
>
> Jon, whatever the patch can fix Guna's issue or not, I think the change
is right because there is an obvious error that we deliver message through
tipc_node_xmit_skb() when "owner" flag is set.
> So, I suggest that the patch should be submitted to upstream as soon as
possible.
>

If you think the change is reasonable, could you please help me test it?
My crappy AMD A10 laptop does not handle VM's well..

I have one concern about it, locking policy have changed slightly since
tipc_node_xmit_skb is now called with the socket spinlock held. And i dont
know if this introduces a new race..

//E
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


Re: [tipc-discussion] tipc_sk_rcv: Kernel panic on one of the card on 4.4.0

2016-06-02 Thread Xue, Ying
Hi Guna,

Please see my comments below.

Regards,
Ying

-Original Message-
From: GUNA [mailto:gbala...@gmail.com] 
Sent: 2016年6月1日 23:26
To: Xue, Ying
Cc: Jon Maloy; Jon Maloy; tipc-discussion@lists.sourceforge.net; Erik Hugne; 
Xue Ying (ying.x...@gmail.com)
Subject: Re: [tipc-discussion] tipc_sk_rcv: Kernel panic on one of the card on 
4.4.0

If the issue is reproducible then I could try with Erik's patch even
though the root cause is unknown. Currently, we are not clear yet on
root cause of the issue. I could add the patch on production release,
only if the patch will fix the issue.

[Ying] Understood your meaning. I think Erik's patch should be merged into 
upstream whatever it can fix your issue or not. But in my opinion, it should be 
able to fix it.

 Otherwise, I may need to find
test stream.

As per Erik's proposal,
==
if (sock_owned_by_user(sk))
we can reschedule timer for a retry in a few jiffies
==

I tried to call sk_reset_timer(sk, >sk_timer, (HZ / 20));
but the code or similar already is in place at tipc_sk_timeout() as
marked by "<<==" below"

if (tsk->probing_state == TIPC_CONN_PROBING) {
  if (!sock_owned_by_user(sk))
...
  else
sk_reset_timer(sk, >sk_timer, (HZ / 20));   <<==
} else {
   sk_reset_timer(sk, >sk_timer, jiffies + tsk->probing_intv);  <<==
}

Please let me know If I need to add/modify any.

[Ying] your change above is right and it should be workable. But I still 
suggest you should adopt Erik's patch("tipc: fix timer handling when socket is 
owned ") as it's much better than above solution.

thanks,
Guna

On Wed, Jun 1, 2016 at 7:31 AM, Xue, Ying  wrote:
> Hi GUNA,
>
> Thanks for your confirmation, which is very important for us to look into 
> what happened in 4.4.0 version.
> Yes, my mentioned Erik's patch is just as Erik said: "tipc: fix timer 
> handling when socket is owned".
>
> I also agree to Erik's solution as its change is more common method to deal 
> with the case when owner flag is not set in BH.
>
> But now we still need to know what root cause is the issue.
>
> If possible, please apply Erik's patch on your side to check whether the 
> issue occurs or not.
>
> Regards,
> Ying
>
> -Original Message-
> From: GUNA [mailto:gbala...@gmail.com]
> Sent: 2016年5月31日 23:34
> To: Xue, Ying
> Cc: Jon Maloy; Jon Maloy; tipc-discussion@lists.sourceforge.net; Erik Hugne; 
> Xue Ying (ying.x...@gmail.com)
> Subject: Re: [tipc-discussion] tipc_sk_rcv: Kernel panic on one of the card 
> on 4.4.0
>
> Just want to clarify, system was upgraded only the kernel from 3.4.2
> to 4.4.0 + some tipc patches on Fedora distribution. That said, the
> patch, "net: do not block BH while processing socket backlog" is not
> part of the 4.4.0. So, the issue is not due to this commit.
>
> If the patch, "tipc: block BH in TCP callbacks" could resolve the
> issue then I could try applying the patch. However the issue is not
> reproducible. So, we may not get the result right away.
>
> Which Erik's patch you are talking about?
> Is this one, "tipc: fix timer handling when socket is owned" ?
>
>
> /// Guna
>
> On Tue, May 31, 2016 at 3:49 AM, Xue, Ying  wrote:
>> Hi Jon,
>>
>> Today, I spent time further analyzing its potential root cause why the soft 
>> lockup occurred regarding log provided by GUNA. But I don't find some 
>> valuable hints.
>>
>> To be honest, even if CONN_MANAGER/CONN_PROBE message is sent through 
>> tipc_node_xmit_skb() without holding "owner" flag in tipc_sk_timeout(), 
>> deadlock should not happen in theory. Before the tipc_sk_rcv() is secondly 
>> called, destination port and source port of CONN_MANAGER/CONN_PROBE message 
>> created in tipc_sk_timeout() have been reversed. As a result, the tsk found 
>> at (*1) is different with another tsk found at (*2) because we use different 
>> destination number to look up tsk instances.
>>
>> tipc_sk_timeout()
>>   create: CONN_MANAGER/CONN_PROBE msg (src port= tsk->portid, dst port = 
>> peer_port)
>>   tipc_node_xmit_skb()
>> tipc_node_xmit()
>>   tipc_sk_rcv()
>> tsk = tipc_sk_lookup(net, dport); // use dst port(peer_port) to look 
>> up tsk, and the tsk is called tsk1 (*1)
>> if (likely(spin_trylock_bh(>sk_lock.slock)))
>> tipc_sk_enqueue()
>>   filter_rcv()
>> tipc_sk_proto_rcv()
>>tipc_sk_respond()
>>  reverse ports: dport = tsk->portid;  src port = 
>> peer_port
>>  tipc_node_xmit_skb()
>>tipc_node_xmit()
>>   tipc_sk_rcv()
>>  tsk = tipc_sk_lookup(net, dport); // use dst 
>> port(portid) to look up tsk, and the tsk is supposed as tsk2 --(*2)
>>  if (likely(spin_trylock_bh(>sk_lock.slock)))
>>
>> So even if "owner" flag of tsk1 is not set, it's safe for us to operate tsk2 
>> in 

Re: [tipc-discussion] tipc: name table entry is not matched

2016-06-02 Thread Jon Maloy


> -Original Message-
> From: GUNA [mailto:gbala...@gmail.com]
> Sent: Wednesday, 01 June, 2016 19:52
> To: tipc-discussion@lists.sourceforge.net
> Subject: [tipc-discussion] tipc: name table entry is not matched
> 
> I am running on Kernel 4.4.0 and do see table Name table mismatch as
> per "tipc-config" tool. As per analysis, I do see only one entry is
> mismatched as indicated below. It is seen only on card13 CPU and no
> other CPUs (system has total 10 cards). The system is up 22 days.
> 
> Type   Lower  Upper  Port Identity  Publication Scope
> 5  6012   6012   <1.1.12:1619006126>1619006126  
> cluster
> 
> Does the entry not published to other cards or not removed it properly
> on card13 ?

The publication comes from node 1.1.12, which I assume is not the same as 
"card13"?
If so, it sounds quite likely that this is an orphan entry that has been 
cleaned up on all other nodes, but not on 1.1.13 for some reason.
You have to look back into your logs, or into what is really published and 
withdrawn on your system to verify this.

///jon

> 
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> ___
> tipc-discussion mailing list
> tipc-discussion@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tipc-discussion

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion