From patchwork Wed Aug 24 16:50:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12953813 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A166FC32796 for ; Wed, 24 Aug 2022 16:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237727AbiHXQvH (ORCPT ); Wed, 24 Aug 2022 12:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238106AbiHXQvC (ORCPT ); Wed, 24 Aug 2022 12:51:02 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E3CB3DF08 for ; Wed, 24 Aug 2022 09:51:01 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id e19so16438320pju.1 for ; Wed, 24 Aug 2022 09:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=2i3KeujLyTfdjSKnRoU3FEZcLbW2+erV0LGXF4FPZZA=; b=Y5Ke4scyehexTTs0zFtE8zAS1Pjf9LBdCiaJf9xjwmqMa2GrSc+rXA0hfpBwY9l+eg Zuz4bnbe6HbfI4yVnol/Sw82RMvycVFITkK7pUezFM+n4NND7bX21lE7pTiEwI40vldJ sscPLpcERmChdrUWUAwafYB9BIW8msL0pWy6kbjVFRcejGC928B5JjRwfFwjGm0BYroF LnE9Uc+f8Y/69k9yLZpMRExI9tZJlfhuAvVh7dxChE29rXGJqvT62Dm/u954pkQrGdiP XbHQ/960Jsx7nJnJr2ki8oWiRcjS5UhC3jv7jtNWE/RNZWeunuD56PI+dNvZTBup7zdT SrKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=2i3KeujLyTfdjSKnRoU3FEZcLbW2+erV0LGXF4FPZZA=; b=hO7q+UWmwVZkruH2gSzXwhN3cU2n9LZxfXXxio8frNo1xgYIVj0uol/4GEhCa9fAfp ysJbnIU/XvZWjJTVkYCiM24So0RqIg1eends5e9BuEGS9HD2OYfvd7X2yH1DrncX2eOt Amp/FB7bGBlnVaOoVgUQPLsNpegd42kBsE81DrFEw6RFXyfwN/r3GaSVMZZNCYq7H1mZ nUriLHTFbUgvF7NLOb0HKyRj1FAjZXBWJKw/E4h2zmN1wxSmRRJRZ7YX3XGXEmnvj9au fixSm9yBmw8hMovI7Fv5uxtt/7Z4S0raAUWyy+IiD3/sui/QS8fSPP6lHS/KhrNuCw40 6VzQ== X-Gm-Message-State: ACgBeo0IoLdaAHfGNVQ0RKnO7YmVW/nmXQbR2NFAphyEMuxulBy6nh65 lpP9dz+s1W+Of5wpDQAiuvEX5A== X-Google-Smtp-Source: AA6agR6ls1XMHrn2YiRY5yY68a7HCfhvRl1rx+JdGx4oLfwg9vURdnfiRyDyxVsQJ8bv4qcwrPaHTQ== X-Received: by 2002:a17:90b:4a51:b0:1fb:765c:8416 with SMTP id lb17-20020a17090b4a5100b001fb765c8416mr14997pjb.199.1661359860880; Wed, 24 Aug 2022 09:51:00 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id a68-20020a621a47000000b005366280c39fsm8960349pfa.140.2022.08.24.09.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 09:51:00 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, mohamed@pensando.io, Shannon Nelson Subject: [PATCH net 1/3] ionic: clear broken state on generation change Date: Wed, 24 Aug 2022 09:50:49 -0700 Message-Id: <20220824165051.6185-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220824165051.6185-1-snelson@pensando.io> References: <20220824165051.6185-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is a case found in heavy testing where a link flap happens just before a firmware Recovery event and the driver gets stuck in the BROKEN state. This comes from the driver getting interrupted by a FW generation change when coming back up from the link flap, and the call to ionic_start_queues() in ionic_link_status_check() fails. This can be addressed by having the fw_up code clear the BROKEN bit if seen, rather than waiting for a user to manually force the interface down and then back up. Fixes: 9e8eaf8427b6 ("ionic: stop watchdog when in broken state") Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 1443f788ee37..d4226999547e 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2963,6 +2963,9 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) mutex_lock(&lif->queue_lock); + if (test_and_clear_bit(IONIC_LIF_F_BROKEN, lif->state)) + dev_info(ionic->dev, "FW Up: clearing broken state\n"); + err = ionic_qcqs_alloc(lif); if (err) goto err_unlock; From patchwork Wed Aug 24 16:50:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12953814 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B9EDC00140 for ; Wed, 24 Aug 2022 16:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236041AbiHXQvI (ORCPT ); Wed, 24 Aug 2022 12:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238177AbiHXQvC (ORCPT ); Wed, 24 Aug 2022 12:51:02 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E0C54199C for ; Wed, 24 Aug 2022 09:51:02 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id c13-20020a17090a4d0d00b001fb6921b42aso2077697pjg.2 for ; Wed, 24 Aug 2022 09:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=oWLOzygyjS5rpLDBH1FgOXuMSnkjtkocd2Vk8iqi6eM=; b=vJI7S/bhMd7ZU1Enud0sIpp0y/jvUb7Y8HCRFLLELNImECSnJGKKWifX6BIKNthx8D J8Tec35vw6CPt0afWgUM8OUIgPaa33ncJT0VZ/nUA5KinoZLroGPP5dd75Ohb3Njwac3 BUyIJwB3xelunEmEhNd2P1To7LPT+OcP72ptBrMvJZQf8NsVA466jTNWWEZK1Lo3rMEr VvHlZc5JNEIG+sOckz+j4vaE7cx98YgFxE/Z7GwsbtwHx94bQYTBrSJmkxDWG9T6nBNA AVGI/Z1TkL8wBtl1r2kmHzjVG+6ZepsPjhKKCQ6QtIZ/+Dr5bBJGYSpF5Jf8/cQTcSlt H31g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=oWLOzygyjS5rpLDBH1FgOXuMSnkjtkocd2Vk8iqi6eM=; b=HzORzwQQ8SrfsG38zplbhnQJcPorv7c9wIpI5NHOY++l2Phzl6QKdAKjytqajrd7SU dbqistjIwneyoII1hYAx8VAI3HQqquhSf00ogHGcO//A/tziTu+LtqgQtO4mSHDuiGAN JKn3jd7vQNp4kG4eqt2bokPT1ekcBSiUV7GDAuXaHl7/KbnESwc6b5JHanz09KUQzhXp 0sDrX8SSNHmuxBFl+ItJxjbDScgVsr3g604YpBqp7m+uvGoo9UUGAKg1QOfmoloGeAxE lIiR3bmcHNqEmMQSTS3FJyRC10sBF7mwHcIfuDBl3hCFlcsM/b2/U69tmzTWOqU0/FFo cmbA== X-Gm-Message-State: ACgBeo3cXjy16rC8zr39g5Lg3VKxpb8BMu5AdWCHzhwW2GY94wnhmFkK /BHRZfS7gmWKpATTY40PFX3qDQ== X-Google-Smtp-Source: AA6agR6n4soFKu5WugOR+8jhPGCRhO4hGCpDfC7gKMUhIg8lLZxLPrtkXRQerL6yIeNMywJNR3lmZQ== X-Received: by 2002:a17:90a:4801:b0:1fa:98ec:fa2 with SMTP id a1-20020a17090a480100b001fa98ec0fa2mr35714pjh.41.1661359861774; Wed, 24 Aug 2022 09:51:01 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id a68-20020a621a47000000b005366280c39fsm8960349pfa.140.2022.08.24.09.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 09:51:01 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, mohamed@pensando.io, Shannon Nelson Subject: [PATCH net 2/3] ionic: fix up issues with handling EAGAIN on FW cmds Date: Wed, 24 Aug 2022 09:50:50 -0700 Message-Id: <20220824165051.6185-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220824165051.6185-1-snelson@pensando.io> References: <20220824165051.6185-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In looping on FW update tests we occasionally see the FW_ACTIVATE_STATUS command fail while it is in its EAGAIN loop waiting for the FW activate step to finsh inside the FW. The firmware is complaining that the done bit is set when a new dev_cmd is going to be processed. Doing a clean on the cmd registers and doorbell before exiting the wait-for-done and cleaning the done bit before the sleep prevents this from occurring. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 4029b4e021f8..56f93b030551 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -474,8 +474,8 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds, ionic_opcode_to_str(opcode), opcode, ionic_error_to_str(err), err); - msleep(1000); iowrite32(0, &idev->dev_cmd_regs->done); + msleep(1000); iowrite32(1, &idev->dev_cmd_regs->doorbell); goto try_again; } @@ -488,6 +488,8 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds, return ionic_error_to_errno(err); } + ionic_dev_cmd_clean(ionic); + return 0; } From patchwork Wed Aug 24 16:50:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12953815 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD3BC32792 for ; Wed, 24 Aug 2022 16:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238603AbiHXQvL (ORCPT ); Wed, 24 Aug 2022 12:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238546AbiHXQvE (ORCPT ); Wed, 24 Aug 2022 12:51:04 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381144505A for ; Wed, 24 Aug 2022 09:51:03 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id s206so15540504pgs.3 for ; Wed, 24 Aug 2022 09:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=HcU7Ka55rBgHejqe9QLCDYqCDvEmpAXeRKcao/ZWmS8=; b=5GiHYTpbTKxMErAmVBAt35u5jzqRJ3WQWrMiZk4SDiPOL2qmx5FthNVT/YE+Cv4an8 jXohV+Ga5y9qclBscCsOZANLqrMciLWJW5qbZG9desqA94nAFOMvXc+esBUN9ka73yto gdpn3JliDdK445h69EYyZa/Gu044dDA0XXuPI0+RgaNSgGUf0HIEIliPX/xA5/YEDaJe xCQ4aZEcsnuir7K9BxwBRJzwrq8alHQme2o8MjEnpDTlmnVXMgU78Ga462ujrJR+Yfys PsDknvxsKOivZfXlKqyp/enrg/XeJlideKXmo4c8R7Qaol9PDwgAHH0oYChX6+1TZ5Dt snDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=HcU7Ka55rBgHejqe9QLCDYqCDvEmpAXeRKcao/ZWmS8=; b=4M4wcMW9eQpKe+vUFrzaLhzz4OhgDr7AsBkoUU8NpCz0cQtyHm8Kd6+XvvrRg9bqpv nz4gklsA3QdaMTvPTVYtSrOCghj7YKCEcHPOAvuuKTJD0L1bE3bELHfdTUU2XC5d9dNa /tnzsZQ9d13tR+UHdN86ty0yymLmwv8CFkmN52aa1qJmPO4gv3kT16xRmT6yzSkxge4o 7y+N9vzDn9WBQnxfMa6PUjJWGoVrcp5Lj6IdA8dmOwhlpXwFoefokrFGgyQ6JRHLQ2f5 d2ezb6lFzDwbPnDqeEPfiNSRqDRqWaMC8i9XBci2TYha8jRuOKHur+pVF3CU1sfHJai7 8ugQ== X-Gm-Message-State: ACgBeo3DXAxQVuGhUpKVUKARGsUv2EVwIcG/Q/ifv3vO8UlAup0gPmKh 8PlqdW6+ci8M6xyfvDBwdU/62u6Zpu4OBw== X-Google-Smtp-Source: AA6agR6pDbgSnraus/uNdCfkCB7Ickm160jZpDECpWK1AqpFig6wZL3chXhMUp71sgV4mx7EuAeo3g== X-Received: by 2002:a62:1c56:0:b0:536:4f4b:d99e with SMTP id c83-20020a621c56000000b005364f4bd99emr118526pfc.64.1661359862649; Wed, 24 Aug 2022 09:51:02 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id a68-20020a621a47000000b005366280c39fsm8960349pfa.140.2022.08.24.09.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 09:51:02 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, mohamed@pensando.io, Shannon Nelson Subject: [PATCH net 3/3] ionic: VF initial random MAC address if no assigned mac Date: Wed, 24 Aug 2022 09:50:51 -0700 Message-Id: <20220824165051.6185-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220824165051.6185-1-snelson@pensando.io> References: <20220824165051.6185-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: R Mohamed Shah Assign a random mac address to the VF interface station address if it boots with a zero mac address in order to match similar behavior seen in other VF drivers. Handle the errors where the older firmware does not allow the VF to set its own station address. Newer firmware will allow the VF to set the station mac address if it hasn't already been set administratively through the PF. Setting it will also be allowed if the VF has trust. Fixes: fbb39807e9ae ("ionic: support sr-iov operations") Signed-off-by: R Mohamed Shah Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 92 ++++++++++++++++++- 1 file changed, 87 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index d4226999547e..0be79c516781 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1564,8 +1564,67 @@ static int ionic_set_features(struct net_device *netdev, return err; } +static int ionic_set_attr_mac(struct ionic_lif *lif, u8 *mac) +{ + struct ionic_admin_ctx ctx = { + .work = COMPLETION_INITIALIZER_ONSTACK(ctx.work), + .cmd.lif_setattr = { + .opcode = IONIC_CMD_LIF_SETATTR, + .index = cpu_to_le16(lif->index), + .attr = IONIC_LIF_ATTR_MAC, + }, + }; + + ether_addr_copy(ctx.cmd.lif_setattr.mac, mac); + return ionic_adminq_post_wait(lif, &ctx); +} + +static int ionic_get_attr_mac(struct ionic_lif *lif, u8 *mac_addr) +{ + struct ionic_admin_ctx ctx = { + .work = COMPLETION_INITIALIZER_ONSTACK(ctx.work), + .cmd.lif_getattr = { + .opcode = IONIC_CMD_LIF_GETATTR, + .index = cpu_to_le16(lif->index), + .attr = IONIC_LIF_ATTR_MAC, + }, + }; + int err; + + err = ionic_adminq_post_wait(lif, &ctx); + if (err) + return err; + + ether_addr_copy(mac_addr, ctx.comp.lif_getattr.mac); + return 0; +} + +static int ionic_program_mac(struct ionic_lif *lif, u8 *mac) +{ + u8 get_mac[ETH_ALEN]; + int err; + + err = ionic_set_attr_mac(lif, mac); + if (err) + return err; + + err = ionic_get_attr_mac(lif, get_mac); + if (err) + return err; + + /* To deal with older firmware that silently ignores the set attr mac: + * doesn't actually change the mac and doesn't return an error, so we + * do the get attr to verify whether or not the set actually happened + */ + if (!ether_addr_equal(get_mac, mac)) + return 1; + + return 0; +} + static int ionic_set_mac_address(struct net_device *netdev, void *sa) { + struct ionic_lif *lif = netdev_priv(netdev); struct sockaddr *addr = sa; u8 *mac; int err; @@ -1574,6 +1633,14 @@ static int ionic_set_mac_address(struct net_device *netdev, void *sa) if (ether_addr_equal(netdev->dev_addr, mac)) return 0; + err = ionic_program_mac(lif, mac); + if (err < 0) + return err; + + if (err > 0) + netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n", + __func__); + err = eth_prepare_mac_addr_change(netdev, addr); if (err) return err; @@ -3172,6 +3239,7 @@ static int ionic_station_set(struct ionic_lif *lif) .attr = IONIC_LIF_ATTR_MAC, }, }; + u8 mac_address[ETH_ALEN]; struct sockaddr addr; int err; @@ -3180,8 +3248,23 @@ static int ionic_station_set(struct ionic_lif *lif) return err; netdev_dbg(lif->netdev, "found initial MAC addr %pM\n", ctx.comp.lif_getattr.mac); - if (is_zero_ether_addr(ctx.comp.lif_getattr.mac)) - return 0; + ether_addr_copy(mac_address, ctx.comp.lif_getattr.mac); + + if (is_zero_ether_addr(mac_address)) { + eth_hw_addr_random(netdev); + netdev_dbg(netdev, "Random Mac generated: %pM\n", netdev->dev_addr); + ether_addr_copy(mac_address, netdev->dev_addr); + + err = ionic_program_mac(lif, mac_address); + if (err < 0) + return err; + + if (err > 0) { + netdev_dbg(netdev, "%s:SET/GET ATTR Mac are not same-due to old FW running\n", + __func__); + return 0; + } + } if (!is_zero_ether_addr(netdev->dev_addr)) { /* If the netdev mac is non-zero and doesn't match the default @@ -3189,12 +3272,11 @@ static int ionic_station_set(struct ionic_lif *lif) * likely here again after a fw-upgrade reset. We need to be * sure the netdev mac is in our filter list. */ - if (!ether_addr_equal(ctx.comp.lif_getattr.mac, - netdev->dev_addr)) + if (!ether_addr_equal(mac_address, netdev->dev_addr)) ionic_lif_addr_add(lif, netdev->dev_addr); } else { /* Update the netdev mac with the device's mac */ - memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len); + ether_addr_copy(addr.sa_data, mac_address); addr.sa_family = AF_INET; err = eth_prepare_mac_addr_change(netdev, &addr); if (err) {