All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Backport upstream NCSI fixes
@ 2017-10-23  5:45 Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 1/7] Revert "net/ncsi: Don't assume last available channel exists" Samuel Mendoza-Jonas
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

This backports a few useful NCSI fixes which are upstream, as well as replacing
"net/ncsi: Don't assume last available channel exists" with the actual upstream
version.

Gavin Shan (3):
  net/ncsi: Disable HWA mode when no channels are found
  net/ncsi: Enforce failover on link monitor timeout
  net/ncsi: Fix length of GVI response packet

Samuel Mendoza-Jonas (4):
  Revert "net/ncsi: Don't assume last available channel exists"
  net/ncsi: Don't limit vids based on hot_channel
  net/ncsi: Fix AEN HNCDSC packet length
  net/ncsi: Stop monitor if channel times out or is inactive

 net/ncsi/internal.h    |  1 +
 net/ncsi/ncsi-aen.c    |  2 +-
 net/ncsi/ncsi-manage.c | 59 +++++++++++++++++++++++++++-----------------------
 net/ncsi/ncsi-rsp.c    |  2 +-
 4 files changed, 35 insertions(+), 29 deletions(-)

-- 
2.14.2

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

* [PATCH 1/7] Revert "net/ncsi: Don't assume last available channel exists"
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 2/7] net/ncsi: Don't limit vids based on hot_channel Samuel Mendoza-Jonas
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

This reverts commit 7fd4e7d3b4fc52cdb965e2bbd9bbb3d57cb803fc.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
 net/ncsi/ncsi-manage.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index 75a97d48da8a..3cbd4328f142 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -1407,10 +1407,7 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
 	}
 
 	ndp = TO_NCSI_DEV_PRIV(nd);
-	if (!ndp) {
-		netdev_warn(dev, "ncsi: No ncsi_dev_priv?\n");
-		return 0;
-	}
+	ncf = ndp->hot_channel->filters[NCSI_FILTER_VLAN];
 
 	/* Add the VLAN id to our internal list */
 	list_for_each_entry_rcu(vlan, &ndp->vlan_vids, list) {
@@ -1422,17 +1419,11 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
 		}
 	}
 
-	if (!ndp->hot_channel) {
-		netdev_warn(dev,
-			    "ncsi: no available filter to check maximum\n");
-	} else {
-		ncf = ndp->hot_channel->filters[NCSI_FILTER_VLAN];
-		if (n_vids >= ncf->total) {
-			netdev_info(dev,
-				    "NCSI Channel supports up to %u VLAN tags but %u are already set\n",
-				    ncf->total, n_vids);
-			return -EINVAL;
-		}
+	if (n_vids >= ncf->total) {
+		netdev_info(dev,
+			    "NCSI Channel supports up to %u VLAN tags but %u are already set\n",
+			    ncf->total, n_vids);
+		return -EINVAL;
 	}
 
 	vlan = kzalloc(sizeof(*vlan), GFP_KERNEL);
-- 
2.14.2

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

* [PATCH 2/7] net/ncsi: Don't limit vids based on hot_channel
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 1/7] Revert "net/ncsi: Don't assume last available channel exists" Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 3/7] net/ncsi: Fix AEN HNCDSC packet length Samuel Mendoza-Jonas
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

Currently we drop any new VLAN ids if there are more than the current
(or last used) channel can support. Most importantly this is a problem
if no channel has been selected yet, resulting in a segfault.

Secondly this does not necessarily reflect the capabilities of any other
channels. Instead only drop a new VLAN id if we are already tracking the
maximum allowed by the NCSI specification. Per-channel limits are
already handled by ncsi_add_filter(), but add a message to set_one_vid()
to make it obvious that the channel can not support any more VLAN ids.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6e9c0075409d4ec1bc63558ee5a93916a6d7d16f)
---
 net/ncsi/internal.h    |  1 +
 net/ncsi/ncsi-manage.c | 17 +++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h
index af3d636534ef..d30f7bd741d0 100644
--- a/net/ncsi/internal.h
+++ b/net/ncsi/internal.h
@@ -286,6 +286,7 @@ struct ncsi_dev_priv {
 	struct work_struct  work;            /* For channel management     */
 	struct packet_type  ptype;           /* NCSI packet Rx handler     */
 	struct list_head    node;            /* Form NCSI device list      */
+#define NCSI_MAX_VLAN_VIDS	15
 	struct list_head    vlan_vids;       /* List of active VLAN IDs */
 };
 
diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index 3cbd4328f142..24bf3f100d48 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -717,6 +717,10 @@ static int set_one_vid(struct ncsi_dev_priv *ndp, struct ncsi_channel *nc,
 	if (index < 0) {
 		netdev_err(ndp->ndev.dev,
 			   "Failed to add new VLAN tag, error %d\n", index);
+		if (index == -ENOSPC)
+			netdev_err(ndp->ndev.dev,
+				   "Channel %u already has all VLAN filters set\n",
+				   nc->id);
 		return -1;
 	}
 
@@ -1390,7 +1394,6 @@ static int ncsi_kick_channels(struct ncsi_dev_priv *ndp)
 
 int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
 {
-	struct ncsi_channel_filter *ncf;
 	struct ncsi_dev_priv *ndp;
 	unsigned int n_vids = 0;
 	struct vlan_vid *vlan;
@@ -1407,7 +1410,6 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
 	}
 
 	ndp = TO_NCSI_DEV_PRIV(nd);
-	ncf = ndp->hot_channel->filters[NCSI_FILTER_VLAN];
 
 	/* Add the VLAN id to our internal list */
 	list_for_each_entry_rcu(vlan, &ndp->vlan_vids, list) {
@@ -1418,12 +1420,11 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
 			return 0;
 		}
 	}
-
-	if (n_vids >= ncf->total) {
-		netdev_info(dev,
-			    "NCSI Channel supports up to %u VLAN tags but %u are already set\n",
-			    ncf->total, n_vids);
-		return -EINVAL;
+	if (n_vids >= NCSI_MAX_VLAN_VIDS) {
+		netdev_warn(dev,
+			    "tried to add vlan id %u but NCSI max already registered (%u)\n",
+			    vid, NCSI_MAX_VLAN_VIDS);
+		return -ENOSPC;
 	}
 
 	vlan = kzalloc(sizeof(*vlan), GFP_KERNEL);
-- 
2.14.2

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

* [PATCH 3/7] net/ncsi: Fix AEN HNCDSC packet length
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 1/7] Revert "net/ncsi: Don't assume last available channel exists" Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 2/7] net/ncsi: Don't limit vids based on hot_channel Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 4/7] net/ncsi: Stop monitor if channel times out or is inactive Samuel Mendoza-Jonas
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

Correct the value of the HNCDSC AEN packet.
Fixes: 7a82ecf4cfb85 "net/ncsi: NCSI AEN packet handler"

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6850d0f8b2542112629061808ed950b35eb982e4)
---
 net/ncsi/ncsi-aen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ncsi/ncsi-aen.c b/net/ncsi/ncsi-aen.c
index 6898e7229285..f135938bf781 100644
--- a/net/ncsi/ncsi-aen.c
+++ b/net/ncsi/ncsi-aen.c
@@ -187,7 +187,7 @@ static struct ncsi_aen_handler {
 } ncsi_aen_handlers[] = {
 	{ NCSI_PKT_AEN_LSC,    12, ncsi_aen_handler_lsc    },
 	{ NCSI_PKT_AEN_CR,      4, ncsi_aen_handler_cr     },
-	{ NCSI_PKT_AEN_HNCDSC,  4, ncsi_aen_handler_hncdsc }
+	{ NCSI_PKT_AEN_HNCDSC,  8, ncsi_aen_handler_hncdsc }
 };
 
 int ncsi_aen_handler(struct ncsi_dev_priv *ndp, struct sk_buff *skb)
-- 
2.14.2

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

* [PATCH 4/7] net/ncsi: Stop monitor if channel times out or is inactive
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
                   ` (2 preceding siblings ...)
  2017-10-23  5:45 ` [PATCH 3/7] net/ncsi: Fix AEN HNCDSC packet length Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 5/7] net/ncsi: Disable HWA mode when no channels are found Samuel Mendoza-Jonas
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

ncsi_channel_monitor() misses stopping the channel monitor in several
places that it should, causing a WARN_ON_ONCE() to trigger when the
monitor is re-started later, eg:

