[ISSUE] Failed to find "enabled" option.
by Xin Long
I found this err in "loadbalance" and "lacp" runner when adding ports.
It's caused by trying to set "enabled" option in .port_link_changed()
or .port_changed().
When a new port is added, the first 'port changed event' process is
earlier than CMD TEAM_CMD_OPTIONS_GET, in this CMD, all
the options are synchronized from kernel.
It means there's no 'enabled' option yet when calling port_link_changed
in the first 'port changed event' process. In lb_event_watch_port_link_changed
and lacp_event_watch_port_changed, they call teamd_port_check_enable
to set 'enabled' option. this err is triggered.
I'm not sure why teamd_port_check_enable needs to check if
'enabled' option exists. I checked the ab's .port_link_changed(),
it just sets it by calling team_set_port_enabled(), instead of
checking 'enabled' option first.
can we just use team_set_port_enabled to set it directly in
.port(_link)_changed OR improve teamd_port_check_enable
to avoid this err ?
Thanks.
3 years, 8 months
Re: [patch libteam 3/3] teamd: lacp: introduce support for multiple
hwaddr policies
by Jiri Pirko
Tue, Nov 13, 2018 at 09:47:42PM CET, alexpe(a)mellanox.com wrote:
>Hi Jiri,
>
>Should I also submit a pull request on github?
No. Just send patches here.
>
>Alexander Petrovskiy
>Sr. System Engineer, Russia & CIS
>Mellanox Technologies
>Mobile: +7 (915) 407-3906
>
>On 05/11/18 19:11, "Jiri Pirko" <jiri(a)resnulli.us> wrote:
>
> Wed, Sep 19, 2018 at 05:27:26PM CEST, alexpe(a)mellanox.com wrote:
> >Allow user to change hwaddr policy for lacp runner, similar to
> >what is currently supported for ab runner:
> >- same_all - regular behaviour for LACP. team device will have MAC
> > of the first enslaved port or explicit MAC configured with hwaddr
> > option. All ports will have the same MAC as their team device.
> >- no_change - ports will not change their MAC. team device
> > will have MAC of the first enslaved port.
> >
> >Signed-off-by: Alexander Petrovskiy <alexpe(a)mellanox.com>
>
> Looks ok.
>
>
4 years, 6 months
[patch libteam] teamd: lacp: send LACPDU when port state transitions from DEFAULT to CURRENT
by Meng Koon Lim
Currently, when local port state become DEFAULTED, its Partner_State
field is set to 0x00
Bit 1 in Actor_State and Partner_State field is for LACP_Timeout. When
set, it means LACP fast is used.
If teamd_runner_lacp receives an LACPDU with Actor_State field bit 1
set, it transitions local port to CURRENT, and transmits LACPDU
If teamd_runner_lacp receives an LACPDU without Actor_State field bit 1
set, it transitions local port to CURRENT, but does not transmit LACPDU
The second scenario results in teamd starting data transmission when
partner port remains in either Defaulted or Expired state, causing
packets to be dropped by partner
Fix this by setting Partner_State field to 0x02 on the local port
when local port state transitions to DEFAULTED
Signed-off-by: Meng Koon Lim <mengkoon(a)live.com>
---
teamd/teamd_runner_lacp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 7b8f0a7..555aa06 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -965,7 +965,12 @@ static int lacp_port_set_state(struct lacp_port *lacp_port,
case PORT_STATE_DEFAULTED:
teamd_loop_callback_disable(lacp_port->ctx,
LACP_TIMEOUT_CB_NAME, lacp_port);
- /* fall through */
+ memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
+ lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT;
+ err = lacp_port_partner_update(lacp_port);
+ if (err)
+ return err;
+ break;
case PORT_STATE_DISABLED:
memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
err = lacp_port_partner_update(lacp_port);
--
2.14.3 (Apple Git-98)
4 years, 6 months
[patch libteam] teamd_runner_lacp.c : send LACPDU when port state transitions from DEFAULT to CURRENT
by Meng Koon Lim
Currently, when local port state become DEFAULTED, its Partner_State
field is set to 0x00
Bit 1 in Actor_State and Partner_State field is for LACP_Timeout. When
set, it means LACP fast is used.
If teamd_runner_lacp receives an LACPDU with Actor_State field bit 1
set, it transitions local port to CURRENT, and transmits LACPDU
If teamd_runner_lacp receives an LACPDU without Actor_State field bit 1
set, it transitions local port to CURRENT, but does not transmit LACPDU
The second scenario results in teamd starting data transmission when
partner port remains in either Defaulted or Expired state, causing
packets to be dropped by partner
Fix this by setting Partner_State field to 0x02 on the local port
when local port state transitions to DEFAULTED
Signed-off-by: Meng Koon Lim <mengkoon(a)live.com>
---
teamd/teamd_runner_lacp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 7b8f0a7..555aa06 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -965,7 +965,12 @@ static int lacp_port_set_state(struct lacp_port *lacp_port,
case PORT_STATE_DEFAULTED:
teamd_loop_callback_disable(lacp_port->ctx,
LACP_TIMEOUT_CB_NAME, lacp_port);
- /* fall through */
+ memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
+ lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT;
+ err = lacp_port_partner_update(lacp_port);
+ if (err)
+ return err;
+ break;
case PORT_STATE_DISABLED:
memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
err = lacp_port_partner_update(lacp_port);
--
2.14.3 (Apple Git-98)
4 years, 6 months
[patch libteam] teamd_runner_lacp.c : send LACPDU when port state transitions from DEFAULT to CURRENT
by Meng Koon Lim
Currently, when local port state become DEFAULTED, its Partner_State
field is set to 0x00
Bit 1 in Actor_State and Partner_State field is for LACP_Timeout. When
set, it means LACP fast is used.
If teamd_runner_lacp receives an LACPDU with Actor_State field bit 1
set, it transitions local port to CURRENT, and transmits LACPDU
If teamd_runner_lacp receives an LACPDU without Actor_State field bit 1
set, it transitions local port to CURRENT, but does not transmit LACPDU
The second scenario results in teamd starting data transmission when
partner port remains in either Defaulted or Expired state, causing
packets to be dropped by partner
This is fixed by setting Partner_State field to 0x02 on the local port
when local port state transitions to DEFAULTED
Signed-off-by: Meng Koon Lim <mengkoon(a)live.com>
---
teamd/teamd_runner_lacp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 7b8f0a7..555aa06 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -965,7 +965,12 @@ static int lacp_port_set_state(struct lacp_port *lacp_port,
case PORT_STATE_DEFAULTED:
teamd_loop_callback_disable(lacp_port->ctx,
LACP_TIMEOUT_CB_NAME, lacp_port);
- /* fall through */
+ memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
+ lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT;
+ err = lacp_port_partner_update(lacp_port);
+ if (err)
+ return err;
+ break;
case PORT_STATE_DISABLED:
memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
err = lacp_port_partner_update(lacp_port);
--
2.14.3 (Apple Git-98)
4 years, 6 months
[patch libteam] teamd/teamd_runner_lacp:PORT_STATE_DEFAULTED use 0x02
by Meng Koon Lim
if new state is PORT_STATE_DEFAULTED, set lacp_port->partner.state
to 0x02
This ensures LACPDU is sent to update the far side when
local port transitions from default to current
Currently, local port moves from default to current without
sending LACPDU until 30sec later. This causes traffic disruption
because far side has not completed negotiation
Using 0x02 also cause LACPDU to be sent every 1 sec as long as
port remains in defaulted state and LACP mode used is "active"
Signed-off-by: Meng Koon Lim <mengkoon(a)live.com>
---
teamd/teamd_runner_lacp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 7b8f0a7..555aa06 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -965,7 +965,12 @@ static int lacp_port_set_state(struct lacp_port *lacp_port,
case PORT_STATE_DEFAULTED:
teamd_loop_callback_disable(lacp_port->ctx,
LACP_TIMEOUT_CB_NAME, lacp_port);
- /* fall through */
+ memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
+ lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT;
+ err = lacp_port_partner_update(lacp_port);
+ if (err)
+ return err;
+ break;
case PORT_STATE_DISABLED:
memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
err = lacp_port_partner_update(lacp_port);
--
2.14.3 (Apple Git-98)
4 years, 6 months
[patch libteam] if new state is PORT_STATE_DEFAULTED, set lacp_port->partner.state to 0x02 This ensures LACPDU is sent to update the far side when local local port transitions from default to current Currently, local port moves from default to current without sending LACPDU until 30sec later. This causes traffic disruption because far side has not completed negotiation Using 0x02 also cause LACPDU to be sent every 1 sec as long as port remains in defaulted state and LACP mode used is "active"
by Meng Koon Lim
Signed-off-by: Meng Koon Lim <mengkoon(a)live.com>
---
teamd/teamd_runner_lacp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 7b8f0a7..555aa06 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -965,7 +965,12 @@ static int lacp_port_set_state(struct lacp_port *lacp_port,
case PORT_STATE_DEFAULTED:
teamd_loop_callback_disable(lacp_port->ctx,
LACP_TIMEOUT_CB_NAME, lacp_port);
- /* fall through */
+ memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
+ lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT;
+ err = lacp_port_partner_update(lacp_port);
+ if (err)
+ return err;
+ break;
case PORT_STATE_DISABLED:
memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
err = lacp_port_partner_update(lacp_port);
--
2.14.3 (Apple Git-98)
4 years, 6 months
[PATCH 2/2] man teamd.conf: Document ARP Ping link_watch.vlanid option
by Patrick Talbert
Signed-off-by: Patrick Talbert <ptalbert(a)redhat.com>
---
man/teamd.conf.5 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/man/teamd.conf.5 b/man/teamd.conf.5
index c4672bf..9bdf46a 100644
--- a/man/teamd.conf.5
+++ b/man/teamd.conf.5
@@ -352,6 +352,14 @@ Default:
.BR "false"
.RE
.TP
+.BR "link_watch.vlanid "| " ports.PORTIFNAME.link_watch.vlanid " (int)
+By default, ARP requests are sent without VLAN tags. This option causes outgoing ARP requests to be sent with the specified VLAN ID number.
+.RS 7
+.PP
+Default:
+.BR "None"
+.RE
+.TP
.BR "link_watch.send_always "| " ports.PORTIFNAME.link_watch.send_always " (bool)
By default, ARP requests are sent on active ports only. This option allows sending even on inactive ports.
.RS 7
--
1.8.3.1
4 years, 6 months
[PATCH 1/2] man teamd.conf: fix indentation of link_watch.send_always
by Patrick Talbert
Signed-off-by: Patrick Talbert <ptalbert(a)redhat.com>
---
man/teamd.conf.5 | 1 +
1 file changed, 1 insertion(+)
diff --git a/man/teamd.conf.5 b/man/teamd.conf.5
index a252042..c4672bf 100644
--- a/man/teamd.conf.5
+++ b/man/teamd.conf.5
@@ -354,6 +354,7 @@ Default:
.TP
.BR "link_watch.send_always "| " ports.PORTIFNAME.link_watch.send_always " (bool)
By default, ARP requests are sent on active ports only. This option allows sending even on inactive ports.
+.RS 7
.PP
Default:
.BR "false"
--
1.8.3.1
4 years, 6 months
[PATCH] libteam/options: fix s32/u32 data storage on big endian
by Hangbin Liu
When put signed/unsigned int data to long on big endian(PPC64) and read it as
singed/unsigned int, we will read from high bytes and get wrong number, e.g.
wrong active port index and priority values.
Fix it by using signed/unsiged int directly when store s32/u32 values.
Signed-off-by: Hangbin Liu <liuhangbin(a)gmail.com>
---
libteam/options.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/libteam/options.c b/libteam/options.c
index 3f444cf..71cc99e 100644
--- a/libteam/options.c
+++ b/libteam/options.c
@@ -258,12 +258,13 @@ int get_options_handler(struct nl_msg *msg, void *arg)
bool changed;
int nla_type;
int opt_type;
- long tmp;
- bool tmp_bool;
void *data;
int data_len = 0;
int err;
struct nlattr *data_attr;
+ unsigned int tmp_u32;
+ bool tmp_bool;
+ int tmp_s32;
if (nla_parse_nested(option_attrs, TEAM_ATTR_OPTION_MAX,
nl_option, NULL)) {
@@ -304,8 +305,8 @@ int get_options_handler(struct nl_msg *msg, void *arg)
switch (nla_type) {
case NLA_U32:
- tmp = (long) nla_get_u32(data_attr);
- data = &tmp;
+ tmp_u32 = nla_get_u32(data_attr);
+ data = &tmp_u32;
opt_type = TEAM_OPTION_TYPE_U32;
break;
case NLA_STRING:
@@ -323,8 +324,8 @@ int get_options_handler(struct nl_msg *msg, void *arg)
opt_type = TEAM_OPTION_TYPE_BOOL;
break;
case NLA_S32:
- tmp = (long) nla_get_s32(data_attr);
- data = &tmp;
+ tmp_s32 = nla_get_s32(data_attr);
+ data = &tmp_s32;
opt_type = TEAM_OPTION_TYPE_S32;
break;
default:
--
2.5.5
4 years, 6 months