From patchwork Tue Nov 7 04:33:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 10045691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A334E6032D for ; Tue, 7 Nov 2017 04:33:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98A7829E23 for ; Tue, 7 Nov 2017 04:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DA3E29E28; Tue, 7 Nov 2017 04:33:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bastion.fedoraproject.org (bastion01.fedoraproject.org [209.132.181.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0ACD329E23 for ; Tue, 7 Nov 2017 04:33:51 +0000 (UTC) Received: from mailman01.phx2.fedoraproject.org (mailman01.phx2.fedoraproject.org [10.5.126.36]) by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id 858A060A35B5; Tue, 7 Nov 2017 04:33:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org 858A060A35B5 Authentication-Results: bastion01.phx2.fedoraproject.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CZaN5+jV" Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 7AADC21A1173B; Tue, 7 Nov 2017 04:33:50 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 7640E21A1173B; Tue, 7 Nov 2017 04:33:46 +0000 (UTC) Received: from smtp-mm-ib01.fedoraproject.org (smtp-mm-ib01.vpn.fedoraproject.org [192.168.1.83]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id E8CE6219D2C03 for ; Tue, 7 Nov 2017 04:33:45 +0000 (UTC) Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by smtp-mm-ib01.fedoraproject.org (Postfix) with ESMTPS id 73D41605D24D for ; Tue, 7 Nov 2017 04:33:45 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id y5so10044557pgq.7 for ; Mon, 06 Nov 2017 20:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=1Jw9aGCFPs5tcle5O5+2kY4ZTe/LUFDG39sxBKt/TBM=; b=CZaN5+jVp0B5IbQ51yYuO2/7INC/dnfA2bgo/wZJxmhl93Xg5J4nEiw9dM+w6FES+3 0lWVvp2O4bXYCi9XqmUZQ0y4GvK1dGnPgBfch69+FflPyyzzXLPwmX4Yf2DQifNOUeZA UuG13Cbeo6i0YJUTUFxy73h+NJMkq2jCrXJsGg426gnRc8SfmcwD61bbzGn0Whk4C3KE lVmEptSyvG8G4eJTA0sd0q1pH+onDUwQH5w5LtS1Q5U2MtFbrBU0EJ+OF690nB2/7Gpl P2vZGldf70uYIwhzBvImMyluOL+bd3S7lw8Bgp5ovm4WyX6S3MSfU4doMxNU5TMm0YS1 zjZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=1Jw9aGCFPs5tcle5O5+2kY4ZTe/LUFDG39sxBKt/TBM=; b=JWL77pt6IR0gR3tmROgm1J/Jq2ShrRyEqE9CEX8FLuhunmyox3shYa1ubUl5ms+YTa kMKMbd3QFWxfk63hbvSJbHKxQCSKUJczXzkYAjHxQPqw49UcNGwiW+tAGIVOQTjPRKUI bl9U+J8culbzb2fFiSoKboeLRX7ADD19b84WrU7ooxgIbW2SeDLbPpSuAVqkF8YbuouK FSbUutBBcnyEy70Sls1eZUlN6xJGQH4/xXnSNULI0CTpYVeWYw9jAXPWmrBkXkkKPfsB AzceBV8rP42GtIyvRiGa+5AY1IEzUY5e0hrDeAjNn96pegg7KlNRqjoy6R3LveHzaWdi i72Q== X-Gm-Message-State: AMCzsaXYOs46ZUWyUd7TysOYoUbQUvADk+1gyhdSPjPesjBexMgPjSU4 6zcdC8VTE1RMRkcsk1fTxUgj3KzC X-Google-Smtp-Source: ABhQp+SYO8zo8Tg1xeEgWOWVYRzwwkIjBEo/7B9M/0h2at1IyTAfnoW7PujK5dUi6CZvEhE58WTbDg== X-Received: by 10.101.81.10 with SMTP id f10mr17398352pgq.148.1510029224391; Mon, 06 Nov 2017 20:33:44 -0800 (PST) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id q16sm466628pgq.79.2017.11.06.20.33.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 20:33:43 -0800 (PST) From: Xin Long To: libteam@lists.fedorahosted.org, Jiri Pirko Subject: [PATCH] teamd: add port_hwaddr_changed for lacp runner Date: Tue, 7 Nov 2017 12:33:36 +0800 Message-Id: <861ab5ce75c128ea3688af03b0bd462bd2e695e6.1510029216.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 Message-ID-Hash: 6SECIN3OAGEICPF5DEULE6I5Z5E5F3B6 X-Message-ID-Hash: 6SECIN3OAGEICPF5DEULE6I5Z5E5F3B6 X-MailFrom: lucien.xin@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.1.0 Precedence: list List-Id: Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP To fix the same issue fixed in commit efaa6ae709bb ("teamd: add port_hwaddr_changed for ab runner") for lacp runner, this patch is to add .port_hwaddr_changed for lacp runner as well. Signed-off-by: Xin Long --- teamd/teamd_runner_lacp.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) -- 2.1.0 diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c index 1310f67..7b8f0a7 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -1336,6 +1336,31 @@ static int lacp_event_watch_hwaddr_changed(struct teamd_context *ctx, return 0; } +static int lacp_event_watch_port_hwaddr_changed(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv) +{ + struct lacp_port *lacp_port; + struct lacp *lacp = priv; + int err; + + if (!teamd_port_present(ctx, tdport)) + return 0; + + if (!memcmp(team_get_ifinfo_hwaddr(tdport->team_ifinfo), + ctx->hwaddr, ctx->hwaddr_len)) + return 0; + + err = lacp_port_set_mac(ctx, tdport); + if (err) + return err; + + lacp_port = lacp_port_get(lacp, tdport); + lacp_port_actor_system_update(lacp_port); + + return 0; +} + static int lacp_event_watch_admin_state_changed(struct teamd_context *ctx, void *priv) { @@ -1389,6 +1414,7 @@ static int lacp_event_watch_port_changed(struct teamd_context *ctx, static const struct teamd_event_watch_ops lacp_event_watch_ops = { .hwaddr_changed = lacp_event_watch_hwaddr_changed, + .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, .port_added = lacp_event_watch_port_added, .port_removed = lacp_event_watch_port_removed, .port_changed = lacp_event_watch_port_changed,