netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lijun Pan <ljp@linux.ibm.com>
To: netdev@vger.kernel.org
Cc: Lijun Pan <ljp@linux.ibm.com>,
	Brian King <brking@linux.vnet.ibm.com>,
	Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>,
	Dany Madden <drt@linux.ibm.com>
Subject: [PATCH net 1/2] ibmvnic: notify peers when failover and migration happen
Date: Wed, 28 Oct 2020 00:57:41 -0500	[thread overview]
Message-ID: <20201028055742.74941-2-ljp@linux.ibm.com> (raw)
In-Reply-To: <20201028055742.74941-1-ljp@linux.ibm.com>

We need to notify peers only when failover and migration happen.
It is unnecessary to call that in other events like
FATAL, NON_FATAL, CHANGE_PARAM, and TIMEOUT resets
since in those scenarios the MAC address and ip address mapping
does not change. Originally all the resets except CHANGE_PARAM
are processed by do_reset such that we need to find out
failover and migration cases in do_reset and call notifier functions.
We only need to notify peers in do_reset and do_hard_reset.
We don't need notify peers in do_change_param_reset since it is
a CHANGE_PARAM reset. In a nested reset case, it will finally
call into do_hard_reset with reasons other than failvoer and
migration. So, we don't need to check the reset reason in
do_hard_reset and just call notifier functions anyway.

netdev_notify_peers calls below two functions with rtnl lock().
	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
	call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev);
When netdev_notify_peers was substituted in
commit 986103e7920c ("net/ibmvnic: Fix RTNL deadlock during device reset"),
call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev) was missed.

Fixes: 61d3e1d9bc2a ("ibmvnic: Remove netdev notify for failover resets")
Fixes: 986103e7920c ("net/ibmvnic: Fix RTNL deadlock during device
reset")
Suggested-by: Brian King <brking@linux.vnet.ibm.com>
Suggested-by: Pradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
Signed-off-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 1b702a43a5d0..718da39f5ae4 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2067,8 +2067,11 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 	for (i = 0; i < adapter->req_rx_queues; i++)
 		napi_schedule(&adapter->napi[i]);
 
-	if (adapter->reset_reason != VNIC_RESET_FAILOVER)
+	if (adapter->reset_reason == VNIC_RESET_FAILOVER ||
+	    adapter->reset_reason == VNIC_RESET_MOBILITY) {
 		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
+		call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
+	}
 
 	rc = 0;
 
@@ -2138,6 +2141,9 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter,
 	if (rc)
 		return IBMVNIC_OPEN_FAILED;
 
+	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
+	call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev);
+
 	return 0;
 }
 
-- 
2.23.0


  reply	other threads:[~2020-10-28 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  5:57 [PATCH net 0/2] ibmvnic: fixes in reset path Lijun Pan
2020-10-28  5:57 ` Lijun Pan [this message]
2020-10-30 20:27   ` [PATCH net 1/2] ibmvnic: notify peers when failover and migration happen Jakub Kicinski
2020-11-05  4:54     ` drt
2020-10-28  5:57 ` [PATCH net 2/2] ibmvnic: skip tx timeout reset while in resetting Lijun Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201028055742.74941-2-ljp@linux.ibm.com \
    --to=ljp@linux.ibm.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=drt@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pradeeps@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).