From patchwork Fri Sep 8 08:45:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112042 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1247407ybm; Fri, 8 Sep 2017 01:50:33 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4m5AQmlYhfNjRwxgBQaLpuDqqWowWmDlS/vUkSMunzfI/0V9DxBuzwnrTYAasvKztpFY+v X-Received: by 10.223.164.206 with SMTP id h14mr1723316wrb.221.1504860633690; Fri, 08 Sep 2017 01:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860633; cv=none; d=google.com; s=arc-20160816; b=boEEYleZMYEn/ysPYsYgachALk1zdYyv9HrxEkX9u8SHCP+b7YJvqTEiOxFkhsVyGS qLUGGlnZWoWsQvRKAVSzQx4iZQTUWXUkni6xF8Slu/IxNK5fgttu+f1Ro6Uhgo0U4ild 91NcNxoeNxRQhxTM4pwX/tO3Okucz52x07i+S5uDvRAGXKzhQtec4NJaxAVL4jvF7sw4 ArE+/+2hD+8fNrCv5xBMI0A3VyYGteA0aT8EpG6w3qeZxVhHDeCJfbkeKZLnIKNgChJL sW0EgxtrLVG/2EUEn1Puzk2YZwkI4rEiW+IGjLMKLQ68WFBSqQG2e36UveOfqjXQ0NUF O08Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=Xcji+MK5vJrCf02MvxAXWCw+7EdMD4wCyMvSwo6v5Po=; b=txJGM5Vxtkz+LxExQ4yYgYLMsKQybBjjfy6Wfeu0j7aUArQ/35psbk1lIQvau0as6h GBzN4G4ED56cVxLtFXY6YVyfROAlT+tWzU1izphbwfVFlLnkTKLMYytftFgChsNZd9RI miEkZ6LdYQTmISwPRZA2R9CkeIJzbaYtYJtxClpCJGOxsQbbBz8Uu307mBtpytUS4igj zJRc6wMsvnswLpBappJ7cGX0xKrYej15D07uur6d8fK+Cq7iIKL0BAPO6q46D3mmVI/k 7IGq4qWM+IasptSlmJ5bGsXlgWNcMR6iLO8S+H/B0inJgjACo11EdXrWt7djyaNz1rcB Vwgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id m126si997832wma.160.2017.09.08.01.50.33; Fri, 08 Sep 2017 01:50:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id BA11419A3E; Fri, 8 Sep 2017 10:46:33 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0067.outbound.protection.outlook.com [104.47.38.67]) by dpdk.org (Postfix) with ESMTP id 50B14199E5 for ; Fri, 8 Sep 2017 10:46:31 +0200 (CEST) Received: from BN6PR03CA0016.namprd03.prod.outlook.com (10.168.230.154) by CY4PR03MB3320.namprd03.prod.outlook.com (10.171.247.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 8 Sep 2017 08:46:30 +0000 Received: from BN1BFFO11FD020.protection.gbl (2a01:111:f400:7c10::1:187) by BN6PR03CA0016.outlook.office365.com (2603:10b6:404:23::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12 via Frontend Transport; Fri, 8 Sep 2017 08:46:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD020.mail.protection.outlook.com (10.58.144.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Fri, 8 Sep 2017 08:46:28 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v888jmoq023063; Fri, 8 Sep 2017 01:46:27 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:17 +0530 Message-ID: <1504860327-18451-21-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131493339891654882; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(97736004)(106466001)(2351001)(356003)(33646002)(85426001)(2906002)(68736007)(86362001)(50226002)(81166006)(81156014)(8676002)(8936002)(104016004)(5003940100001)(47776003)(8656003)(110136004)(2950100002)(48376002)(6916009)(6666003)(5660300001)(50986999)(50466002)(305945005)(105606002)(76176999)(189998001)(53936002)(4326008)(498600001)(36756003)(54906002)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3320; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD020; 1:dGY91IrjB7lz44lln1f0hegpTYTWfQfA2UbBV/9DTEGDby3xKkfKbvrIMeJPyItZAzw85uStinIWb/YhxX07rJ3ST5wI1s2Zo1Sisbz2NN+hkWRJgl/VkHPStrihOdU9 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc0906dd-1568-4f0f-ff83-08d4f6961906 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB3320; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 3:u2OTTDDrL42BCXe4A8v6hB+Bztf1hyGo/QZpcRRpdHR5GYWdYPFP+TrhqdR91HKzDUllNxc4xGJ7fEDaFwo6+GWEzQYUK5q42UJaPY3UJusldAqgk9f7E3aceoH2b0anowdXBLQ/4umCGVpX99WrYBPJjHlyUkv1BUThXRZe9JmxR7BcXrO/44JvISYziEA6Y8NiKO+sGjdWhMbb3vPvBfmjvrr0S00Ri6ND81e8vaL49uK+5SHOr24HTt1jUyukwL+RiznoPsnihxgRFK9lkdL9SjZ/lHXgiSj71LFkpSP4HIP6BdV3T519Meio1LV2IJE2WLmhRnUeIzr8fbNAoSLweqKsBpd9ScpM9RZ2/Ec=; 25:xJ5Jl3ERy7XkIOwCtuFegtILkCS9uhIwkye3H2gusYnSZuibQ2e78QjY1lNzhgmykRA/n2OYQ/xVAYzItfq0PG4W/qBf5+9ElvcJzN6lxqP+ekP7lC5YYdAMO7Syqp2J1pYO1tEQUp9lPQwZ5FGWFz5BFeUgCgvUDneYMSrSBsXPJ+fW6143X4BIUASFn8f7HfxANtC2r2LVlUC4XqTLgFLz0lh6J7YimcmZRUo7y2qSnE1BjtoUyfEHQdlpixuy3BTJjqTABNrTIt965GCDi+9OSl+Po3uo/Ubs0wdE7SsBebhdNJDahTwKx3sS9qCn29r1KloTUcsGLIUX/OlNAg== X-MS-TrafficTypeDiagnostic: CY4PR03MB3320: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 31:7wt0kghqawiZqbykjkF7xOv0GaH0oPjQb3ea0g8B8hn7wZABLzVSM+qmfa6/kx7p2gFvSvcadq9pGNVfaY2EZ9CupvPVLaGtGF9WURhxHKNUrMszxlYOWRdro3EGK0T5gGBarOk6ZQ9f3icU2OAcqfrnjwvVevoYi64rVfFv8a4fJX+q6rQFX5W+YLuQJ72uCWKR1/mnK236FoUOGd/gGw1jh/Ignbb09/dqjtA3Jh4=; 4:4rxsFf/MzbVPLEeS8sDKC36w/0pW+XsCwuA1gPjXBEXakMe8EGf+LDpz90F0UoAFEjIO+Dhzf/yZp4+KEuW11AD3/6ixxopmjwn6qXnpp9z58nLecxLdAS4vEBptUkczvTWhr7cT822U0928YnVQx10IWNomY0KmV9TxwFE50RgrRrHas/eSmv98Yq9lpBBfbWclftePCPAQRRvZHMNvEZHINOWuGG0k3CGvtribI5pkODcN7x6BaNzrZIn67Oeg38ROz40pUDnTPwE8YNA/i0AjhoMMeHRc0TJz4ddsNcI= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123561025)(20161123559100)(20161123556025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3320; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3320; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3320; 23:M0FnkchbEGYGcUZ+KZ0SNBVJ8MpA7SdWBWt+MyjTE?= CGN3FmgiewdWYZXgeIoa2X0EoLT/J4rP5SXKrB6zOfQzoTACJPNM2YcmCKaf5siQmAdoR7XBCrdwrXJZVAzQGXPBEIavKc65AcGetiPv+acdCye1auvFs0zbXN82MigPEcV3XQIQIpx96jC/+syTqGtxEH5z37VykEfVtTEXtS0QD3AI285qTFM3AihpQU4qujwkj8hV1ufsNklNlu1F9EJkyCh9I6cUGdWfYgqn9A7RpN6BS/mDZzdebQjJBfI7NbI+RCHbVmNU9NRk/fgdYFUJVI+t+QBL1hdpwTYQHcfVu7rY28hkf1ORClxFqIxalLkvgjbGJKyuhCV7tSdrbUADn94Nmcacz0dllYmJZWTlb//qW06NW/uVYN71Kbrw3pWkjOHQWKAPVoQ2c2Cp+tg0sbLf17KaGjf9FIiThN74QLaSs6pl4FCp//weBnp0EcaKGrLKpxBTbbqDZkV1U33eacJxBhCrU0JmtfFzQY7NlvA8qIl/qtHgzG7Pyo42GzYxoSk3epG2CsH+6Tc+1JMBy9Tkl6ntpwpt2oFoYVvvfcQo0LZybJTEG4qW0pu2vnGpVNUWcxDhlzHkqtFHz7UpIXrWwncUkn+WGVWB5UJjsCUg2acQIXbbEKP12sD256t0sxS8m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s=; 7:zIoFc9GRwiL5dUNfj1DIghf0nXRyiGY6mOnTz6n40BGxLMDAfQdETFTjprP+/tWVgCZ+d0rOVAIPfJFJZn9pGHQpDlGugKIJkKaELov7lwMsBj1rXnvB9z8zrIGmQpEc7qvdX4GCj3IciQnU2IRWDKipsqBmZKQRL0ON9/AZosTU6VAicDBczlvaes3J7omq0boCSP+zSJRxZ7jJModDzo9gBM0pzp5QFLA1uY3LxKk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:28.9782 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3320 Subject: [dpdk-dev] [PATCH v2 20/30] net/dpaa2: improve error and logs for flow distribution X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 39 +++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 1269dd2..7e5ce64 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -49,7 +49,7 @@ #include "../dpaa2_ethdev.h" -static void +static int dpaa2_distset_to_dpkg_profile_cfg( uint32_t req_dist_set, struct dpkg_profile_cfg *kg_cfg); @@ -68,20 +68,26 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, p_params = rte_malloc( NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE); if (!p_params) { - RTE_LOG(ERR, PMD, "Memory unavaialble\n"); + PMD_INIT_LOG(ERR, "Memory unavailable"); return -ENOMEM; } memset(p_params, 0, DIST_PARAM_IOVA_SIZE); memset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg)); - dpaa2_distset_to_dpkg_profile_cfg(req_dist_set, &kg_cfg); + ret = dpaa2_distset_to_dpkg_profile_cfg(req_dist_set, &kg_cfg); + if (ret) { + PMD_INIT_LOG(ERR, "given rss_hf (%lx) not supported", + req_dist_set); + rte_free(p_params); + return ret; + } tc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params)); tc_cfg.dist_size = eth_dev->data->nb_rx_queues; tc_cfg.dist_mode = DPNI_DIST_MODE_HASH; ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); if (ret) { - RTE_LOG(ERR, PMD, "Unable to prepare extract parameters\n"); + PMD_INIT_LOG(ERR, "Unable to prepare extract parameters"); rte_free(p_params); return ret; } @@ -90,9 +96,9 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, &tc_cfg); rte_free(p_params); if (ret) { - RTE_LOG(ERR, PMD, - "Setting distribution for Rx failed with err: %d\n", - ret); + PMD_INIT_LOG(ERR, + "Setting distribution for Rx failed with err: %d", + ret); return ret; } @@ -113,7 +119,7 @@ int dpaa2_remove_flow_dist( p_params = rte_malloc( NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE); if (!p_params) { - RTE_LOG(ERR, PMD, "Memory unavaialble\n"); + PMD_INIT_LOG(ERR, "Memory unavailable"); return -ENOMEM; } memset(p_params, 0, DIST_PARAM_IOVA_SIZE); @@ -125,7 +131,7 @@ int dpaa2_remove_flow_dist( ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); if (ret) { - RTE_LOG(ERR, PMD, "Unable to prepare extract parameters\n"); + PMD_INIT_LOG(ERR, "Unable to prepare extract parameters"); rte_free(p_params); return ret; } @@ -134,13 +140,13 @@ int dpaa2_remove_flow_dist( &tc_cfg); rte_free(p_params); if (ret) - RTE_LOG(ERR, PMD, - "Setting distribution for Rx failed with err: %d\n", - ret); + PMD_INIT_LOG(ERR, + "Setting distribution for Rx failed with err:%d", + ret); return ret; } -static void +static int dpaa2_distset_to_dpkg_profile_cfg( uint32_t req_dist_set, struct dpkg_profile_cfg *kg_cfg) @@ -276,14 +282,17 @@ dpaa2_distset_to_dpkg_profile_cfg( break; default: - PMD_DRV_LOG(WARNING, "Bad flow distribution" - " option %x\n", dist_field); + PMD_INIT_LOG(WARNING, + "Unsupported flow dist option %x", + dist_field); + return -EINVAL; } } req_dist_set = req_dist_set >> 1; loop++; } kg_cfg->num_extracts = i; + return 0; } int