Release anytime soon?
by J Farkas
Hi!
I'm using the latest code from github, and I would also like to have it packaged for a distribution which does not have libteam yet - https://github.com/void-linux/void-packages/pull/33028
They are making a point that it's preferable using a proper upstream release. As far as I can see, the commits since 1.31 appear somewhat important. On the other hand, even the latest github changes are somewhat old, so I can't see anything unstable about it.
For the benefit of a cleaner packaging, are there any plans to make a numbered release anytime soon?
Janos
1 year, 5 months
nsna_ping EADDRNOTAVAIL
by Ivan Afonichev
Hello
nsna_ping seems to convert target_host address to some multicast address and try to do something with it which is failing:
[root@osho ~]# ps aux | grep team
root 475399 0.0 0.0 8580 4064 ? S 01:35 0:00 /usr/bin/teamd -o -n -U -D -N -t team0 -c { "runner": { "name": "activebackup" }, "link_watch": { "name": "nsna_ping", "target_host": "fe80::1e98:ecff:febf:8000" } }
root 475970 0.0 0.0 6164 2256 pts/0 S+ 01:47 0:00 grep --color=auto team
[root@osho ~]# LC_ALL=C strace -p 475399
strace: Process 475399 attached
pselect6(23, [3 9 10 14 15 16 19 20 22], [], [15], NULL, NULL) = 1 (in [22])
read(22, "\1\0\0\0\0\0\0\0", 8) = 8
getsockname(20, {sa_family=AF_PACKET, sa_data="\0\3\3\0\0\0\1\0\0\6<\354\357rE\327"}, [20 => 18]) = 0
sendto(21, "\207\0\0\0\0\0\0\0\376\200\0\0\0\0\0\0\36\230\354\377\376\277\200\0\1\1<\354\357rE\327", 32, 0, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "ff02::1:ffbf:8000", &sin6_addr), sin6_scope_id=if_nametoindex("eno2np1")}, 28) = -1 EADDRNOTAVAIL (Cannot assign requested address)
pselect6(23, [3 9 10 14 15 16 19 20 22], [], [15], NULL, NULL) = 1 (in [22])
read(22, "\1\0\0\0\0\0\0\0", 8) = 8
getsockname(20, {sa_family=AF_PACKET, sa_data="\0\3\3\0\0\0\1\0\0\6<\354\357rE\327"}, [20 => 18]) = 0
sendto(21, "\207\0\0\0\0\0\0\0\376\200\0\0\0\0\0\0\36\230\354\377\376\277\200\0\1\1<\354\357rE\327", 32, 0, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "ff02::1:ffbf:8000", &sin6_addr), sin6_scope_id=if_nametoindex("eno2np1")}, 28) = -1 EADDRNOTAVAIL (Cannot assign requested address)
pselect6(23, [3 9 10 14 15 16 19 20 22], [], [15], NULL, NULL) = 1 (in [22])
read(22, "\1\0\0\0\0\0\0\0", 8) = 8
getsockname(20, {sa_family=AF_PACKET, sa_data="\0\3\3\0\0\0\1\0\0\6<\354\357rE\327"}, [20 => 18]) = 0
sendto(21, "\207\0\0\0\0\0\0\0\376\200\0\0\0\0\0\0\36\230\354\377\376\277\200\0\1\1<\354\357rE\327", 32, 0, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "ff02::1:ffbf:8000", &sin6_addr), sin6_scope_id=if_nametoindex("eno2np1")}, 28) = -1 EADDRNOTAVAIL (Cannot assign requested address)
pselect6(23, [3 9 10 14 15 16 19 20 22], [], [15], NULL, NULL^Cstrace: Process 475399 detached
<detached ...>
How is it intended to be working?
2 years
[patch v2 libteam 1/2] Collect and export statistics about total
probes sent
by Daniele Di Proietto
Collect statistics about the total number of probes sent for a
link-watcher. Only count a probe if send() doesn't return an error. If
send() returns an error (for example because the port is not currently
active), do not count it.
Export the value as a string, because int in jansson is limited to
32-bits (and, in general, JSON implementations do not handle 64-bits
values very well).
This is useful to monitor the arp_ping and nsna_ping link-watchers.
Signed-off-by: Daniele Di Proietto <ddiproietto(a)google.com>
---
v1->v2:
* Reword commit message to use imperative mood.
* Only count probes that were effectively sent on the wire by checking
the send() return value.
---
teamd/teamd_link_watch.h | 7 +++++++
teamd/teamd_lw_arp_ping.c | 21 +++++++++++++++------
teamd/teamd_lw_nsna_ping.c | 7 +++++++
teamd/teamd_lw_psr.c | 27 +++++++++++++++++++++++++--
4 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/teamd/teamd_link_watch.h b/teamd/teamd_link_watch.h
index ea7ef87..9c404be 100644
--- a/teamd/teamd_link_watch.h
+++ b/teamd/teamd_link_watch.h
@@ -1,6 +1,8 @@
#ifndef _TEAMD_LINK_WATCH_H_
#define _TEAMD_LINK_WATCH_H_
+#include <stdint.h>
+
#include "teamd_state.h"
struct teamd_link_watch {
@@ -40,6 +42,8 @@ struct lw_psr_port_priv {
unsigned int missed_max;
int sock;
unsigned int missed;
+ uint64_t total_probes_sent;
+ bool probe_sent;
bool reply_received;
};
@@ -77,5 +81,8 @@ int lw_psr_state_missed_max_get(struct teamd_context *ctx,
int lw_psr_state_missed_get(struct teamd_context *ctx,
struct team_state_gsc *gsc,
void *priv);
+int lw_psr_state_total_probes_sent_get(struct teamd_context *ctx,
+ struct team_state_gsc *gsc,
+ void *priv);
#endif
diff --git a/teamd/teamd_lw_arp_ping.c b/teamd/teamd_lw_arp_ping.c
index c3d4710..153a2e8 100644
--- a/teamd/teamd_lw_arp_ping.c
+++ b/teamd/teamd_lw_arp_ping.c
@@ -296,15 +296,19 @@ static int lw_ap_send(struct lw_psr_port_priv *psr_ppriv)
avp.vlanh.h_vlan_encapsulated_proto = htons(ETH_P_ARP);
avp.vlanh.h_vlan_TCI = htons(ap_ppriv->vlanid);
ll_bcast.sll_protocol = htons(ETH_P_8021Q);
- return teamd_sendto(psr_ppriv->sock, &avp, sizeof(avp),
- 0, (struct sockaddr *) &ll_bcast,
- sizeof(ll_bcast));
+ err = teamd_sendto(psr_ppriv->sock, &avp, sizeof(avp),
+ 0, (struct sockaddr *) &ll_bcast,
+ sizeof(ll_bcast));
} else {
ll_bcast.sll_protocol = htons(ETH_P_ARP);
- return teamd_sendto(psr_ppriv->sock, &ap, sizeof(ap),
- 0, (struct sockaddr *) &ll_bcast,
- sizeof(ll_bcast));
+ err = teamd_sendto(psr_ppriv->sock, &ap, sizeof(ap),
+ 0, (struct sockaddr *) &ll_bcast,
+ sizeof(ll_bcast));
}
+
+ if (!err)
+ psr_ppriv->probe_sent = true;
+ return err;
}
static int lw_ap_receive(struct lw_psr_port_priv *psr_ppriv)
@@ -477,6 +481,11 @@ static const struct teamd_state_val lw_ap_state_vals[] = {
.type = TEAMD_STATE_ITEM_TYPE_INT,
.getter = lw_psr_state_missed_get,
},
+ {
+ .subpath = "total_probes_sent",
+ .type = TEAMD_STATE_ITEM_TYPE_STRING,
+ .getter = lw_psr_state_total_probes_sent_get,
+ },
};
const struct teamd_link_watch teamd_link_watch_arp_ping = {
diff --git a/teamd/teamd_lw_nsna_ping.c b/teamd/teamd_lw_nsna_ping.c
index 9273462..b5648a7 100644
--- a/teamd/teamd_lw_nsna_ping.c
+++ b/teamd/teamd_lw_nsna_ping.c
@@ -227,6 +227,8 @@ static int lw_nsnap_send(struct lw_psr_port_priv *psr_ppriv)
err = teamd_sendto(nsnap_ppriv->tx_sock, &nsp, sizeof(nsp), 0,
(struct sockaddr *) &sendto_addr,
sizeof(sendto_addr));
+ if (!err)
+ psr_ppriv->probe_sent = true;
return err;
}
@@ -324,6 +326,11 @@ static const struct teamd_state_val lw_nsnap_state_vals[] = {
.type = TEAMD_STATE_ITEM_TYPE_INT,
.getter = lw_psr_state_missed_get,
},
+ {
+ .subpath = "total_probes_sent",
+ .type = TEAMD_STATE_ITEM_TYPE_STRING,
+ .getter = lw_psr_state_total_probes_sent_get,
+ },
};
const struct teamd_link_watch teamd_link_watch_nsnap = {
diff --git a/teamd/teamd_lw_psr.c b/teamd/teamd_lw_psr.c
index b0a41f4..d84e4a5 100644
--- a/teamd/teamd_lw_psr.c
+++ b/teamd/teamd_lw_psr.c
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+#include <stdio.h>
#include <private/misc.h>
#include "teamd.h"
#include "teamd_link_watch.h"
@@ -57,8 +59,11 @@ static int lw_psr_callback_periodic(struct teamd_context *ctx, int events, void
if (err)
return err;
psr_ppriv->reply_received = false;
-
- return psr_ppriv->ops->send(psr_ppriv);
+ psr_ppriv->probe_sent = false;
+ err = psr_ppriv->ops->send(psr_ppriv);
+ if (!err && psr_ppriv->probe_sent)
+ psr_ppriv->total_probes_sent++;
+ return err;
}
#define LW_SOCKET_CB_NAME "lw_socket"
@@ -235,3 +240,21 @@ int lw_psr_state_missed_get(struct teamd_context *ctx,
gsc->data.int_val = psr_ppriv->missed;
return 0;
}
+
+int lw_psr_state_total_probes_sent_get(struct teamd_context *ctx,
+ struct team_state_gsc *gsc,
+ void *priv)
+{
+ struct lw_common_port_priv *common_ppriv = priv;
+ struct lw_psr_port_priv *psr_ppriv = lw_psr_ppriv_get(common_ppriv);
+ char *str;
+ int err;
+
+ err = asprintf(&str, "%"PRIu64, psr_ppriv->total_probes_sent);
+ if (err == -1)
+ return -ENOMEM;
+
+ gsc->data.str_val.ptr = str;
+ gsc->data.str_val.free = true;
+ return 0;
+}
--
2.33.0.259.gc128427fd7-goog
2 years