[dpdk-dev,1/2] enic: fix segfault on Tx path after restarting a device

Message ID 1467241401-26210-1-git-send-email-johndale@cisco.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

John Daley (johndale) June 29, 2016, 11:03 p.m. UTC
  From: Nelson Escobar <neescoba@cisco.com>

If you stop then start a port that had already sent some packets,
there was a segfault due to not resetting the number of completed
sends to zero.

Fixes: d5d882fe1a11 ("Tx path rewrite to reduce Host CPU overhead")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/base/vnic_wq.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c
index 9b9ff4d..7c4119c 100644
--- a/drivers/net/enic/base/vnic_wq.c
+++ b/drivers/net/enic/base/vnic_wq.c
@@ -197,6 +197,8 @@  void vnic_wq_clean(struct vnic_wq *wq,
 
 	wq->head_idx = 0;
 	wq->tail_idx = 0;
+	wq->last_completed_index = 0;
+	*((uint32_t *)wq->cqmsg_rz->addr) = 0;
 
 	iowrite32(0, &wq->ctrl->fetch_index);
 	iowrite32(0, &wq->ctrl->posted_index);