From patchwork Wed Jun 29 23:03:21 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: 14459 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 21B422BD1; Thu, 30 Jun 2016 01:03:40 +0200 (CEST) Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by dpdk.org (Postfix) with ESMTP id 24AF62BD1 for ; Thu, 30 Jun 2016 01:03:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1115; q=dns/txt; s=iport; t=1467241418; x=1468451018; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=7lQ2ACaZVpfBcx8oyWncI1T5oYQ3duZj8MezE8uCZNw=; b=S0BoXzkpl3YkH92Phdlc6oMEbWkGZfjOFVyl8SqZpN9Ldcsas0MqC7O5 URPlKh2ie1GZrESubY+ERhSQo+Rcxn5nO0PHsz1s1Bor3AFfppbiKHMXC KWLYs0tF2ZzM3gNIBCFXXLI48/dCDrQ26zj+RU9u7Ahx94WUbFCs7CNHZ 0=; X-IronPort-AV: E=Sophos;i="5.26,549,1459814400"; d="scan'208";a="118710240" Received: from alln-core-5.cisco.com ([173.36.13.138]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Jun 2016 23:03:37 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id u5TN3b9s005913; Wed, 29 Jun 2016 23:03:37 GMT Received: by cisco.com (Postfix, from userid 392789) id 324143FAADC0; Wed, 29 Jun 2016 16:03:37 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: bruce.richardson@intel.com, John Daley Date: Wed, 29 Jun 2016 16:03:21 -0700 Message-Id: <1467241401-26210-2-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1467241401-26210-1-git-send-email-johndale@cisco.com> References: <1467241401-26210-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH 2/2] enic: fix Rx queue initialization 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" If you stop then start a port that had already received some packets, the NIC could fetch discriptors from the wrong location. This could effectivly reduce the size of the Rx queue by a random amount and cause packet drop or reduced performance. Reset the NIC fetch index to 0 when allocating and posting mbuf addresses to the NIC. Fixes: 947d860c821f ("enic: improve Rx performance") Signed-off-by: John Daley Reviewed-by: Nelson Escobar --- drivers/net/enic/enic_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index dc831b4..0475cc1 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -334,6 +334,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq) dev_debug(enic, "port=%u, qidx=%u, Write %u posted idx, %u sw held\n", enic->port_id, rq->index, rq->posted_index, rq->rx_nb_hold); iowrite32(rq->posted_index, &rq->ctrl->posted_index); + iowrite32(0, &rq->ctrl->fetch_index); rte_rmb(); return 0;