Thread (44 messages) 44 messages, 7 authors, 2021-02-07

Re: [PATCH v3 net-next 09/21] nvme-tcp: Deal with netdevice DOWN events

From: Or Gerlitz <hidden>
Date: 2021-02-04 18:30:09
Also in: linux-nvme

On Wed, Feb 3, 2021 at 11:17 AM Sagi Grimberg [off-list ref] wrote:
quoted
@@ -2930,6 +2931,27 @@ static struct nvme_ctrl *nvme_tcp_create_ctrl(struct device *dev,
      return ERR_PTR(ret);
  }

+static int nvme_tcp_netdev_event(struct notifier_block *this,
+                              unsigned long event, void *ptr)
+{
+     struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
+     struct nvme_tcp_ctrl *ctrl;
+
+     switch (event) {
+     case NETDEV_GOING_DOWN:
+             mutex_lock(&nvme_tcp_ctrl_mutex);
+             list_for_each_entry(ctrl, &nvme_tcp_ctrl_list, list) {
+                     if (ndev != ctrl->offloading_netdev)
+                             continue;
+                     nvme_tcp_error_recovery(&ctrl->ctrl);
+             }
+             mutex_unlock(&nvme_tcp_ctrl_mutex);
+             flush_workqueue(nvme_reset_wq);
+             /* we assume that the going down part of error recovery is over */
Maybe phrase it as:
/*
  * The associated controllers teardown has completed, ddp contexts
  * were also torn down so we should be safe to continue...
  */
sure
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help