From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:23
The first pair of patches help smooth the driver's response when
the firmware has gone through a recovery/reboot cycle.
The next four patches take care of a couple things seen when
changing the interface status.
Shannon Nelson (6):
ionic: fire watchdog again after fw_down
ionic: squelch unnecessary fw halted message
ionic: fill mac addr earlier in add_addr
ionic: add queue lock around open and stop
ionic: pull hwstamp queue_lock up a level
ionic: recreate hwstamp queues on ifup
.../net/ethernet/pensando/ionic/ionic_lif.c | 45 +++++++++++--------
.../net/ethernet/pensando/ionic/ionic_lif.h | 2 +
.../net/ethernet/pensando/ionic/ionic_main.c | 4 +-
.../net/ethernet/pensando/ionic/ionic_phc.c | 28 ++++++++++++
4 files changed, 59 insertions(+), 20 deletions(-)
--
2.17.1
From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:25
In some cases of fw_down it was called because there was a
fw_generation change, and the firmware is already back up.
In order to keep the down time to a minimum, don't wait for
the next watchdog polling cycle, fire another watchdog off
as soon as we can - an out-of-cycle check won't hurt, and
may well speed up the recovery.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
@@ -93,10 +93,17 @@ static void ionic_lif_deferred_work(struct work_struct *work)ionic_link_status_check(lif);break;caseIONIC_DW_TYPE_LIF_RESET:-if(w->fw_status)+if(w->fw_status){ionic_lif_handle_fw_up(lif);-else+}else{ionic_lif_handle_fw_down(lif);++/* Fire off another watchdog to see+*iftheFWisalreadybackratherthan+*waitinganotherwholecycle+*/+mod_timer(&lif->ionic->watchdog_timer,jiffies+1);+}break;default:break;
From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:29
Since the heartbeat check will already have complained about
the firmware status, don't bother complaining about the
DEVCMD failing. We'll keep the print message but demote it
to a debug messages so that we normally no longer see it.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:32
Make sure the ctx struct has the new mac address before
any save operations happen.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -1281,7 +1283,6 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr)f->state=IONIC_FILTER_STATE_SYNCED;}else{/* save as SYNCED to catch any DEL requests while processing */-memcpy(ctx.cmd.rx_filter_add.mac.addr,addr,ETH_ALEN);err=ionic_rx_filter_save(lif,0,IONIC_RXQ_INDEX_ANY,0,&ctx,IONIC_FILTER_STATE_SYNCED);}
From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:37
Add the queue configuration lock to ionic_open() and
ionic_stop() so that they don't collide with other in parallel
queue configuration actions such as MTU changes as can be
demonstrated with a tight loop of ifup/change-mtu/ifdown.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:38
Move the hwstamp configuration use of queue_lock up
a level to simplify use and error handling.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 16 ++--------------
drivers/net/ethernet/pensando/ionic/ionic_phc.c | 4 ++++
2 files changed, 6 insertions(+), 14 deletions(-)
From: Shannon Nelson <hidden> Date: 2021-08-27 18:55:39
The queues can be freed in ionic_close(). They need to be recreated
after ionic_open(). It doesn't need to replay the whole config. It
only needs to create the timestamping queues again.
Signed-off-by: Allen Hubbe <redacted>
Signed-off-by: Shannon Nelson <redacted>
---
.../net/ethernet/pensando/ionic/ionic_lif.c | 6 +++++
.../net/ethernet/pensando/ionic/ionic_lif.h | 2 ++
.../net/ethernet/pensando/ionic/ionic_phc.c | 24 +++++++++++++++++++
3 files changed, 32 insertions(+)
@@ -2246,7 +2246,13 @@ static int ionic_open(struct net_device *netdev)gotoerr_txrx_deinit;}+/* If hardware timestamping is enabled, but the queues were freed by+*ionic_stop,thoseneedtobereallocatedandinitialized,too.+*/+ionic_lif_hwstamp_recreate_queues(lif);+mutex_unlock(&lif->queue_lock);+return0;err_txrx_deinit:
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-08-28 00:39:09
On Fri, 27 Aug 2021 11:55:10 -0700 Shannon Nelson wrote:
Add the queue configuration lock to ionic_open() and
ionic_stop() so that they don't collide with other in parallel
queue configuration actions such as MTU changes as can be
demonstrated with a tight loop of ifup/change-mtu/ifdown.
Say more? how are up/down/change mtu not under rtnl_lock?
From: Shannon Nelson <hidden> Date: 2021-08-28 05:17:31
On 8/27/21 5:39 PM, Jakub Kicinski wrote:
On Fri, 27 Aug 2021 11:55:10 -0700 Shannon Nelson wrote:
quoted
Add the queue configuration lock to ionic_open() and
ionic_stop() so that they don't collide with other in parallel
queue configuration actions such as MTU changes as can be
demonstrated with a tight loop of ifup/change-mtu/ifdown.
Say more? how are up/down/change mtu not under rtnl_lock?
Sorry, that commit message didn't get updated as it should have. The MTU
change played with the timing of actions just right, but wasn't the
culprit. The actual issue was that the watchdog and the ionic_stop
collided: ionic_stop had started taking the queues down but without
grabbing the mutex, and the watchdog timer went off and ran the
link_check which grabbed the mutex and tried to bring them back up
again. This didn't break anything in the driver, but confused the NIC
firmware and left the interface non-operational. This was cleared with
another ifdown/ifup cycle.
I can repost with a better commit description.
sln
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Fri, 27 Aug 2021 11:55:06 -0700 you wrote:
The first pair of patches help smooth the driver's response when
the firmware has gone through a recovery/reboot cycle.
The next four patches take care of a couple things seen when
changing the interface status.
Shannon Nelson (6):
ionic: fire watchdog again after fw_down
ionic: squelch unnecessary fw halted message
ionic: fill mac addr earlier in add_addr
ionic: add queue lock around open and stop
ionic: pull hwstamp queue_lock up a level
ionic: recreate hwstamp queues on ifup
[...]