[  459.040000] WARNING: CPU: 0 PID: 1093 at net/ncsi/ncsi-manage.c:269 ncsi_start_channel_monitor+0x7c/0x90
[  459.040000] CPU: 0 PID: 1093 Comm: kworker/0:3 Not tainted 4.10.17-gaca2fdd #140
[  459.040000] Hardware name: ASpeed SoC
[  459.040000] Workqueue: events ncsi_dev_work
[  459.040000] [<80010094>] (unwind_backtrace) from [<8000d950>] (show_stack+0x20/0x24)
[  459.040000] [<8000d950>] (show_stack) from [<801dbf70>] (dump_stack+0x20/0x28)
[  459.040000] [<801dbf70>] (dump_stack) from [<80018d7c>] (__warn+0xe0/0x108)
[  459.040000] [<80018d7c>] (__warn) from [<80018e70>] (warn_slowpath_null+0x30/0x38)
[  459.040000] [<80018e70>] (warn_slowpath_null) from [<803f6a08>] (ncsi_start_channel_monitor+0x7c/0x90)
[  459.040000] [<803f6a08>] (ncsi_start_channel_monitor) from [<803f7664>] (ncsi_configure_channel+0xdc/0x5fc)
[  459.040000] [<803f7664>] (ncsi_configure_channel) from [<803f8160>] (ncsi_dev_work+0xac/0x474)
[  459.040000] [<803f8160>] (ncsi_dev_work) from [<8002d244>] (process_one_work+0x1e0/0x450)
[  459.040000] [<8002d244>] (process_one_work) from [<8002d510>] (worker_thread+0x5c/0x570)
[  459.040000] [<8002d510>] (worker_thread) from [<80033614>] (kthread+0x124/0x164)
[  459.040000] [<80033614>] (kthread) from [<8000a5e8>] (ret_from_fork+0x14/0x2c)

This also updates the monitor instead of just returning if
ncsi_xmit_cmd() fails to send the get-link-status command so that the
monitor properly times out.

Fixes: e6f44ed6d04d3 "net/ncsi: Package and channel management"

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0795fb2021f07969949f523ea33c39785bfae9d6)
---
 net/ncsi/ncsi-manage.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index 24bf3f100d48..5bef2cb5a825 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -199,11 +199,15 @@ static void ncsi_channel_monitor(unsigned long data)
 	monitor_state = nc->monitor.state;
 	spin_unlock_irqrestore(&nc->lock, flags);
 
-	if (!enabled || chained)
+	if (!enabled || chained) {
+		ncsi_stop_channel_monitor(nc);
 		return;
+	}
 	if (state != NCSI_CHANNEL_INACTIVE &&
-	    state != NCSI_CHANNEL_ACTIVE)
+	    state != NCSI_CHANNEL_ACTIVE) {
+		ncsi_stop_channel_monitor(nc);
 		return;
+	}
 
 	switch (monitor_state) {
 	case NCSI_CHANNEL_MONITOR_START:
@@ -214,12 +218,9 @@ static void ncsi_channel_monitor(unsigned long data)
 		nca.type = NCSI_PKT_CMD_GLS;
 		nca.req_flags = 0;
 		ret = ncsi_xmit_cmd(&nca);
-		if (ret) {
+		if (ret)
 			netdev_err(ndp->ndev.dev, "Error %d sending GLS\n",
 				   ret);
-			return;
-		}
-
 		break;
 	case NCSI_CHANNEL_MONITOR_WAIT ... NCSI_CHANNEL_MONITOR_WAIT_MAX:
 		break;
@@ -230,6 +231,8 @@ static void ncsi_channel_monitor(unsigned long data)
 			ndp->flags |= NCSI_DEV_RESHUFFLE;
 		}
 
+		ncsi_stop_channel_monitor(nc);
+
 		spin_lock_irqsave(&nc->lock, flags);
 		nc->state = NCSI_CHANNEL_INVISIBLE;
 		spin_unlock_irqrestore(&nc->lock, flags);
-- 
2.14.2

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

* [PATCH 5/7] net/ncsi: Disable HWA mode when no channels are found
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
                   ` (3 preceding siblings ...)
  2017-10-23  5:45 ` [PATCH 4/7] net/ncsi: Stop monitor if channel times out or is inactive Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 6/7] net/ncsi: Enforce failover on link monitor timeout Samuel Mendoza-Jonas
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

When there are no NCSI channels probed, HWA (Hardware Arbitration)
mode is enabled. It's not correct because HWA depends on the fact:
NCSI channels exist and all of them support HWA mode. This disables
HWA when no channels are probed.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 100ef01f3ea4badbee6479290a41f74abd0e523f)
---
 net/ncsi/ncsi-manage.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index 5bef2cb5a825..8a589e611225 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -991,12 +991,15 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp)
 	struct ncsi_package *np;
 	struct ncsi_channel *nc;
 	unsigned int cap;
