From patchwork Mon May 11 21:04:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1288064 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=jjDTZlI9; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49LYNY6hS7z9sRf for ; Tue, 12 May 2020 07:05:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732372AbgEKVE7 (ORCPT ); Mon, 11 May 2020 17:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731815AbgEKVE5 (ORCPT ); Mon, 11 May 2020 17:04:57 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8BFDC061A0C for ; Mon, 11 May 2020 14:04:56 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id u10so4438450pls.8 for ; Mon, 11 May 2020 14:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LIx/pfKAPWPAXNT2F7f8FkFt9UnSm350N911MwRS/vU=; b=jjDTZlI9PEd7TZI/458OV+V3+oDrkZl1jsQHmKhpFCGCYyxBylygteqaqa+ZZKoJb+ /0H1Nn0KZjW4Bz4W+LiGbchJzGWpimw6XEmvdI0/QTH8w3mCpCWAuDu/EGxlEvBuojXa uK2WnHidq9U+KDOsNa+F+FS6uY/e6LstHQMdccMTY0wnUj3N30U1lNl819HGqfsX87F5 L2D/0C/3ly2mJWrsNxycCtoiSte5bu73DwNW2dd7cyjWWc7j7R8uOrP4dqPBYSocAzSF oRNbkr7UqPgMAupRncyiSS2VgIIOEZjHXn2Wo2pI69wX0IiWDik/HJe5n47rnuF/ckjG WwDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LIx/pfKAPWPAXNT2F7f8FkFt9UnSm350N911MwRS/vU=; b=cCBSi8PKEDBWkTVbySwo5qgBTd1xiTrnr1BXovnGk5HK4O6XNvxDmNZzukxXXwvrZI u6zqgmIR2h3JZ+RGavumhSLrVJH0BITvVwF1fBsvMDRoewcjF8G+Mlmb2F0FBaIIVQnr xvn7ryGhWvCpLBXvHLkHQX6eQADt3pM2srZBmsOFzVE8dFIhYfwkkfh9Gh6IiPuuaQ6H KOUAAqVKAE9PbA2ltzS2PPIGXPNITVESnA+I8DfRyXEJKw35VV1NQpzOUHOY4rlVLrqy nDchYAPRMQjYlUgiNxFDzu2TgoTZFzWuKcTyCtkhPY0beOvl7Zz36XbunQpG7P1JcTRv 2nIw== X-Gm-Message-State: AGi0Publux7mTpkawkGXrb5ddG4EsP6Y8lcG8nJnuqmN1ERy6gN+2N2y 5H3C5Fu111MitYhvfpbskJoNE3w+n1Y= X-Google-Smtp-Source: APiQypLTFs9d9ssNzISu5XMcTOu32ZXNy2K3ruagZ9RJCrvsnWgn8OZRCqrSKmyA+E8avyf8Ezxw9Q== X-Received: by 2002:a17:90a:276a:: with SMTP id o97mr24534458pje.194.1589231093348; Mon, 11 May 2020 14:04:53 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id c2sm6325048pgj.93.2020.05.11.14.04.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 14:04:52 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net 1/2] ionic: leave netdev mac alone after fw-upgrade Date: Mon, 11 May 2020 14:04:44 -0700 Message-Id: <20200511210445.2144-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200511210445.2144-1-snelson@pensando.io> References: <20200511210445.2144-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When running in a bond setup, or some other potential configurations, the netdev mac may have been changed from the default device mac. Since the userland doesn't know about the changes going on under the covers in a fw-upgrade it doesn't know the re-push the mac filter. The driver needs to leave the netdev mac filter alone when rebuilding after the fw-upgrade. Fixes: c672412f6172 ("ionic: remove lifs on fw reset") Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index d5293bfded29..f8c626444da0 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2348,7 +2348,17 @@ static int ionic_station_set(struct ionic_lif *lif) if (is_zero_ether_addr(ctx.comp.lif_getattr.mac)) return 0; - if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) { + if (!is_zero_ether_addr(netdev->dev_addr)) { + /* If the netdev mac is non-zero and doesn't match the default + * device address, it was set by something earlier and we're + * 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)) + ionic_lif_addr(lif, netdev->dev_addr, true); + } else { + /* Update the netdev mac with the device's mac */ memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len); addr.sa_family = AF_INET; err = eth_prepare_mac_addr_change(netdev, &addr); @@ -2358,12 +2368,6 @@ static int ionic_station_set(struct ionic_lif *lif) return 0; } - if (!is_zero_ether_addr(netdev->dev_addr)) { - netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n", - netdev->dev_addr); - ionic_lif_addr(lif, netdev->dev_addr, false); - } - eth_commit_mac_addr_change(netdev, &addr); } From patchwork Mon May 11 21:04:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1288063 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=qtMS0IAs; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49LYNX6cZwz9sRK for ; Tue, 12 May 2020 07:05:00 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732552AbgEKVFA (ORCPT ); Mon, 11 May 2020 17:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731855AbgEKVE6 (ORCPT ); Mon, 11 May 2020 17:04:58 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6059C061A0E for ; Mon, 11 May 2020 14:04:57 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id k19so4434176pll.9 for ; Mon, 11 May 2020 14:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2rj7fFH6ZI7q1RrlMYmdHqpqWBjXcLGhutBTftaqZG4=; b=qtMS0IAswtcXmbvi/v4F5y17nSEkAbzSSdA2bFIsLebBA33zG1X63k18I80XKi9Vsc Z8KpKnvO95hBd9Np0n9Muaf0f6z8pD2red4l8md5rgncHGxEuw8D1spMC3HhST4W23CQ GOoUjtPezc7v/OgL35Faqo46FbR41b7Gj6G3QDaUmakV7jIOWAe3vuVDVbW1/xsjg6y2 gIBsYIjgS3mPbeIFbjQr0lP+3TqDA4oNu0V2J/oMPelBDrP1iuL8Kv4KAXbJ77HzDqLW JwgE0AIUTdqu6ftaLxDehm8XIuI7s0uxYS2Nirev/yNK+V1nY2ToZZzxD+A2xQ9msYuE /z1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2rj7fFH6ZI7q1RrlMYmdHqpqWBjXcLGhutBTftaqZG4=; b=aD3TjwgZJjMjUVOVYSAdSXzx6QNBY9LrOb8p6jbBNbnXtPBc215WNjr+CwWsSeY0CG ZV/E/Y3aaX56rasxruuAVk5P2iSOzjs1bSaaKRuNVvOLAH40VZtF9+C6XM2mm+MooY+R YpwnMWHATbw800OKufU3gZT6/7ITIf7vqtU4afRx4x5GkD7di5JcoL1wm87PUOyzoSjc HSmClfm/5/q9VjIYMIAWWJCIyOx/MvKg4np5zfGiiWUzWlt8lYZjbbisxvYzYl/yCEuB 5NwaxvgsuFjuSfu/X1FizgSpQdZqFFIKtOULbuNvpRZp5IiBk3clJX2ZZpIfHg0NZf17 3pLg== X-Gm-Message-State: AGi0Pubq4D9NzV+NX/xXmnZs2GJ24Zx3bz3qvkeDTgd51uJUHdl3CELD vscD+gQxteNsqTm4ziLW9IB1n6cbv/w= X-Google-Smtp-Source: APiQypL94I/ZwOepsRwhdzLXWBaavVdMSdwsRvAj9cfFi+S5U9onqv/w/vzDc6v++y5REoswH5xo2Q== X-Received: by 2002:a17:902:b685:: with SMTP id c5mr17810431pls.154.1589231097101; Mon, 11 May 2020 14:04:57 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id c2sm6325048pgj.93.2020.05.11.14.04.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 14:04:56 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH net 2/2] ionic: call ionic_port_init after fw-upgrade Date: Mon, 11 May 2020 14:04:45 -0700 Message-Id: <20200511210445.2144-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200511210445.2144-1-snelson@pensando.io> References: <20200511210445.2144-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since the fw has been re-inited, we need to refresh the port information dma address so we can see fresh port information. Let's call ionic_port_init again, and tweak it to allow for a call to simply refresh the existing dma address. Fixes: c672412f6172 ("ionic: remove lifs on fw reset") Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 1 + .../net/ethernet/pensando/ionic/ionic_main.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index f8c626444da0..f8a9c1bcffc9 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2118,6 +2118,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) dev_info(ionic->dev, "FW Up: restarting LIFs\n"); ionic_init_devinfo(ionic); + ionic_port_init(ionic); err = ionic_qcqs_alloc(lif); if (err) goto err_out; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 588c62e9add7..3344bc1f7671 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -509,16 +509,16 @@ int ionic_port_init(struct ionic *ionic) size_t sz; int err; - if (idev->port_info) - return 0; - - idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE); - idev->port_info = dma_alloc_coherent(ionic->dev, idev->port_info_sz, - &idev->port_info_pa, - GFP_KERNEL); if (!idev->port_info) { - dev_err(ionic->dev, "Failed to allocate port info, aborting\n"); - return -ENOMEM; + idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE); + idev->port_info = dma_alloc_coherent(ionic->dev, + idev->port_info_sz, + &idev->port_info_pa, + GFP_KERNEL); + if (!idev->port_info) { + dev_err(ionic->dev, "Failed to allocate port info\n"); + return -ENOMEM; + } } sz = min(sizeof(ident->port.config), sizeof(idev->dev_cmd_regs->data));