Skip to content

Commit

Permalink
teamd: add port_master_ifindex_changed for link_watch_port_watch_ops
Browse files Browse the repository at this point in the history
This is a follow up of Commit b6f63db ("teamd: add
port_master_ifindex_changed for teamd_event_watch_ops")
to fix the same issue in it.

The issue is a race between option change event and ifinfo
(master_ifindex) change event, so wherever a option change
function tries to iterate tdport by teamd_for_each_tdport,
the same thing should be done in its master_ifindex change
function, including link_watch_port_watch_ops.

The fix has been verified in one customer's env where it
appeared no arp requests coming out on the only state-up
tdport prior to this patch.

Reported-by: Michal Tesar <mtesar@redhat.com>
Fixes: b6f63db ("teamd: add port_master_ifindex_changed for teamd_event_watch_ops")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
  • Loading branch information
lxin authored and jpirko committed Jul 2, 2019
1 parent a5b10a5 commit 5f35166
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions teamd/teamd_link_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,19 @@ static int link_watch_enabled_option_changed(struct teamd_context *ctx,
return link_watch_refresh_forced_send(ctx);
}


static int link_watch_port_master_ifindex_changed(struct teamd_context *ctx,
struct teamd_port *tdport,
void *priv)
{
return link_watch_refresh_forced_send(ctx);
}

static const struct teamd_event_watch_ops link_watch_port_watch_ops = {
.port_added = link_watch_event_watch_port_added,
.port_removed = link_watch_event_watch_port_removed,
.port_link_changed = link_watch_event_watch_port_link_changed,
.port_master_ifindex_changed = link_watch_port_master_ifindex_changed,
.option_changed = link_watch_enabled_option_changed,
.option_changed_match_name = "enabled",
};
Expand Down

0 comments on commit 5f35166

Please sign in to comment.