John Lo | 55bf5c9 | 2016-07-04 23:23:32 -0400 | [diff] [blame] | 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 |
| 5 | |
| 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 |
| 8 | sends to zero. |
| 9 | |
| 10 | Fixes: d5d882fe1a11 ("Tx path rewrite to reduce Host CPU overhead") |
| 11 | |
| 12 | Signed-off-by: Nelson Escobar <neescoba@cisco.com> |
| 13 | Reviewed-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 | |
| 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, |
| 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); |
| 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 |
| 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 | -- |
| 45 | 2.7.0 |
| 46 | |