All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] ionic fixes
@ 2020-05-11 21:04 Shannon Nelson
  2020-05-11 21:04 ` [PATCH net 1/2] ionic: leave netdev mac alone after fw-upgrade Shannon Nelson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shannon Nelson @ 2020-05-11 21:04 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

These are a couple more fixes after more fw-upgrade testing.

Shannon Nelson (2):
  ionic: leave netdev mac alone after fw-upgrade
  ionic: call ionic_port_init after fw-upgrade

 .../net/ethernet/pensando/ionic/ionic_lif.c   | 19 ++++++++++++-------
 .../net/ethernet/pensando/ionic/ionic_main.c  | 18 +++++++++---------
 2 files changed, 21 insertions(+), 16 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] ionic: leave netdev mac alone after fw-upgrade
  2020-05-11 21:04 [PATCH net 0/2] ionic fixes Shannon Nelson
@ 2020-05-11 21:04 ` Shannon Nelson
  2020-05-11 21:04 ` [PATCH net 2/2] ionic: call ionic_port_init " Shannon Nelson
  2020-05-12 19:13 ` [PATCH net 0/2] ionic fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Nelson @ 2020-05-11 21:04 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

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 <snelson@pensando.io>
---
 .../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);
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] ionic: call ionic_port_init after fw-upgrade
  2020-05-11 21:04 [PATCH net 0/2] ionic fixes Shannon Nelson
  2020-05-11 21:04 ` [PATCH net 1/2] ionic: leave netdev mac alone after fw-upgrade Shannon Nelson
@ 2020-05-11 21:04 ` Shannon Nelson
  2020-05-12 19:13 ` [PATCH net 0/2] ionic fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Nelson @ 2020-05-11 21:04 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

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 <snelson@pensando.io>
---
 .../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));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] ionic fixes
  2020-05-11 21:04 [PATCH net 0/2] ionic fixes Shannon Nelson
  2020-05-11 21:04 ` [PATCH net 1/2] ionic: leave netdev mac alone after fw-upgrade Shannon Nelson
  2020-05-11 21:04 ` [PATCH net 2/2] ionic: call ionic_port_init " Shannon Nelson
@ 2020-05-12 19:13 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-12 19:13 UTC (permalink / raw)
  To: snelson; +Cc: netdev

From: Shannon Nelson <snelson@pensando.io>
Date: Mon, 11 May 2020 14:04:43 -0700

> These are a couple more fixes after more fw-upgrade testing.

Series applied, thanks Shannon.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-12 19:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 21:04 [PATCH net 0/2] ionic fixes Shannon Nelson
2020-05-11 21:04 ` [PATCH net 1/2] ionic: leave netdev mac alone after fw-upgrade Shannon Nelson
2020-05-11 21:04 ` [PATCH net 2/2] ionic: call ionic_port_init " Shannon Nelson
2020-05-12 19:13 ` [PATCH net 0/2] ionic fixes David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.