From patchwork Wed Jun 29 23:03:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 14458 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 2ACDB2BC3; Thu, 30 Jun 2016 01:03:37 +0200 (CEST) Received: from alln-iport-7.cisco.com (alln-iport-7.cisco.com [173.37.142.94]) by dpdk.org (Postfix) with ESMTP id 78B572B8D for ; Thu, 30 Jun 2016 01:03:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=915; q=dns/txt; s=iport; t=1467241415; x=1468451015; h=from:to:cc:subject:date:message-id; bh=yrTg8qv96k6OXrGnPoGb/+Af7iLbqS3VQQqScHAGagQ=; b=gDaDOAQzqL64UV6NPDOn3xUEb5J2ALKmbFAjuysIQSlV0Qv6c8UDob4w Xac+ourN0IYCV0Pq/m2PkDp3kora1YI1DjGxJg0iKl4XxDLUgJ2nKGwcR zuJP/Nt0Ors3PyIcxLN/vFTmQiSNmRTMKxhR83dVSU1CUpq/nCzaxxJmY E=; X-IronPort-AV: E=Sophos;i="5.26,549,1459814400"; d="scan'208";a="291644470" Received: from alln-core-7.cisco.com ([173.36.13.140]) by alln-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Jun 2016 23:03:34 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id u5TN3YkU002179; Wed, 29 Jun 2016 23:03:34 GMT Received: by cisco.com (Postfix, from userid 392789) id 74A093FAADC0; Wed, 29 Jun 2016 16:03:34 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: bruce.richardson@intel.com, Nelson Escobar Date: Wed, 29 Jun 2016 16:03:20 -0700 Message-Id: <1467241401-26210-1-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH 1/2] enic: fix segfault on Tx path after restarting a device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nelson Escobar 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 Reviewed-by: John Daley --- drivers/net/enic/base/vnic_wq.c | 2 ++ 1 file changed, 2 insertions(+) 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);