blob: 10b66375b441b87a6208842b4580e2c407ec20cf [file] [log] [blame]
John Lo55bf5c92016-07-04 23:23:32 -04001From 60971e62dcbb50a7ef1c3839e8b33b5aef6a48fe Mon Sep 17 00:00:00 2001
2From: John Daley <johndale@cisco.com>
3Date: Fri, 1 Jul 2016 12:24:45 -0700
4Subject: [PATCH 18/25] enic: fix segfault on Tx path after restarting a device
5
6If you stop then start a port that had already sent some packets,
7there was a segfault due to not resetting the number of completed
8sends to zero.
9
10Fixes: d5d882fe1a11 ("Tx path rewrite to reduce Host CPU overhead")
11
12Signed-off-by: Nelson Escobar <neescoba@cisco.com>
13Reviewed-by: John Daley <johndale@cisco.com>
14---
15 drivers/net/enic/base/vnic_wq.c | 2 ++
16 drivers/net/enic/base/vnic_wq.h | 1 +
17 2 files changed, 3 insertions(+)
18
19diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c
20index ccbbd61..7026bfe 100644
21--- a/drivers/net/enic/base/vnic_wq.c
22+++ b/drivers/net/enic/base/vnic_wq.c
23@@ -206,6 +206,8 @@ void vnic_wq_clean(struct vnic_wq *wq,
24
25 wq->head_idx = 0;
26 wq->tail_idx = 0;
27+ wq->last_completed_index = 0;
28+ *((uint32_t *)wq->cqmsg_rz->addr) = 0;
29
30 iowrite32(0, &wq->ctrl->fetch_index);
31 iowrite32(0, &wq->ctrl->posted_index);
32diff --git a/drivers/net/enic/base/vnic_wq.h b/drivers/net/enic/base/vnic_wq.h
33index 37c3ff9..faf3bfa 100644
34--- a/drivers/net/enic/base/vnic_wq.h
35+++ b/drivers/net/enic/base/vnic_wq.h
36@@ -38,6 +38,7 @@
37
38 #include "vnic_dev.h"
39 #include "vnic_cq.h"
40+#include <rte_memzone.h>
41
42 /* Work queue control */
43 struct vnic_wq_ctrl {
44--
452.7.0
46