+	bool has_channel = false;
 
 	/* The hardware arbitration is disabled if any one channel
 	 * doesn't support explicitly.
 	 */
 	NCSI_FOR_EACH_PACKAGE(ndp, np) {
 		NCSI_FOR_EACH_CHANNEL(np, nc) {
+			has_channel = true;
+
 			cap = nc->caps[NCSI_CAP_GENERIC].cap;
 			if (!(cap & NCSI_CAP_GENERIC_HWA) ||
 			    (cap & NCSI_CAP_GENERIC_HWA_MASK) !=
@@ -1007,8 +1010,13 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp)
 		}
 	}
 
-	ndp->flags |= NCSI_DEV_HWA;
-	return true;
+	if (has_channel) {
+		ndp->flags |= NCSI_DEV_HWA;
+		return true;
+	}
+
+	ndp->flags &= ~NCSI_DEV_HWA;
+	return false;
 }
 
 static int ncsi_enable_hwa(struct ncsi_dev_priv *ndp)
-- 
2.14.2

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

* [PATCH 6/7] net/ncsi: Enforce failover on link monitor timeout
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
                   ` (4 preceding siblings ...)
  2017-10-23  5:45 ` [PATCH 5/7] net/ncsi: Disable HWA mode when no channels are found Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-23  5:45 ` [PATCH 7/7] net/ncsi: Fix length of GVI response packet Samuel Mendoza-Jonas
  2017-10-24  0:34 ` [PATCH 0/7] Backport upstream NCSI fixes Andrew Jeffery
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

The NCSI channel has been configured to provide service if its link
monitor timer is enabled, regardless of its state (inactive or active).
So the timeout event on the link monitor indicates the out-of-service
on that channel, for which a failover is needed.

This sets NCSI_DEV_RESHUFFLE flag to enforce failover on link monitor
timeout, regardless the channel's original state (inactive or active).
Also, the link is put into "down" state to give the failing channel
lowest priority when selecting for the active channel. The state of
failing channel should be set to active in order for deinitialization
and failover to be done.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 52b4c8627f9f0d882e969967a207a27a80c9c753)
---
 net/ncsi/ncsi-manage.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index 8a589e611225..8cae2f233272 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -186,6 +186,7 @@ static void ncsi_channel_monitor(unsigned long data)
 	struct ncsi_channel *nc = (struct ncsi_channel *)data;
 	struct ncsi_package *np = nc->package;
 	struct ncsi_dev_priv *ndp = np->ndp;
+	struct ncsi_channel_mode *ncm;
 	struct ncsi_cmd_arg nca;
 	bool enabled, chained;
 	unsigned int monitor_state;
@@ -225,20 +226,21 @@ static void ncsi_channel_monitor(unsigned long data)
 	case NCSI_CHANNEL_MONITOR_WAIT ... NCSI_CHANNEL_MONITOR_WAIT_MAX:
 		break;
 	default:
-		if (!(ndp->flags & NCSI_DEV_HWA) &&
-		    state == NCSI_CHANNEL_ACTIVE) {
+		if (!(ndp->flags & NCSI_DEV_HWA)) {
 			ncsi_report_link(ndp, true);
 			ndp->flags |= NCSI_DEV_RESHUFFLE;
 		}
 
 		ncsi_stop_channel_monitor(nc);
 
+		ncm = &nc->modes[NCSI_MODE_LINK];
 		spin_lock_irqsave(&nc->lock, flags);
 		nc->state = NCSI_CHANNEL_INVISIBLE;
+		ncm->data[2] &= ~0x1;
 		spin_unlock_irqrestore(&nc->lock, flags);
 
 		spin_lock_irqsave(&ndp->lock, flags);
-		nc->state = NCSI_CHANNEL_INACTIVE;
+		nc->state = NCSI_CHANNEL_ACTIVE;
 		list_add_tail_rcu(&nc->link, &ndp->channel_queue);
 		spin_unlock_irqrestore(&ndp->lock, flags);
 		ncsi_process_next_channel(ndp);
-- 
2.14.2

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

* [PATCH 7/7] net/ncsi: Fix length of GVI response packet
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
                   ` (5 preceding siblings ...)
  2017-10-23  5:45 ` [PATCH 6/7] net/ncsi: Enforce failover on link monitor timeout Samuel Mendoza-Jonas
@ 2017-10-23  5:45 ` Samuel Mendoza-Jonas
  2017-10-24  0:34 ` [PATCH 0/7] Backport upstream NCSI fixes Andrew Jeffery
  7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2017-10-23  5:45 UTC (permalink / raw)
  To: openbmc

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

The length of GVI (GetVersionInfo) response packet should be 40 instead
of 36. This issue was found from /sys/kernel/debug/ncsi/eth0/stats.

 # ethtool --ncsi eth0 swstats
     :
 RESPONSE     OK       TIMEOUT  ERROR
 =======================================
 GVI          0        0        2

With this applied, no error reported on GVI response packets:

 # ethtool --ncsi eth0 swstats
     :
 RESPONSE     OK       TIMEOUT  ERROR
 =======================================
 GVI          2        0        0

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0a90e251988ceedc528c8db98f25b051cf190f44)
---
 net/ncsi/ncsi-rsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c
