From patchwork Fri Aug 25 10:49:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111003 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp813675qge; Fri, 25 Aug 2017 03:54:46 -0700 (PDT) X-Received: by 10.223.136.104 with SMTP id e37mr6035564wre.152.1503658486165; Fri, 25 Aug 2017 03:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658486; cv=none; d=google.com; s=arc-20160816; b=sO4A9K48W7JAAWbd7R+OhU0Nxw3RvsbrH44FNzyLXrufvBuY/UoUfakQyoaG1qSVkw qYAYkOAVU2Qmwo8abrTLg3LkdtY/vmMpEFFan/v5oRBr4nQZlcNslz3sjFcXyO/0grgE gTyVuKVRz4B0UVLogwvIEzz0qjLKd7ZAG0ITi7jtiHJBBKLJIXO2iSjY5GvB8Avh5xDh pn2rUrdaGwALfZQBD/gYZMQgHU/DBSX4Eh690w73U4OWsmhUTGJQsvLM6OZY2Fz7hVrr ji7WZvjj49ta5Sbjeto6oxH2P+o84Au+xpRzfuNkw+y4YwNgUni5ExYUOEvgmetFh/Je HQMg== 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=0dfa7OsrVGN4DCetFLL6BYB709rY6HX2myWY4cHCqNbqYlMbKcwnOZ9hH/kmEksVez XaKZVfvM2CpvhDyB4M3UIqJwvn9Hf3Ic5rbboWrWTEGZU8mygh/C1zyFt7fUfpkcW5V8 LjpqzDUK8JQzUjWwj50OaB/2kPcNIsudHrBeFiW2LRdL55eFnfi9XZMePHuOvxlAU41q EPorXIzD0nxIMPjCEB4EXhO+kqzBvGEqYFlOKwoRWtXY/6cEIqG1/BUoXKL+WJxsQ2R8 SrYn4SDq/t0L/vpU/oOGFrfhKPtOAN4imijKV5W78zj5SArZMYrAuqhRywaNpELksc/K JT5A== 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 k81si1045099wmb.157.2017.08.25.03.54.45; Fri, 25 Aug 2017 03:54:46 -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 74CAE99AE; Fri, 25 Aug 2017 12:50:46 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0043.outbound.protection.outlook.com [104.47.37.43]) by dpdk.org (Postfix) with ESMTP id ABAB4999C for ; Fri, 25 Aug 2017 12:50:40 +0200 (CEST) Received: from BN3PR03CA0103.namprd03.prod.outlook.com (10.174.66.21) by CY1PR03MB2267.namprd03.prod.outlook.com (10.166.207.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:39 +0000 Received: from BY2FFO11FD024.protection.gbl (2a01:111:f400:7c0c::169) by BN3PR03CA0103.outlook.office365.com (2603:10b6:400:4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:39 +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 BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:38 +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 v7PAnw6O032070; Fri, 25 Aug 2017 03:50:36 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:36 +0530 Message-ID: <1503658183-4078-21-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318389722543; (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)(1110001)(1109001)(339900001)(199003)(189002)(54906002)(76176999)(305945005)(81166006)(85426001)(97736004)(50986999)(5660300001)(498600001)(189998001)(48376002)(33646002)(356003)(53936002)(81156014)(2351001)(50466002)(626005)(8936002)(8676002)(4326008)(106466001)(68736007)(105606002)(8656003)(110136004)(86362001)(2906002)(47776003)(77096006)(2950100002)(6916009)(104016004)(50226002)(5003940100001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2267; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD024; 1:oI9/VVEn/gsJmvgFAlrq+L9TARiC71r7QifQ8RbqHDdkNmyj97GYm28Ul3fHOrfCBeT4uFc5qr2TrrtEtRFrSrT3lB9LhTPvVBcAzUQJFXAb4IQt9+0UZ7WG/Wl+n3To MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6a492ee-10da-4245-22a7-08d4eba71f9c 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:CY1PR03MB2267; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 3:0BPpMUhYiLFo5aPTcbp/044WddVimV055Sb3pQO7q9u2qKgZjmjXyZ2zpNHiY76iUjcJrSlUqgHEq2t6cW2DU3+BvR7DDh8R4XTfKmYdAj5Y5mWKw4rno1cixvIOYqMiQZwiJZfqO5al4etnch75eZYHBkRZ6Q5jpJ1boIFZWomacpJVqFR8Iu87ek8QSz4H5zv66HU7gTa3cM5QvMMlGbeHNn2gn53dyVp9zjYlNd6u7Px8d6uqn8Y29xxpeMFNFIpwLP7fr9PeHLioXVV/z3bzD4kueFyiSp4Oq0d27OekW505qwneXbuDYKsx2mUKCGcXMm3fjRjTsQgHKnr1pBygqYh+DqTYMYLITFOsRqY=; 25:L3q3fIJyAOqRt+0YdQpWsyS52tqixLF4Enao1xQgEc43JGkUxmXazHW2voCHbwjbgGEmU9xafjr7r2p1r2HW7WL+IAw0ywlMFxbG8oMFn9v5qjIGawDxvL22jOWCkVDnP9qSXaMvVs/qtB5uPLiuCeWqbzN9An+dTk+9vdf+2F9vdhiFMC1O+dzPQm/ihpXJD4vsI5LZ6RPC27ZyCuMkjI4GeuQpHBHwDJ4VM7NqYZD/sD0xI0/eGbDftdGWfSbuIBRxwlVQzbovaFYfDBUvburLUXishbsmbDxEVCQlnH3SxJUquZUWE4mkOmU+656pJNsPEYLUxzsl3BBFWZuCTw== X-MS-TrafficTypeDiagnostic: CY1PR03MB2267: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 31:F25UADQTgiUpwSrVD8gxKNDTkw+ZL3wiM0n3buhAWlic+bCsjTuj1FoTeETI75+0uw4HMeYlsPI+cPND5fqPvxKIBvt6h9z7p/kO7DJhvdylFpIKW2su2ZURbc3Zfi1GgdM6NrLZFmhky9WfIXW4Jd2Vk1rGBk2PRXdJQLuMGoJYa0JeAZmDS43ofRcKJaEtNpP18sUkDzyDa7TxKqzpYoCWM+yZmEb30sMgu9d2LkQ=; 4:4cvKbqUNJ7+F8DDZbztpnP8GX5KUTBaPUyB4BZCMGJY2Zg+0Ar2+yv7Y3b2I9fePEhzJIiI9irfMSFkBKe6l74fPCochk0KbQDDCyMOKTYTMzPSh5kVyVd6rJc7ECm0971D5NFVMQgJUeY9z0XzslOqkj/lAYLMnDoGa6XIhiJ5h5FQ1l193PlKgzOB8rAOseDC1xBL1v2uTw1o+G1PQEhjQN/Jc+Ao5T9l0SGBA1Om9Y+dyUl6CBkp8hynHoBy/jk9k3ZF1sHrABgTLBiR31uC8qlXoLruRtKgMQPbrGEA= 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)(601004)(2401047)(13016025)(8121501046)(5005006)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2267; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2267; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2267; 23:U72t76AcYa5bxk8pU89Qu7znpL08Obc/NDBm2hioA?= rfz7kYVzCIx0BwuEfTt1vnI5RE+BWt4Hp2PV55sIoe0LVicC4xmi4nM5gk0EIMjJOi9bpb8+IcyufCRZnQz3fnT0kzFqIRByU1CG5lFLHiFlBh6ujz/t3k6yIux+nmWfrYjHiYR8FJSjwVt3A+uFDEJguKAQWwVadn6imJAJaytCaPuHAEy/kJ1UhYuWa3JbBfzlpMKHyczeigyDJsH8FWuOw42+xrMQMLa4C4hDOuwl2r4RepcqTDbRIOAr97twmR5jk+Ufr3uL73M+TOeEsdTbgSNZTNN/Q2vjvi+WiMziG8Hhk7Jyb+CMaFUeNQjcBu4L9bhF25MYCwxZl6u3VwOXtVHo59miLJnBhNa0gcH9/o5JCWWW7WXPZlzyp/oFcmBhqpPAzwCqlw5xodOHNVa8prY0imbAZRc68Zq5AS09LbHahWW8ZM9k1begZed0b+s3XJuC9Rzw46QH8n7NuRBzMKLJ5WwyUwtg1mED6/d1psr1+TDuzVrjfKzXFgOxu8sR/hI8jwv8U/MESJCH+NIlEgLeMituJds3WkLzghCf5V+QdY6TMIYbKj/J+d2lVqxIBkW9oQoSsFU58f03f6ps6tzE15rQdfUKAk9RgJ0PDdlbDRP+ApjSBTh8vv+5uTIQl7l/XyNFQab4xAy43LRLTDNTmlQqCT29VseI2K6JuxkEvz/gXs7o2Bo+idl4IW1bIKfjynDk8t9Xp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WGQ+OuvdgcibIMFQ489/MMTVcG03RBEzBKwz9W6djVwbEhAJcY+zJpbOv0kCd/R5fXc0VToReUFvJfphRpK001qiweNc/ieFw80jgtSMj3bXQp/eFnpn00W2i1yTkDsFBU8uOKLczA2HB5j1JtCv2eFtOWonjRDyZ9O2gzxyySrGEWAb+XzvS/3LLl1Lt+i3dE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:38.6446 (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: CY1PR03MB2267 Subject: [dpdk-dev] [PATCH 20/27] 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