1 From 60971e62dcbb50a7ef1c3839e8b33b5aef6a48fe Mon Sep 17 00:00:00 2001
2 From: John Daley <johndale@cisco.com>
3 Date: Fri, 1 Jul 2016 12:24:45 -0700
4 Subject: [PATCH 18/25] enic: fix segfault on Tx path after restarting a device
6 If you stop then start a port that had already sent some packets,
7 there was a segfault due to not resetting the number of completed
10 Fixes: d5d882fe1a11 ("Tx path rewrite to reduce Host CPU overhead")
12 Signed-off-by: Nelson Escobar <neescoba@cisco.com>
13 Reviewed-by: John Daley <johndale@cisco.com>
15 drivers/net/enic/base/vnic_wq.c | 2 ++
16 drivers/net/enic/base/vnic_wq.h | 1 +
17 2 files changed, 3 insertions(+)
19 diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c
20 index 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,
27 + wq->last_completed_index = 0;
28 + *((uint32_t *)wq->cqmsg_rz->addr) = 0;
30 iowrite32(0, &wq->ctrl->fetch_index);
31 iowrite32(0, &wq->ctrl->posted_index);
32 diff --git a/drivers/net/enic/base/vnic_wq.h b/drivers/net/enic/base/vnic_wq.h
33 index 37c3ff9..faf3bfa 100644
34 --- a/drivers/net/enic/base/vnic_wq.h
35 +++ b/drivers/net/enic/base/vnic_wq.h
40 +#include <rte_memzone.h>
42 /* Work queue control */