All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: openbmc@lists.ozlabs.org
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: [PATCH 7/8] net/farady: Keep MAC always active for NCSI packets
Date: Mon,  9 May 2016 11:47:18 +1000	[thread overview]
Message-ID: <1462758439-27910-8-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1462758439-27910-1-git-send-email-gwshan@linux.vnet.ibm.com>

The status of MAC and NCSI interface are sychronized. When NCSI
interface is down, the MAC is brought down. It means the NCSI
packets (especially AEN packets) cannot be received by the MAC's
driver even they're transmitted by far end. It causes one issue:
the ethernet cable is unplugged initially and system boots up
with down NCSI interface. The MAC stops receiving any ingress
traffic including NCSI packets. At later point, one NCSI (AEN)
packet is sent from far end when the ethernet cable is plugged.
We're going to miss the AEN on local end and the interface has
to be down for ever.

This keeps the receive/transmit buffer, IRQ and NAPI are always
enabled so that we won't miss any NCSI packets even the interrupt
is currently in link down state.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 drivers/net/ethernet/faraday/ftgmac100.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 87ddc97..7eae197 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1320,18 +1320,9 @@ static const struct net_device_ops ftgmac100_netdev_ops = {
 
 static void ftgmac100_ncsi_handler(struct ncsi_dev *nd)
 {
-	struct net_device *netdev = nd->nd_dev;
-
-	if (nd->nd_state != ncsi_dev_state_functional)
-		return;
-
-	if (nd->nd_link_up) {
-		pr_info("NCSI dev is up\n");
-		netif_start_queue(netdev);
-	} else {
-		pr_info("NCSI dev is down\n");
-		ftgmac100_stop_dev(netdev);
-	}
+	if (nd->nd_state == ncsi_dev_state_functional)
+		pr_info("NCSI interface %s\n",
+			nd->nd_link_up ? "up" : "down");
 }
 /******************************************************************************
  * struct platform_driver functions
-- 
2.1.0

  parent reply	other threads:[~2016-05-09  1:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09  1:47 [PATCH 0/8] NSCI Improvement Gavin Shan
2016-05-09  1:47 ` [PATCH 1/8] net/ncsi: Remove netlink support Gavin Shan
2016-05-09  1:47 ` [PATCH 2/8] net/ncsi: Add NCSI_DEV_PRIV_FLAG_POPULATED Gavin Shan
2016-05-09  1:47 ` [PATCH 3/8] net/ncsi: Enumerate NCSI channels in advance Gavin Shan
2016-05-09  1:47 ` [PATCH 4/8] net/ncsi: Remove ncsi_stop_dev() Gavin Shan
2016-05-09  1:47 ` [PATCH 5/8] net/ncsi: Enable AEN on active channel Gavin Shan
2016-05-09  1:47 ` [PATCH 6/8] net/ncsi: Improvement for ncsi_dev_suspend() Gavin Shan
2016-05-09  1:47 ` Gavin Shan [this message]
2016-05-09  1:47 ` [PATCH 8/8] net/ncsi: LSC AEN handler improvement Gavin Shan
2016-05-11  5:43 ` [PATCH 0/8] NSCI Improvement Joel Stanley
2016-05-12  6:34   ` Gavin Shan
2016-05-12  7:02     ` Joel Stanley
2016-05-12  7:12       ` Gavin Shan
2016-05-20  6:56       ` Gavin Shan

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=1462758439-27910-8-git-send-email-gwshan@linux.vnet.ibm.com \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=openbmc@lists.ozlabs.org \
    /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 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.