From patchwork Fri Jun 19 17:04:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iremonger, Bernard" X-Patchwork-Id: 5610 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 E9593C93A; Fri, 19 Jun 2015 19:04:58 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E02EAC916 for ; Fri, 19 Jun 2015 19:04:56 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 19 Jun 2015 10:04:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,644,1427785200"; d="scan'208";a="714036040" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 19 Jun 2015 10:04:08 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5JH47Wa023110; Fri, 19 Jun 2015 18:04:07 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t5JH473P032154; Fri, 19 Jun 2015 18:04:07 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t5JH47HH032149; Fri, 19 Jun 2015 18:04:07 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Fri, 19 Jun 2015 18:04:00 +0100 Message-Id: <1434733442-32013-5-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1434733442-32013-1-git-send-email-bernard.iremonger@intel.com> References: <1434733442-32013-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v5 4/6] i40e: call _clear_cmd() when error occurs 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" _clear_cmd() was not being called in failure situations, resulting in the next command also failing. Fix several typos. Signed-off-by: Bernard Iremonger --- drivers/net/i40e/i40e_ethdev_vf.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 9a6aa29..6f3ecff 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -361,6 +361,7 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args) args->in_args, args->in_args_size, NULL); if (err) { PMD_DRV_LOG(ERR, "fail to send cmd %d", args->ops); + _clear_cmd(vf); return err; } @@ -368,8 +369,10 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args) /* read message and it's expected one */ if (!err && args->ops == info.ops) _clear_cmd(vf); - else if (err) + else if (err) { PMD_DRV_LOG(ERR, "Failed to read message from AdminQ"); + _clear_cmd(vf); + } else if (args->ops != info.ops) PMD_DRV_LOG(ERR, "command mismatch, expect %u, get %u", args->ops, info.ops); @@ -794,7 +797,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev) /* Stop TX queues first */ for (i = 0; i < dev->data->nb_tx_queues; i++) { if (i40evf_dev_tx_queue_stop(dev, i) != 0) { - PMD_DRV_LOG(ERR, "Fail to start queue %u", i); + PMD_DRV_LOG(ERR, "Fail to stop queue %u", i); return -1; } } @@ -802,7 +805,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev) /* Then stop RX queues */ for (i = 0; i < dev->data->nb_rx_queues; i++) { if (i40evf_dev_rx_queue_stop(dev, i) != 0) { - PMD_DRV_LOG(ERR, "Fail to start queue %u", i); + PMD_DRV_LOG(ERR, "Fail to stop queue %u", i); return -1; } } @@ -1445,7 +1448,7 @@ i40evf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) err = i40evf_switch_queue(dev, FALSE, tx_queue_id, FALSE); if (err) { - PMD_DRV_LOG(ERR, "Failed to switch TX queue %u of", + PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off", tx_queue_id); return err; }