From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by dpdk.org (Postfix) with ESMTP id 0EC872956 for ; Thu, 9 Jun 2016 20:56:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1964; q=dns/txt; s=iport; t=1465498581; x=1466708181; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=u0/VtTUDc1YCtomfl3xPQvcFCs3LVmDkEFBmSs97wfM=; b=JEVETs23lRwLMTXCbDWBZMwZML3TBJ6qySoBu1HcPy8zM8BdW47LgktH sVncYyAAVOIphWEcczjVsO98r5XuGllhJl42ztNXYSVDDVdYdgJ55+uxG 0Jf+0KryC/VpkkFldSUBEo8a7VaB4USCzcfIDrD3axkRC9G5Bx47iEluN 0=; X-IronPort-AV: E=Sophos;i="5.26,446,1459814400"; d="scan'208";a="111631897" Received: from rcdn-core-12.cisco.com ([173.37.93.148]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2016 18:56:20 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-12.cisco.com (8.14.5/8.14.5) with ESMTP id u59IuK4X008740; Thu, 9 Jun 2016 18:56:20 GMT Received: by cisco.com (Postfix, from userid 392789) id 1D9BB3FAAE23; Thu, 9 Jun 2016 11:56:20 -0700 (PDT) From: John Daley To: bruce.richardson@intel.com Cc: dev@dpdk.org, John Daley Date: Thu, 9 Jun 2016 11:56:09 -0700 Message-Id: <1465498569-5857-3-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1465498569-5857-1-git-send-email-johndale@cisco.com> References: <20160609160808.GJ12520@bricha3-MOBL3> <1465498569-5857-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH v3 2/2] enic: more specific out of resources error messages 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: , X-List-Received-Date: Thu, 09 Jun 2016 18:56:21 -0000 If configuration fails due to lack of resources, be more specific about which resources are lacking - work queues, read queues or completion queues. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley --- v3: Log messages fix in separate patch. Log errors for all lacking resources, not just 1st encountered. drivers/net/enic/enic_main.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 5939b9d..70776c2 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -819,22 +819,29 @@ static void enic_dev_deinit(struct enic *enic) int enic_set_vnic_res(struct enic *enic) { struct rte_eth_dev *eth_dev = enic->rte_dev; + int rc = 0; - if ((enic->rq_count < eth_dev->data->nb_rx_queues) || - (enic->wq_count < eth_dev->data->nb_tx_queues)) { - dev_err(dev, "Not enough resources configured, aborting\n"); - return -1; + if (enic->rq_count < eth_dev->data->nb_rx_queues) { + dev_err(dev, "Not enough Receive queues. Requested:%u, Configured:%u\n", + eth_dev->data->nb_rx_queues, enic->rq_count); + rc = -1; + } + if (enic->wq_count < eth_dev->data->nb_tx_queues) { + dev_err(dev, "Not enough Transmit queues. Requested:%u, Configured:%u\n", + eth_dev->data->nb_tx_queues, enic->wq_count); + rc = -1; } enic->rq_count = eth_dev->data->nb_rx_queues; enic->wq_count = eth_dev->data->nb_tx_queues; if (enic->cq_count < (enic->rq_count + enic->wq_count)) { - dev_err(dev, "Not enough resources configured, aborting\n"); - return -1; + dev_err(dev, "Not enough Completion queues. Required:%u, Configured:%u\n", + enic->rq_count + enic->wq_count, enic->cq_count); + rc = -1; } enic->cq_count = enic->rq_count + enic->wq_count; - return 0; + return rc; } static int enic_dev_init(struct enic *enic) -- 2.7.0