index 265b9a892d41..927dad4759d1 100644
--- a/net/ncsi/ncsi-rsp.c
+++ b/net/ncsi/ncsi-rsp.c
@@ -959,7 +959,7 @@ static struct ncsi_rsp_handler {
 	{ NCSI_PKT_RSP_EGMF,    4, ncsi_rsp_handler_egmf    },
 	{ NCSI_PKT_RSP_DGMF,    4, ncsi_rsp_handler_dgmf    },
 	{ NCSI_PKT_RSP_SNFC,    4, ncsi_rsp_handler_snfc    },
-	{ NCSI_PKT_RSP_GVI,    36, ncsi_rsp_handler_gvi     },
+	{ NCSI_PKT_RSP_GVI,    40, ncsi_rsp_handler_gvi     },
 	{ NCSI_PKT_RSP_GC,     32, ncsi_rsp_handler_gc      },
 	{ NCSI_PKT_RSP_GP,     -1, ncsi_rsp_handler_gp      },
 	{ NCSI_PKT_RSP_GCPS,  172, ncsi_rsp_handler_gcps    },
-- 
2.14.2

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

* Re: [PATCH 0/7] Backport upstream NCSI fixes
  2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
                   ` (6 preceding siblings ...)
  2017-10-23  5:45 ` [PATCH 7/7] net/ncsi: Fix length of GVI response packet Samuel Mendoza-Jonas
@ 2017-10-24  0:34 ` Andrew Jeffery
  7 siblings, 0 replies; 9+ messages in thread
From: Andrew Jeffery @ 2017-10-24  0:34 UTC (permalink / raw)
  To: Samuel Mendoza-Jonas, openbmc

[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]

On Mon, 2017-10-23 at 16:45 +1100, Samuel Mendoza-Jonas wrote:
> This backports a few useful NCSI fixes which are upstream, as well as
> replacing
> "net/ncsi: Don't assume last available channel exists" with the
> actual upstream
> version.
> 
> Gavin Shan (3):
>   net/ncsi: Disable HWA mode when no channels are found
>   net/ncsi: Enforce failover on link monitor timeout
>   net/ncsi: Fix length of GVI response packet
> 
> Samuel Mendoza-Jonas (4):
>   Revert "net/ncsi: Don't assume last available channel exists"
>   net/ncsi: Don't limit vids based on hot_channel
>   net/ncsi: Fix AEN HNCDSC packet length
>   net/ncsi: Stop monitor if channel times out or is inactive

Series applied to dev-4.10.

Cheers,

Andrew

> 
>  net/ncsi/internal.h    |  1 +
>  net/ncsi/ncsi-aen.c    |  2 +-
>  net/ncsi/ncsi-manage.c | 59 +++++++++++++++++++++++++++-------------
> ----------
>  net/ncsi/ncsi-rsp.c    |  2 +-
>  4 files changed, 35 insertions(+), 29 deletions(-)
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2017-10-24  0:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-23  5:45 [PATCH 0/7] Backport upstream NCSI fixes Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 1/7] Revert "net/ncsi: Don't assume last available channel exists" Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 2/7] net/ncsi: Don't limit vids based on hot_channel Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 3/7] net/ncsi: Fix AEN HNCDSC packet length Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 4/7] net/ncsi: Stop monitor if channel times out or is inactive Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 5/7] net/ncsi: Disable HWA mode when no channels are found Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 6/7] net/ncsi: Enforce failover on link monitor timeout Samuel Mendoza-Jonas
2017-10-23  5:45 ` [PATCH 7/7] net/ncsi: Fix length of GVI response packet Samuel Mendoza-Jonas
2017-10-24  0:34 ` [PATCH 0/7] Backport upstream NCSI fixes Andrew Jeffery

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.