net/enic: fix Tx crash after restart
authorNelson Escobar <neescoba@cisco.com>
Wed, 29 Jun 2016 23:03:20 +0000 (16:03 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Tue, 5 Jul 2016 13:36:23 +0000 (15:36 +0200)
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: a3b1e9551c26 ("net/enic: streamline mbuf handling in Tx path")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
drivers/net/enic/base/vnic_wq.c

index 9b9ff4d..7c4119c 100644 (file)
@@ -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);