From patchwork Fri Sep 8 08:44:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112023 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1242339ybm; Fri, 8 Sep 2017 01:46:04 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4MNN5NuGAOcAsPb0ndX9dTB58KdCKb+uF6mKtKJlDFdQHhWkPvxLc/qoDh1u4CRPL2sxqL X-Received: by 10.223.135.252 with SMTP id c57mr1470491wrc.204.1504860364878; Fri, 08 Sep 2017 01:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860364; cv=none; d=google.com; s=arc-20160816; b=WAfHBroiI9k7lf31h9C6djTPNXi+3oFxOYyxPyteyq48Lu80YO8qdn9V51fluUpEON 2NtTyV7am3hS7H6Mdv0eOj8D6oD5h3n025xH28PlJWoBhwe5gc+mXhQnkAgAk+8E1gK5 od6LV81USW9W5fKppL/XUpD8/7MT8G8Q3J7qqy4a4KQ/rj3MfaF2omsO8l6cESr5ij4b SonXMmFIh+ADfwhQzNLByWB11GqApKvJHkaUGhaIJQ5c31F18CQrGbs7wGQxV3EME1qk cNgFoPz4H08Vzg++m1iBobXcY4COQIdzWVHUKPwfQ9PDvN0ObFfLN03NXAeZXK8jHT9u TXUg== 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=357ExG+m4oWFZHVwZdfoFD1fCksMLzZK77z+doiiRZ4=; b=LKRS6M4zb4uUqOjUFUDF4tE17iWMyw+OLiWU6FyQpevmzIASvbC55qlf4AX7nU9Bfb f0auAcO1ezo2OnVW9fF779O1o3L+Ly1PQwZERgX9gq6QtGMdyhNlPRJTwaM6rgUCiokS 2RgyMQSlWA3Q27w7xm2W2eYAFhiSXp8oYZH9rifgskUMuekQ1gx/uMyGScQb8JVVsS+q DZOGUCyOnLzuiEQwTGnDpzReAy2t67fTAeX3l6052Cn/XojPxpmrPvzvibpRywq+NIPk vmpOfjRnTzO9OENxB99IwbVYcekQ/EROSn5dt1d2nremhcvHidpzc2431IikFF34FxtV AZcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id 66si996060wmu.274.2017.09.08.01.46.04; Fri, 08 Sep 2017 01:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 4059F199B7; Fri, 8 Sep 2017 10:45:56 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0044.outbound.protection.outlook.com [104.47.34.44]) by dpdk.org (Postfix) with ESMTP id 2B19B237 for ; Fri, 8 Sep 2017 10:45:54 +0200 (CEST) Received: from BN3PR03CA0095.namprd03.prod.outlook.com (2603:10b6:400:4::13) by SN2PR03MB2271.namprd03.prod.outlook.com (2603:10b6:804:d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:45:53 +0000 Received: from BL2FFO11FD023.protection.gbl (2a01:111:f400:7c09::160) by BN3PR03CA0095.outlook.office365.com (2603:10b6:400:4::13) 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:45:53 +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 BL2FFO11FD023.mail.protection.outlook.com (10.173.161.102) 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:45:53 +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 v888jmoX023063; Fri, 8 Sep 2017 01:45:51 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:14:58 +0530 Message-ID: <1504860327-18451-2-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: 131493339534141640; (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)(189002)(199003)(81156014)(6916009)(498600001)(4326008)(2950100002)(36756003)(53936002)(77096006)(189998001)(54906002)(97736004)(85426001)(68736007)(8656003)(110136004)(305945005)(104016004)(356003)(8936002)(48376002)(50986999)(105606002)(76176999)(33646002)(2351001)(50466002)(8676002)(50226002)(5660300001)(106466001)(5003940100001)(2906002)(81166006)(47776003)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2271; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD023; 1:L5ihSKCqJ4E7D+62AI/DDjmPTpGvBaJQ0GatuTebNoWQAAMRIOHmCpmVKw0+qIh/Jvki89HxrDx5D1rZG4h38uSXhWvgAG4V8BFTLnhfr2q94uGEdRAQz3DEY9KT0Pf2 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 934bca80-a419-406f-c767-08d4f69603b7 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:SN2PR03MB2271; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2271; 3:7E/G9XtuZXPoz0MSE3MYa1hDP0NSb2Vs18Rfj4waHVCsRfZ6k3XyT76OO2Tv8yIiucSDWeQw/5AFUSKrXilOcIGYPUqbHtt5v+r+SaTl2ZEUyOE4oYepNSHd64ipytGUrMIxpI2B9sHynyqhCereoNyycdIO5BAV9kpC+88NRADxbVhD4FXm73VnuRb2Cc3jP/Jl5VnXVD4Y6e+h9QoZjFMKA/nyWZ2WTP1wacb2Pq/3XaDTK+317kzhqJTGc2QXeoB7C3ggi+xwKSMYdCQY5UyhRkOIM5GFch30KMdIARoqv/1yTLt6SCBj5TpzErlOCuY8jiBynN6mc8xZcGbYmRW6LMlSUPq6zvVMkr0Sv1E=; 25:4Ltf2qpSvF6Y+2SKU+p3DNcEks93VmxtPWPNxUP9k/gWQ0ofagxxE5ceCPEATzzt6IBTQ9Ierayi+7z2I6rZd8Yr7wtLGrlLiy+BC8mH9NY0A45xc6DM1wCO+ZsXUNPm1VoHad+m9hHqihMYT2ebxzuJt9+dIbfbdERBIXOtk23vCv1qNEIi/gRn2t2Z3hJpzXQfJqN9cXiCMAnMXFjEdbQWtiF30Ftnk+deKjNVe9V8WNgP1l1w+fuQlFGYIuyxjacQGuqwbrFCimEmV80A+AGcTTzA8WAfc1YkNWtxVMHxwEyHraTt45gXmRPsMsOz59DC/FOwRXj/QsGMqQxIew== X-MS-TrafficTypeDiagnostic: SN2PR03MB2271: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2271; 31:wcciMbqvXULW6DdY69TA54v1j/kyMpfJb804b41c3JPD6RGbwaTpc4wSG8NSen29aJL21fQ5FEUgGQC9bSHsONv/TQEOIT0PeF8P6HgNd/QtT14iyw1582PHfUMFGdgGq12ogKgpOom07wR+TAiq7WucwlR/vQe4zCWtti5FdOmtYkp8TMyb0zLbGB+47sGqZhmtHVOH46QmqSqYnUQl09169cJaGx8FTXKAWkG+U38=; 4:3bUP3zV/+5x5mtpZ+TsQIExwVlDjIyeypMKOd+C83qpKFZk4ymFmhiHDfnuuavbfQziJgC7lwkne3LIUabKZqnngXe+btV5V1eO+jU/ABtjAQx8jTkBZaGywzVM9wVuJX5XuOTC4Qeq/TjDwwKxI2j6bLnxW8GdCHmB9w9YK7IMv0YFRfTDUH6gUdFHjTLBPi4VRD7Soo8cC+ramEoJBWOh/Y2edxXZrbjExaT/R8KuXGG8oJY70m9ce2Sv/8wZH4TGU0uAwtZ9pU3b+7ZsyKIMoSg/nJFJ7VoqBmfu6xbmDIgc3INX3Me2A++MvzdiqqwObJ59DGzAtwV1jMZhPGg== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); 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)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(20161123563025)(20161123565025)(20161123556025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2271; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2271; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2271; 23:F9o9dWzxCDOX/KqPTK6Q5yOvLArSd9lXQ1L/3ZImt?= 9P11wNN4OAdvrvh6tkVQo6Vviyr5/lazo2teVRqV1ZA5SUQ87BSrsEhrb1ekDXp0//y32Cr3sGzyYHnGi7WhnXhf9ZrHoYKQA1sGhZY7ZZHozVboeAtuRMLt0GIA+vIWMp1dVgNKJAd0lVGEV68773DmEfcwshzFpKwqF37lLwWAwfn7pYcVFqRYSzUS8Oikf7xSw9a625W6wrZBKeR35qx7p/7OUcDxE3FioT65RCMsgzsW3td4wXDQKG3NBsJPyjPwpp/j2fCifeGH1JefTwOIjBUEcIVEv073tct4PNShqXrpGAT/rt0dNuZteY78tJwflFAqSLpn0eUgUDw450+UDE9DB7i3tmBbe+IB0FgvkMQuDRG3jsCw5khJNKXJV4mdGlYPhIOs+ckauOZ/8+DmHC8pD6unJv/3jda/92PryJF6AjgRjO99P7Io2gSIsi8xtnZIRQZjWrTw64REAh5hf8Rj9LkgEzcJXM/Q+J1YE/u3SK14s/4JvHZ/DaI8E3k3Ixt3hwevqmXrzr5VNz3vgEVfU8EK2DLBYdZJMGXvYdlUFdz7mlUaZSTAu/IE/ZP2J1GMIX+H8lm6mOcAcE1BS7Ut6slqEq//BbA5Go4NvOEY/fpY+DPb5lDuOAtCx9A6m+32dwh9z9yn+iZ+pBl++oDxSP1REdLNrTjHLAbmXPG3F6fDJqySVXv03Us8OXP2+6GZW7d8x77DP1w7dlQy2l79bXkB35ulfgTk0ic91bcMX5qA2q3A0ed9LGQ5Ns9lL1uX/eyuqpcey63uhd/5Ox1q70sFZkSCtyc6A2itYKQ92NbTK9KJpStpHrq0KZog7OYQl7MuZATljJYKFw2lpFI710xhxiSlYSWMYweqHUAhv94PhxCppswaUAwQCA/+oqroHctQ9toiPtCKOAXU/3gxle8tasgFdjq9yE3UkiaMf2nLeAuiNjNFbFBTHyuaJLn+EJsESJn3ulrkNwgMUZgHa3uxcgTpmNWFkO4WWx64yoYrdtTlUFQGnCRjplQopsix0ndP3+RrW2ALTkkgTZKCUPMx1kRPpn4xeGD7Q== X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2271; 6:WkjKTGnNtNTogh02rDBPs2CtEjGvpEcxDyAYgEO7Qb3pNPMi7BtoQ/6uHYvyaYDRr/rAZYsoFXuYHH/TxKOCfXZ0JQUBhBy2Mqq/F44oH3+coHjkhU8I5JZS6utf0daQeJv04iAIcTlJXf3KB6GSx3rGcG3vSUSaviaPKAPpdx4gdPz7/8ivCLtl/R/TCdCHrsDp5SoGlP433KTrNfcw7M/YS6MVgugRcmepGUuv+NAvI7mP58K/6E//iUH1U3mSkP8txkPnasb6HIFyTdImK4RTXNxH74O9pP+jOD75wuybhxfw4zxM74nqTL6OtRDw/XYCYpCUYoXP/inha2dIoA==; 5:UrBTk/Lua7mr9XpQ4zVC4EUhEdnxenVB4miaclYN2Fq2q2rHN/ZUtOhcAUKB6O05QCsQ/vZBAvBfIsahHsr+bUvCrSAcN99vi3+Ds2r3VRGXUzq2LxEgeobO3MnLHa9MG8OnkAJdy7k+PMENNWpBaA==; 24:0KOYNQ0EZyiOkSpGA3f6ZYBaC96bIgrzUelmaa78rLt9BUQbHixKcPlyfsxrOesNNQoM3aa0TaT06uZnTWH2zEBzgdT+/5H8eUwtV3p4mik=; 7:00wl0jA324pJRvPINGpghBGYhgyNe1K7gFYyhNsItBV3B+RqNqbHy7D10v+m2K3WbeFmAEtzAm0ZK+QZrZbKDZACQV6lvpGRajmz0tpxgD6XcHVVn+9Ib2EUOca23KpWjayNnMDygiuyTjMh/95h5PLfB3LIjHgejCC8b4BrVRd7llVN3vECglFju9VF0RKYCO80NzyjRXM5FtDJaXpxgbulH8fZK9M2LBRRcI/ypJY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:45:53.2425 (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: SN2PR03MB2271 Subject: [dpdk-dev] [PATCH v2 01/30] bus/fslmc: qbman replace word copy with memcpy 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" From: Haiying Wang The word_copy is not as efficient as expected, so remove it from this driver. Signed-off-by: Haiying Wang Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/include/compat.h | 42 -------------------------------- drivers/bus/fslmc/qbman/qbman_portal.c | 12 ++++----- drivers/bus/fslmc/qbman/qbman_sys.h | 9 ------- 3 files changed, 5 insertions(+), 58 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 529f1ea..7b69fd1 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -229,48 +229,6 @@ typedef uint32_t phandle; #define __raw_readl(p) (*(const volatile unsigned int *)(p)) #define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); } -/* memcpy() stuff - when you know alignments in advance */ -#ifdef CONFIG_TRY_BETTER_MEMCPY -static inline void copy_words(void *dest, const void *src, size_t sz) -{ - u32 *__dest = dest; - const u32 *__src = src; - size_t __sz = sz >> 2; - - QBMAN_BUG_ON((unsigned long)dest & 0x3); - QBMAN_BUG_ON((unsigned long)src & 0x3); - QBMAN_BUG_ON(sz & 0x3); - while (__sz--) - *(__dest++) = *(__src++); -} - -static inline void copy_shorts(void *dest, const void *src, size_t sz) -{ - u16 *__dest = dest; - const u16 *__src = src; - size_t __sz = sz >> 1; - - QBMAN_BUG_ON((unsigned long)dest & 0x1); - QBMAN_BUG_ON((unsigned long)src & 0x1); - QBMAN_BUG_ON(sz & 0x1); - while (__sz--) - *(__dest++) = *(__src++); -} - -static inline void copy_bytes(void *dest, const void *src, size_t sz) -{ - u8 *__dest = dest; - const u8 *__src = src; - - while (sz--) - *(__dest++) = *(__src++); -} -#else -#define copy_words memcpy -#define copy_shorts memcpy -#define copy_bytes memcpy -#endif - /* Completion stuff */ #define DECLARE_COMPLETION(n) int n = 0 #define complete(n) { *n = 1; } diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index dd62e9a..f360760 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -480,8 +480,8 @@ static int qbman_swp_enqueue_array_mode(struct qbman_swp *s, return -EBUSY; p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); - word_copy(&p[1], &cl[1], 7); - word_copy(&p[8], fd, sizeof(*fd) >> 2); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], fd, sizeof(*fd)); /* Set the verb byte, have to substitute in the valid-bit */ lwsync(); p[0] = cl[0] | EQAR_VB(eqar); @@ -512,8 +512,8 @@ static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); - word_copy(&p[1], &cl[1], 7); - word_copy(&p[8], fd, sizeof(*fd) >> 2); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], fd, sizeof(*fd)); lwsync(); /* Set the verb byte, have to substitute in the valid-bit */ p[0] = cl[0] | s->eqcr.pi_vb; @@ -549,9 +549,7 @@ int qbman_swp_fill_ring(struct qbman_swp *s, } p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR((s->eqcr.pi/* +burst_index */) & 7)); - /* word_copy(&p[1], &cl[1], 7); */ memcpy(&p[1], &cl[1], 7 * 4); - /* word_copy(&p[8], fd, sizeof(*fd) >> 2); */ memcpy(&p[8], fd, sizeof(struct qbman_fd)); /* lwsync(); */ @@ -799,7 +797,7 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) */ qb_attr_code_encode(&code_pull_token, cl, s->desc.idx + 1); p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_VDQCR); - word_copy(&p[1], &cl[1], 3); + memcpy(&p[1], &cl[1], 12); /* Set the verb byte, have to substitute in the valid-bit */ lwsync(); p[0] = cl[0] | s->vdq.valid_bit; diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 5dbcaa5..9ea55de 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -47,15 +47,6 @@ #undef QBMAN_CINH_TRACE #undef QBMAN_CENA_TRACE -static inline void word_copy(void *d, const void *s, unsigned int cnt) -{ - uint32_t *dd = d; - const uint32_t *ss = s; - - while (cnt--) - *(dd++) = *(ss++); -} - /* Currently, the CENA support code expects each 32-bit word to be written in * host order, and these are converted to hardware (little-endian) order on * command submission. However, 64-bit quantities are must be written (and read) From patchwork Fri Sep 8 08:44:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112024 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1242566ybm; Fri, 8 Sep 2017 01:46:17 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4r+sN1qMUlByFaT9aK2mtpf/lpUzd8x4Brf/pmhHDc54rP47NpIZOni/VjjFI7se6631+O X-Received: by 10.28.214.212 with SMTP id n203mr1006894wmg.10.1504860377605; Fri, 08 Sep 2017 01:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860377; cv=none; d=google.com; s=arc-20160816; b=PIFHFzYbiHeAWWgu3AgNPk2cJT+rceQ6JQh65aR5EhYdwGjdxKwRM3qz1HreMJHD4m 4E9UyhHL6HZuF0LjRp2uqqHnPE1F8tqNlZlz9B70qw5JGGT8aDvv785u+8RjgtCrngLy hwWNuWFXi3KjY2MixgOWYNX3gREcMtY6veTMYC3hubLfHRuGmlqhDUw6IxT2lH8Dn63K /efbpH5sUt+Tul97tvj93lfUxqqvOEYXHWGQAhSjRMWEVRMhm8n2No4p2f1YlGdHSe6w ZBH+/L1bJvNbO+YFjzGWlsDEhBnXvz/HbhNPG/DrwOdAU2gIEwfgAPc1MGvC27TnEXjC zkcA== 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=noD6eNXNuagC1bU4rlXGO+A+36ovy0vt1t93ZwDOtBA=; b=P4ZPNXG8sV2Xewvs9+wJIJr7DzH0T0kNnmmW3ngibo/sAFnJHbb2r1bclONWPsWuAk dxNW4mCtlAGJqAUyLwKyZBUtEi7fA4+F7LLhMX7K6tDiG+zuxv7WxMTcqCDctnwqQPPr QZuNoFLie49PZOkFcyJ6wrCmG5+751MY9eOMNhMcONGdPYVnDKUCyD7+OfAeLQ9UH7AT CLa9uK8kwFv+4wpeNcW+xM0RcYJmkYtHg/ck/mXo8cRafOJwYxrBp5ZeUz6R03hfNAgB mdRM/K9muo4RFKFSpmqGS94agbdGqYvfOrDo5fxqu144DHo6EkmXALcusBaAzfzZgMKb lDuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id s8si1081679wre.120.2017.09.08.01.46.17; Fri, 08 Sep 2017 01:46:17 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ECF477CBC; Fri, 8 Sep 2017 10:45:59 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0047.outbound.protection.outlook.com [104.47.34.47]) by dpdk.org (Postfix) with ESMTP id 91DE4199BC for ; Fri, 8 Sep 2017 10:45:57 +0200 (CEST) Received: from BN3PR03CA0094.namprd03.prod.outlook.com (10.174.66.12) by BN6PR03MB3316.namprd03.prod.outlook.com (10.174.233.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:45:55 +0000 Received: from BL2FFO11FD014.protection.gbl (2a01:111:f400:7c09::166) by BN3PR03CA0094.outlook.office365.com (2603:10b6:400:4::12) 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:45:55 +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 BL2FFO11FD014.mail.protection.outlook.com (10.173.160.222) 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:45:54 +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 v888jmoY023063; Fri, 8 Sep 2017 01:45:53 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:14:59 +0530 Message-ID: <1504860327-18451-3-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: 131493339551147251; (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)(189002)(199003)(2906002)(106466001)(8656003)(68736007)(4326008)(105606002)(2351001)(36756003)(305945005)(54906002)(50226002)(86362001)(77096006)(5003940100001)(85426001)(8936002)(5660300001)(97736004)(50986999)(2950100002)(76176999)(8676002)(48376002)(53936002)(498600001)(6916009)(81166006)(81156014)(189998001)(47776003)(50466002)(104016004)(110136004)(33646002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB3316; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD014; 1:LZMP15zmWrjIAif9Qjodm4HfQF0fNH/tVVNUOZtK93/nlrHD8F+Wlr8hRDtT1BPfruv3N39J1be9sJ3Jm3cBLHGgEpgj4rz/eA2SWlPsJkZzOdWGYpdK8tfnYWgqhK64 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38702609-8b6e-44e5-a4f3-08d4f69604bd 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:BN6PR03MB3316; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 3:KBPy/TMY/gM/KYNlOtJJyafdLpLUTMYQKG+yvAb0BRxf0sXfw8Q+3lsU2fnTGzeThiSeyujpEdv2/ZKC008it8UsLgxakAdympwUIQMi7BYJJNco5mbq+K76IlgNOphkpKfV8aJAyCP19wtDq8oIFAsjK7K8WyNVui6UlB9coqbLyGmh+O4wf/Ms0iYwFRnVD922N7TDG+FT+gSjth7yHmMqnfgrZT6Gb9j0Ac7SnQ2P8jy4QvymZdpWcbky6ZzHxkIKWl1Kq2nu6PNpKyPlUeBxUMzt0Zm9kpLZJEfCHYD0nw/u24m6obm8H5T4/h8vStmLEfxGIhfUG35EdBtFXwd09q7mFzelGXZ1DV6MqsY=; 25:UsMeYEbFYvKwSEto/7a3RacPlDVr8R1r/lKiahBxUIlEQcQJTKXDXGks1R53X45D3T3UaHAorSFGbzzIWn/NAyC4H5hb+3KWAWxoLTMApRetDZqtwm533yEZrDQoJRaLmhJyBf4Sj2hatZ2KZVx8sYjUOXfMoklr76uXiigErvvM4tDv1Fc+LMwc2nYZ6e49fpG5jnM4Fw7gn9PLkqJQjIJtmyH8jhbJo8He6RWaRoRcoGdWQnf9iNdiypOawhnS5yF2tMmmDyKnC18wDeGUU/e+NcgFbdQLo9MDfb4x59G99E1v3wlhSSxB0YzP4Ql+w/b0BGQWzo3WkzkYFLeeqw== X-MS-TrafficTypeDiagnostic: BN6PR03MB3316: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 31:8KP9A86cwup1ZR6Jyuk5vlB+oQrOL54z8l2JcCE5Ou9vYeUieltBUES9xMJWx8KsxM/q/wZXTxKPOaQMbbGGITb+eMKBePJfdAX+tGNrF+Ikj0UnRSO91Cb7jsHE0/R5MtzN7spAx6esYf0Y8fHwo4eVeXtTtOqQX8cLvC8Cig9AMkmXDom/mK6EaGr/iI2Dy2bKRMsAAOQ2fAoCEHlulXnYWVHXkIiBs1rtznwnr+U=; 4:VkluxgeZ+5wRGqXGf8bIQHo+4Qptiaad2rAHcr3GgdM/VKVVAc78dlipccPsemX2CR0cz0QZ/OftODoNUfVkiTyol7bV7nTCC29TKJbr6cfj2ThQQwV6fPAhN5RPwhlSow+mdJgdgj31DM8Gc0CPSRe0G7lFzGUno7jbpLu2yZzKg1kH3Z+cKq1WDUr+vxoDPOYQrkK9uWlrgGT+NaYIAMNYki9vdukhYV4sZps1rE2OIwbKwfZFGTjs3fOhELk4pTnvXsRRf/rnkvV3+/0E2m6OOc4yKAJKkFf/Z9fpfJ1NR8NUNSkSas8B4teHQ3iUIuebLhlWxnhsD7NDl4TKyA== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB3316; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB3316; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB3316; 23:I0Pcemhsdwtj5OnKE7dyh/ZbCz/EJ2fcn2b/fLgCK?= 3BZdNRPXIVpBns7yHMWPbmDn30EmCvqIjUQ7AcFUgJqL9UB7uYdDvFvAIF+a4Q70TpXdvsYG7cvk8vIR8SCvU6rUcxIruST7C2sa/Bwcys4lfoutTKXYdPtgIU9jjjozUDESmSB8luLm2lsGA8jjQSK0pVJgjFg+wM+BLzbUghN5JZPTbcG5RMFmGraB1024ARyY6SBFojvkibT4vlgptPyFaBKmFcNUIYC0O+AZqR2ZQJgQeiHvZ69gd16eTVw2MlJtuBL2Q+hffj8vbBdddywFWZETYSNitpSdkz03t3fckHFiL75Ri9SqLOxVIH26tRKuh4cCDPyItWxte7Z6wqUTrbZYaEb5RLf14aRg1wxZQ257dQtXa7pXrusxeYONSt6WWxjbEp8Yr2vFZVlkm5OI3dk8MNb8mPDV13O5qNJUIR/FGykIwcpugfphTLJ34jTwfPCd4gv9akJktcaEgFoMr63xyB5WSKTIRsYAHS0CeyfZJ13jBa2mak6br09qblAOXr2NK/lTD+ksMBMP5aXF7xY8/PVhxrhl77/Xtw3pxB78Eh6OwyRngGn+sY6UVq6PexwZc6dywoU4PawHeI/yMM2jEb+ZrqKAniSqBrqGuopiFMqQq/R+x5rAcaMBy6g/0GTKsSOj2PhZjc801jUcMhi3i4UXW4Gj4gN5E/XadQRDcKv/V1udZ1kaxQmGwHT2xd8gYOJFKI5wlLNPVYJZQ0F9UrM1w7MAIFUnAMvf1p25eFItwXmOkUljrt2VkBYuBHbKbzIJK7rCLz7gIbzZQwRqLLo8UzaTMThAf9mbziVATjmxQgNF/9hZJ8NUGPl0tyq5ExY7fKJ7hLSzlQYHxklGDZx+nTWROV8lgVGTwA6zkjZ75TQ1OhAamXuYeu6zgjTvf9yAEMk8X8o69aRd18/zNbcr9encdTjfppHvXfLRsOdZpQZhTptn1mqUHxkGFpvH70sq1+LgV6Vhjufq3+XX0vrdW4DLxPRO9u8ges/ZK7hfp/EWXZcYQt6x+O9Bw+zvuynMMS483SHBj3yK0lBFweSL6otIHCaZagXxw== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 6:mAKZqWUbHf13vMXWyAm9TrrlRyoT5X+Q/MIh2WNM4VXo3HvSvuzEMQK9c0NHyj0+lQvwumCePUsk0LiNv94CqQ+c2u2LRcblV9It6ATsTIC56k39/upCAlHqHf4rxOof2yJSvC322I5A6uX1zO7LhF34DGiXW1XzWLN46M+pVFWD1Q6NbOtK4/xpfKNtHbTd6fIcOlI7iHaLr1FGzEe0vTiPAPtHlnmsdEw8Zf2TVQ+9npHalLskXLfZ4v48pe5Th0K360U8cvGltxjN+VwwkJHgyZNRopccx2HCQ5xAlVHuGbZb2CQuniEGfShq3yiZPFCTj39ZtoggsLdFEQGK1Q==; 5:9kYYxTu/esbhb5lpQz/OsMcBHoEgdLm6ONHzkocPWj25JCt9jKhhiY7SwrcO+Fec4Jy8q+VUpQaXbBcb7mehC168980QdE8SCj5Kp6dyMkOBgG2JlksPhf05yWb0GMRWFxRCbCTwF9I8pzuCg4lR9w==; 24:pYmXVTd7Oy2CBniEkwtSXRhm3iCFfSg90IVmj5Sp4YN+lE5wEb1/a8fVpe1iiIK0kIzw7uSDQLUjkV6M+AB75gn0ZVEJYKVmEg20lD7rPc4=; 7:cnHI9a1vWfdJIfXzKNXezMS/o9s4TfXRXEfRfAPS0SikBxRL5aVhHDad7X016OBWT0Fo+60+S6ypfzmN5QnlYnaZW4wFZ7S3T52Tszns7YCe2iX3SRuogE0aUPA/bkzS5Fkcs6RJdMn9BcMgQ3KBFh7LsmWlmT1nZGO/rvLe5YyqZPTaJiEKFwsF/fMGIuIeJNb+HiENP92QN5WTwu4jcZct88BzftnzbzbPnIkWgAM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:45:54.9587 (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: BN6PR03MB3316 Subject: [dpdk-dev] [PATCH v2 02/30] bus/fslmc: remove the export for qbman version function 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" This func is not required to be used outside of the qbman driver. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/include/fsl_qbman_base.h | 4 ---- drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 2 -- drivers/bus/fslmc/qbman/qbman_portal.c | 7 ------- drivers/bus/fslmc/qbman/qbman_portal.h | 1 + drivers/bus/fslmc/qbman/qbman_private.h | 4 ++++ 5 files changed, 5 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h index ee4b772..1415960 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h @@ -38,10 +38,6 @@ typedef uint64_t dma_addr_t; * */ -#define QMAN_REV_4000 0x04000000 -#define QMAN_REV_4100 0x04010000 -#define QMAN_REV_4101 0x04010001 - /** * struct qbman_block_desc - qbman block descriptor structure * @ccsr_reg_bar: CCSR register map. diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index 9e9047e..23c3d13 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -1132,6 +1132,4 @@ int qbman_swp_send_multiple(struct qbman_swp *s, int qbman_check_command_complete(struct qbman_swp *s, const struct qbman_result *dq); - -int qbman_get_version(void); #endif /* !_FSL_QBMAN_PORTAL_H */ diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index f360760..97df703 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -105,8 +105,6 @@ struct qb_attr_code code_sdqcr_dqsrc = QB_CODE(0, 0, 16); #define MAX_QBMAN_PORTALS 35 static struct qbman_swp *portal_idx_map[MAX_QBMAN_PORTALS]; -uint32_t qman_version; - /*********************************/ /* Portal constructor/destructor */ /*********************************/ @@ -1579,8 +1577,3 @@ int qbman_swp_send_multiple(struct qbman_swp *s, return sent; } - -int qbman_get_version(void) -{ - return qman_version; -} diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 7aa1d4f..8018048 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -29,6 +29,7 @@ #include "qbman_private.h" #include +uint32_t qman_version; /* All QBMan command and result structures use this "valid bit" encoding */ #define QB_VALID_BIT ((uint32_t)0x80) diff --git a/drivers/bus/fslmc/qbman/qbman_private.h b/drivers/bus/fslmc/qbman/qbman_private.h index 292ec6a..b98c330 100644 --- a/drivers/bus/fslmc/qbman/qbman_private.h +++ b/drivers/bus/fslmc/qbman/qbman_private.h @@ -171,4 +171,8 @@ static inline void hexdump(const void *ptr, size_t sz) __hexdump(start, end, p, sz, c); } +#define QMAN_REV_4000 0x04000000 +#define QMAN_REV_4100 0x04010000 +#define QMAN_REV_4101 0x04010001 + #include "qbman_sys.h" From patchwork Fri Sep 8 08:45:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112025 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1242782ybm; Fri, 8 Sep 2017 01:46:28 -0700 (PDT) X-Google-Smtp-Source: ADKCNb67Xb8Xo91FQgXjDwXGIZRPL2NuDwFM+flTJB0oxnKnXWQ+FHL5vkVMQpTsUBUCr1H3E1mA X-Received: by 10.223.186.130 with SMTP id p2mr1355893wrg.47.1504860388379; Fri, 08 Sep 2017 01:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860388; cv=none; d=google.com; s=arc-20160816; b=tbcDX09mnQgr2rOCMv6nW4clf0gr4Ws1SVFwh+KkZheBPlVq5myCt8A4jLuNmgtwjK ZxJohcl8nzLXU86OZ2+POxfFVSeDYmF2fSAkIPEWDsDhkvzvTMwjfqOx4uZkoooyjav9 Fz7vwHBrhvxeK6BHGS1FFuMUGP87aYzw8PvU/JGu4zTQpt/le8uInNZl9A7wzpOrUmnT UUtTyNwCGZaNAo9ier6bp+p3igUbML+Oq17eUMxM/cukCrpBEI5TvnaSJlmuNQu8xYJ4 vQD/Grb5sB2ICPZgQPT0j8/YIqkU7xWlPf8W4/wGqVx/oEvEgeyDLEe1ZiYQtURRtk88 nDPQ== 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=T+AeHQS+nzkgRGzh2aSeyds13Sq4qKUkHzK3UHQlfUs=; b=kyzthkdo1MSfHLwjXMKtCDMKisNyZA5n2fINWOo+AKExZUPNLYrpc7a3k1P9OvAoR2 PxxSgOmCI/f+y7xn19/0LiwOlWd0upWxGdgGgYXzwyk3dnEGAPTf5QUFsZl8M17PWphr ZbguNew99I+cNV0200CMhUhj+sSHPWHfUr4dgySyBgf0m0f6uloTJrEqQqVHwjV4A4kH 1EDt/WHJwN62ND7XFWnjXF3z32EaxHxV5UTBjFEZrnoHm9W4GBJMLWmAl4ghzGB7PEo7 gAbuY/6xItzx2Kp5gxS/xR4DWI0mtEUuSM14r5b0yJ9JOtbAnWCYieDSJq6G1aUHRqZ1 LK9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id 31si1098623wrf.176.2017.09.08.01.46.28; Fri, 08 Sep 2017 01:46:28 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 068DC199BE; Fri, 8 Sep 2017 10:46:02 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0064.outbound.protection.outlook.com [104.47.37.64]) by dpdk.org (Postfix) with ESMTP id C0ACE237 for ; Fri, 8 Sep 2017 10:45:58 +0200 (CEST) Received: from CY4PR03CA0006.namprd03.prod.outlook.com (10.168.162.16) by CY1PR03MB2266.namprd03.prod.outlook.com (10.166.207.18) 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:45:57 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::148) by CY4PR03CA0006.outlook.office365.com (2603:10b6:903:33::16) 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:45:57 +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 BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) 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:45:57 +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 v888jmoZ023063; Fri, 8 Sep 2017 01:45:55 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:00 +0530 Message-ID: <1504860327-18451-4-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: 131493339573136414; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(48376002)(33646002)(5003940100001)(50466002)(5660300001)(68736007)(189998001)(106466001)(2351001)(105606002)(47776003)(36756003)(498600001)(77096006)(97736004)(2950100002)(6666003)(2906002)(8676002)(81166006)(53936002)(6916009)(8936002)(54906002)(356003)(85426001)(81156014)(104016004)(8656003)(305945005)(86362001)(4326008)(50226002)(110136004)(50986999)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2266; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:VqGOA+zVCDejVOqDStNsIQN2Cp+wJ+sKPYsxqNkGOjDsLB3hgTaOucgkqs6qtN4/I3S3VfCWDtgK1gCtoaGT2doLRcmCKMIbwBHce+YK3Ut/loeq6lavsoetJ+naa/xm MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eeeb716f-cc28-4629-2116-08d4f69605fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2266; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2266; 3:kK7T0q9HL0VgE/bLDsMlPNlz/fjjGJBS4ztQSfhCCb3947Pk6JxbGdEIys8VuyEH8487FDDbYyPOrGUzMehstQbTF5BgptjUo87B3JkGgx7EaYJ27O1qgrj4nkVZy/JCVeSI8W40qtbG3gxbvUf6hlSwLxFYXfev/JcQOnfaRcmaiylS1XG/Ish1PMLg0TR6+ITUZWoYprGRz76BzS42Ce/EVnDNvW+iKxaYyHSBNRBzgu4pdrIbK75hXatUtxVSCG8wgPagNS0aeFo74jobESU0R2OiKd3Fwj1EMGNdTGAvSE6jS8ZbWNPo7YVLXThFFZqIoauathXwvW7ADOtSuwrx/I7B+tzh30bs2m/KgWk=; 25:Fnzz+gYAD+3nmcwF1c1htwVCTcw+rZ76CiUxPsbXZhTHycgTwxJ1/erUIFswgBSdtQt57wZjNYKkH0/mlAyZcXnImdB0a5SIxIwIxDgvdVp7/6KXuETjfQqO+1dTEnvzcFbllPhz6QX54zo9DUEizryJBITMT9OLALz4is1SsDE3dmdjDsrcfmKhIHpCZDzSWndwObqYXmL57GeEuoXEo4BUhKTJemIdTv/ZogcDyVN2lt+5C2ui9Ghf+ij6nGMBtWVF2/IeX6lu+Cy44GzjAfW1C/AunyAzpvkTDCyMIO9NrLr+dFZ3Grj4xkgN3W8Ty8KWbWj7Alqyl8vuF6gSOg== X-MS-TrafficTypeDiagnostic: CY1PR03MB2266: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2266; 31:tAIiISqkq2TyMwr3/P/1S5lEN08vPb9MQ5j90/XrR6PfmC9wXOcOxbaqFK11sHkVxV/rsc40c+KwpkFg0xqY6oLN+3K/GQkaaACXinmVEUOcHW9P3vNya0Ycd7vRVcO3HpD0z1m2BdhNtdK8LGKlYfqBBRl4mAuK3Y4x5g9Oa32vu10VOAnOe8MgNNAog4d0l01sTHe/WoPpQA3hjvB2dzVRF91Nth0SujXD7LyptO8=; 4:pzmRY9jzPQAQB5Th9Ux5cYiOheu1+PvbhWACR0jJOrneC2fB3vfHTdtsKFVLuspOADMcK8/ogSY2fd0EYmMZZ5IDAGPIY0vJOu5z05Cc9I5qolDbS6e9L+M2H0F2hxGwrM77iB9WYQn9QQUOdZ6+7EdrtXGoQPhEIWGbwEVtMpB0C0VtAUO5HRkrSU4DjCWO7qyQ7YrTcvnHfPYgW13mVSzRpb5eM2h+jbeQC6wgESY28h++9pwi1fGDqvsg65MINtYVBFZckDXhNs6G+qcE232oBHXHjZYnG+eGxhEGe0oDa9fwuLy0070lxhrbR2JuOrXHnytZNAzBC3/3ezi+DA== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2266; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2266; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2266; 23:vxPg6ygCXKpi8sjfLR70oIJaBosL5Mug0drNJogZC?= mLo0U+m2MX7pTDJqCMh89ig80X3oYtf5oqLli//ivEcXI3ZmJP6KfydNTHwyKXRilN7o96zIO1yBhRMyXB4dnSthM/rV+jQlfU2atvrWgEjaQqVISRpe2fYpejerOF+94YmKASzHhzrHHRap1vz3hGlmLVHRlIBz+OD5b8d6vivgOEHxMbKk51Ux7DBFcXkF9FKzeutTjQQMEUfahwLeox8CA0wsLd6hT2EuAVkwHZEr0AJGx1nxvSLIgCadgeuzvQUTPlS9B893c2tBGvRsKCP9cHH25B3q7Tg6URm0Zg45XXGviOii/qrWMW26eM63jhuWw2p09Hjyey/Enbbeb6/ey0Sxjy3hkgfwe0gy7SZXXXGnn1IxdpAyvmRmDYoSs+1tjBe3TrjmBMpejU7BM/rWKos9x5lXR1UhGZrWYTT9vZmolXlM/5W52w3ukBMfV2mA5fSXoDE1XXVVCKfAty44TPrVlI/rD2uF76YR5ccgwGX/CtRGVJBQKFYhzqm9ErFZtwMFGs9UXsqjAisYqXV63N0ebapfi4atOIwLUzuuatiYCrXYEuFg7V97Zn8Nv8iXWJKvFFYfmctmDktyXvmgI3+V5V09V5LtOvoQPQw4t21wj8yJ+wyjG2WN+xE7LpCieaDbMVCr/nII6LomVWAWaFGDywxD4wg1GDj9eTQAhN5eHfh+kTKkrAVZqCAew6WeLZ84eWVN/P6AnpYpzQ1SLaatUOJAiI5dcuoDAytGWf9+MGp76/OITtu9g4glZ9qjBO0CW/cOpiI2rWLExREkPXa0aiYEHcGHVK8PCMoQ/ds88heTjvcSaIQAUHZL//yFd00ftA+uzD5PG5hUoj7NzMo8cB0BwizxctFwQTOu8rhhIbaLLx5VqzK6s7YanNFrqO9hNHcXlvqXJSmXlUByFdXRLq6y0fCmh1O23QeB6yVK8N1lLxGSkNkPBdsbxjbS8HddJ12RXpy4Hls7U8W3BdBxEyeAMwjE2xfzTQ5hOmJX2Ijda1vlwrUHlOqne7NrBwfaziF+b3nO9NuNsGrF+GZ7SQqU3estltPq3NowecXLxVuOzm+b/Yhqvq6UiA= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2266; 6:bPWDtvWAl9EQSozkaXW8PH5MEKUjbzfLpXEuy1v3H/ArC3VTIjYszdOhD+FSPmynHwZcOiUk/G0p5cn4l+Ki0NTerQKBcebErFwMQYLOOk6ac5BARa2Ya1kBtbnkKT5VzLKCE5NCATapEwnDL7tyIN92BzFymmx942EPZJ4LCqi+EfYw1kvflg8ueEhL6ESjVG3yeGvKsvmDF3jJmC+ToYTO2HTb+4kBrk3ifhNh7tki1ORciM7A0KqDSzG8s2JR2B54OwCJRKR709kNaQqtW/w0pfUSLa/TdmOt9rxt1yzul8dxhLqRePj3NT8elo20Hha48/fNI99fqDXqwL2Msg==; 5:C114ebQZ7aQE+rAwhkvJw3EO2l/aFMZMcEpmTZjSYTt7+nmDkhaAYblwcZpgbP6HuYNcvtdHAF1QFi59e2VBo0VPMpbaBDt7p5wRUGc885RpueI9d6Cg+ZWgeukJLaWEvJF6a22Be2HFcbBtEVPYvg==; 24:smiGG23TA/ZoQDqwxcXlguJu74IPKvMwbTT0OC8fbNh+ufQQ/pt/jUxKl9f/rVoA51kKT7IU2J6YAmbuXFUlCTa4zk3cUKTDEq6Bjsb1S8E=; 7:tyJNJ+K8BHYQLpjAitPgwaRQ6hA6yvz30fldxcig1Ke4y7ij0pPA7VV596wEL1nbX2W33bP4GYSh3vjOuzhG6r2v+0GJK6nfvA6NhrBbhV9Vm9lXS9KqodoOqkdFBRT2k6N/wOCC1OHMAVfa+cn0Fo95twyRMp/1XBxbrthEKP/LSQa9quF031viXts/q/9Wexrqqo+5oSl0x/HM8KFAu7ptv1WpFV0cSZVBNxDUGT0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:45:57.0016 (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: CY1PR03MB2266 Subject: [dpdk-dev] [PATCH v2 03/30] bus/fslmc: add qbman API to do enqueue with multiple frames 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" From: Haiying Wang Clean it up and update the prototype. Signed-off-by: Haiying Wang Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 32 ++-- drivers/bus/fslmc/qbman/qbman_portal.c | 200 +++++++-------------- drivers/bus/fslmc/rte_bus_fslmc_version.map | 3 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- 6 files changed, 83 insertions(+), 158 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index 23c3d13..fe1cc94 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -914,19 +914,33 @@ void qbman_eq_desc_set_dca(struct qbman_eq_desc *d, int enable, int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, const struct qbman_fd *fd); /** - * qbman_swp_enqueue_multiple_eqdesc() - Enqueue multiple frames with separte - * enqueue descriptors. + * qbman_swp_enqueue_multiple() - Enqueue multiple frames with same + eq descriptor * @s: the software portal used for enqueue. - * @d: the enqueue descriptors + * @d: the enqueue descriptor. * @fd: the frame descriptor to be enqueued. * @num_frames: the number of the frames to be enqueued. * * Return the number of enqueued frames, -EBUSY if the EQCR is not ready. */ -int qbman_swp_enqueue_multiple_eqdesc(struct qbman_swp *s, +int qbman_swp_enqueue_multiple(struct qbman_swp *s, const struct qbman_eq_desc *d, const struct qbman_fd *fd, int num_frames); +/** + * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with + * individual eq descriptor. + * @s: the software portal used for enqueue. + * @d: the enqueue descriptor. + * @fd: the frame descriptor to be enqueued. + * @num_frames: the number of the frames to be enqueued. + * + * Return the number of enqueued frames, -EBUSY if the EQCR is not ready. + */ +int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames); /* TODO: * qbman_swp_enqueue_thresh() - Set threshold for EQRI interrupt. @@ -1119,16 +1133,6 @@ int qbman_swp_CDAN_disable(struct qbman_swp *s, uint16_t channelid); */ int qbman_swp_CDAN_set_context_enable(struct qbman_swp *s, uint16_t channelid, uint64_t ctx); -int qbman_swp_fill_ring(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - uint8_t burst_index); -int qbman_swp_flush_ring(struct qbman_swp *s); -void qbman_sync(void); -int qbman_swp_send_multiple(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int frames_to_send); int qbman_check_command_complete(struct qbman_swp *s, const struct qbman_result *dq); diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 97df703..f212829 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -525,15 +525,26 @@ static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, return 0; } -int qbman_swp_fill_ring(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - __attribute__((unused)) uint8_t burst_index) +int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, + const struct qbman_fd *fd) +{ + if (s->sys.eqcr_mode == qman_eqcr_vb_array) + return qbman_swp_enqueue_array_mode(s, d, fd); + else /* Use ring mode by default */ + return qbman_swp_enqueue_ring_mode(s, d, fd); +} + +int qbman_swp_enqueue_multiple(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) { uint32_t *p; const uint32_t *cl = qb_cl(d); - uint32_t eqcr_ci; + uint32_t eqcr_ci, eqcr_pi; uint8_t diff; + int i, num_enqueued = 0; + uint64_t addr_cena; if (!s->eqcr.available) { eqcr_ci = s->eqcr.ci; @@ -543,62 +554,58 @@ int qbman_swp_fill_ring(struct qbman_swp *s, eqcr_ci, s->eqcr.ci); s->eqcr.available += diff; if (!diff) - return -EBUSY; + return 0; } - p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR((s->eqcr.pi/* +burst_index */) & 7)); - memcpy(&p[1], &cl[1], 7 * 4); - memcpy(&p[8], fd, sizeof(struct qbman_fd)); - - /* lwsync(); */ - p[0] = cl[0] | s->eqcr.pi_vb; - - s->eqcr.pi++; - s->eqcr.pi &= 0xF; - s->eqcr.available--; - if (!(s->eqcr.pi & 7)) - s->eqcr.pi_vb ^= QB_VALID_BIT; - - return 0; -} -int qbman_swp_flush_ring(struct qbman_swp *s) -{ - void *ptr = s->sys.addr_cena; + eqcr_pi = s->eqcr.pi; + num_enqueued = (s->eqcr.available < num_frames) ? + s->eqcr.available : num_frames; + s->eqcr.available -= num_enqueued; + /* Fill in the EQCR ring */ + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + memcpy(&p[1], &cl[1], 28); + memcpy(&p[8], &fd[i], sizeof(*fd)); + eqcr_pi++; + eqcr_pi &= 0xF; + } - dcbf((uint64_t)ptr); - dcbf((uint64_t)ptr + 0x40); - dcbf((uint64_t)ptr + 0x80); - dcbf((uint64_t)ptr + 0xc0); - dcbf((uint64_t)ptr + 0x100); - dcbf((uint64_t)ptr + 0x140); - dcbf((uint64_t)ptr + 0x180); - dcbf((uint64_t)ptr + 0x1c0); + lwsync(); - return 0; -} + /* Set the verb byte, have to substitute in the valid-bit */ + eqcr_pi = s->eqcr.pi; + for (i = 0; i < num_enqueued; i++) { + p = qbman_cena_write_start_wo_shadow(&s->sys, + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + p[0] = cl[0] | s->eqcr.pi_vb; + eqcr_pi++; + eqcr_pi &= 0xF; + if (!(eqcr_pi & 7)) + s->eqcr.pi_vb ^= QB_VALID_BIT; + } -void qbman_sync(void) -{ - lwsync(); -} + /* Flush all the cacheline without load/store in between */ + eqcr_pi = s->eqcr.pi; + addr_cena = (uint64_t)s->sys.addr_cena; + for (i = 0; i < num_enqueued; i++) { + dcbf((uint64_t *)(addr_cena + + QBMAN_CENA_SWP_EQCR(eqcr_pi & 7))); + eqcr_pi++; + eqcr_pi &= 0xF; + } + s->eqcr.pi = eqcr_pi; -int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d, - const struct qbman_fd *fd) -{ - if (s->sys.eqcr_mode == qman_eqcr_vb_array) - return qbman_swp_enqueue_array_mode(s, d, fd); - else /* Use ring mode by default */ - return qbman_swp_enqueue_ring_mode(s, d, fd); + return num_enqueued; } -int qbman_swp_enqueue_multiple_eqdesc(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int num_frames) +int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, + const struct qbman_eq_desc *d, + const struct qbman_fd *fd, + int num_frames) { uint32_t *p; - const uint32_t *cl = qb_cl(d); + const uint32_t *cl; uint32_t eqcr_ci, eqcr_pi; uint8_t diff; int i, num_enqueued = 0; @@ -623,29 +630,26 @@ int qbman_swp_enqueue_multiple_eqdesc(struct qbman_swp *s, for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + cl = qb_cl(&d[i]); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], &fd[i], sizeof(*fd)); eqcr_pi++; eqcr_pi &= 0xF; - /*Pointing to the next enqueue descriptor*/ - cl += (sizeof(struct qbman_eq_desc) / sizeof(uint32_t)); } lwsync(); /* Set the verb byte, have to substitute in the valid-bit */ eqcr_pi = s->eqcr.pi; - cl = qb_cl(d); for (i = 0; i < num_enqueued; i++) { p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_EQCR(eqcr_pi & 7)); + cl = qb_cl(&d[i]); p[0] = cl[0] | s->eqcr.pi_vb; eqcr_pi++; eqcr_pi &= 0xF; if (!(eqcr_pi & 7)) s->eqcr.pi_vb ^= QB_VALID_BIT; - /*Pointing to the next enqueue descriptor*/ - cl += (sizeof(struct qbman_eq_desc) / sizeof(uint32_t)); } /* Flush all the cacheline without load/store in between */ @@ -1493,87 +1497,3 @@ struct qbman_result *qbman_get_dqrr_from_idx(struct qbman_swp *s, uint8_t idx) dq = qbman_cena_read(&s->sys, QBMAN_CENA_SWP_DQRR(idx)); return dq; } - -int qbman_swp_send_multiple(struct qbman_swp *s, - const struct qbman_eq_desc *d, - const struct qbman_fd *fd, - int frames_to_send) -{ - uint32_t *p; - const uint32_t *cl = qb_cl(d); - uint32_t eqcr_ci; - uint8_t diff; - int sent = 0; - int i; - int initial_pi = s->eqcr.pi; - uint64_t start_pointer; - - if (!s->eqcr.available) { - eqcr_ci = s->eqcr.ci; - s->eqcr.ci = qbman_cena_read_reg(&s->sys, - QBMAN_CENA_SWP_EQCR_CI) & 0xF; - diff = qm_cyc_diff(QBMAN_EQCR_SIZE, - eqcr_ci, s->eqcr.ci); - if (!diff) - goto done; - s->eqcr.available += diff; - } - - /* we are trying to send frames_to_send, - * if we have enough space in the ring - */ - while (s->eqcr.available && frames_to_send--) { - p = qbman_cena_write_start_wo_shadow_fast(&s->sys, - QBMAN_CENA_SWP_EQCR((initial_pi) & 7)); - /* Write command (except of first byte) and FD */ - memcpy(&p[1], &cl[1], 7 * 4); - memcpy(&p[8], &fd[sent], sizeof(struct qbman_fd)); - - initial_pi++; - initial_pi &= 0xF; - s->eqcr.available--; - sent++; - } - -done: - initial_pi = s->eqcr.pi; - lwsync(); - - /* in order for flushes to complete faster: - * we use a following trick: we record all lines in 32 bit word - */ - - initial_pi = s->eqcr.pi; - for (i = 0; i < sent; i++) { - p = qbman_cena_write_start_wo_shadow_fast(&s->sys, - QBMAN_CENA_SWP_EQCR((initial_pi) & 7)); - - p[0] = cl[0] | s->eqcr.pi_vb; - initial_pi++; - initial_pi &= 0xF; - - if (!(initial_pi & 7)) - s->eqcr.pi_vb ^= QB_VALID_BIT; - } - - initial_pi = s->eqcr.pi; - - /* We need to flush all the lines but without - * load/store operations between them. - * We assign start_pointer before we start loop so that - * in loop we do not read it from memory - */ - start_pointer = (uint64_t)s->sys.addr_cena; - for (i = 0; i < sent; i++) { - p = (uint32_t *)(start_pointer - + QBMAN_CENA_SWP_EQCR(initial_pi & 7)); - dcbf((uint64_t)p); - initial_pi++; - initial_pi &= 0xF; - } - - /* Update producer index for the next call */ - s->eqcr.pi = initial_pi; - - return sent; -} diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 6ac256d..13fb46a 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -69,7 +69,8 @@ DPDK_17.08 { qbman_result_SCN_state_in_mem; qbman_swp_dqrr_consume; qbman_swp_dqrr_next; - qbman_swp_enqueue_multiple_eqdesc; + qbman_swp_enqueue_multiple; + qbman_swp_enqueue_multiple_desc; qbman_swp_interrupt_clear_status; qbman_swp_push_set; rte_dpaa2_alloc_dpci_dev; diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 95c3951..094cf30 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -634,7 +634,7 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, } loop = 0; while (loop < frames_to_send) { - loop += qbman_swp_send_multiple(swp, &eqdesc, + loop += qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], frames_to_send - loop); } diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index cf2d274..81286a8 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -144,7 +144,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], } loop = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple_eqdesc(swp, + loop += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop], &fd_arr[loop], frames_to_send - loop); } diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 3c057a3..4342c73 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -622,7 +622,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } loop = 0; while (loop < frames_to_send) { - loop += qbman_swp_send_multiple(swp, &eqdesc, + loop += qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], frames_to_send - loop); } From patchwork Fri Sep 8 08:45:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112026 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1243120ybm; Fri, 8 Sep 2017 01:46:44 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6Mx37o5uXgOo51bzre6Wu2ZBVTCXH1f9+eFsSmjiGIlt1xpqMmH6PY0kGAPDXcOZUWCm2+ X-Received: by 10.223.143.105 with SMTP id p96mr1405863wrb.118.1504860404848; Fri, 08 Sep 2017 01:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860404; cv=none; d=google.com; s=arc-20160816; b=y6oBpECsvwLudkblzvY3f24X3K/WJNyNi476pBSeATRLOwIJ0wARpMMv/wnnZvsA5y Q8J/Pk5BQuvzjD4282XeXY+BEUNt5aQG/tBkdi2UZOPOp/4WqywBO5HCn+fbBy/09Elu 5ejYk9W2BhVPHwGPj+gpdK+xiZPgCTERGLDldqXDgqSiuBYt9MaxLWulmd50rc7gEyDG 7f8KHw9UEgCuvQNUEw0E+nDLHhhQaeU/SHsmqLBTAZJT/Gp5IkeRrR7LGnO4swP6ERXL +FeqWZL0GS9XsdKilBnamsiK51Wqa0er63f1nVQABYccwlBtoiELgJvZRy2+xR9Qpy6s qc3A== 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=SWvAvrspl38Jzdn7HKSJPsrkwO4Khrl3FEhTTRwPyPc=; b=owxBcy4rDDbJiHqZexjN7h5++wrKGStV23luvMyqoFtetFMf8H1jJUlpnVkF+UqnoH 3K1S3livhJaoamvQ9+Pkasj534fHdNyrUI3Sqi81hHU0/PpMc8cWmVcRpdSZN0vU6NnJ Vd9UmYeeJgkP345tR5irO/tUHCQ06hXqUqA+LEdYY3U1EdP3XIdQWWgjXoNCWqWBqsD9 DWZzKsY6/dDFlt8r74yxEQvbF02sekOus3XB5jjvdQoS6n+HXzDtv9Qz1NMCHQ7IRnU2 qOCDsMxC6Zbe3G4JUVjFudy+dqafA/GSi1uKzN9QaGmyIUqRPplgJPci3v5HpcNKcPqz +7gQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id q110si1118815wrb.132.2017.09.08.01.46.44; Fri, 08 Sep 2017 01:46:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 603D9199CD; Fri, 8 Sep 2017 10:46:04 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0042.outbound.protection.outlook.com [104.47.37.42]) by dpdk.org (Postfix) with ESMTP id 44175199BE for ; Fri, 8 Sep 2017 10:46:01 +0200 (CEST) Received: from BN3PR03CA0110.namprd03.prod.outlook.com (10.174.66.28) by CY4PR03MB3319.namprd03.prod.outlook.com (10.171.247.10) 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:45:59 +0000 Received: from BN1BFFO11OLC001.protection.gbl (2a01:111:f400:7c10::1:142) by BN3PR03CA0110.outlook.office365.com (2603:10b6:400:4::28) 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:45:59 +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 BN1BFFO11OLC001.mail.protection.outlook.com (10.58.145.12) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Fri, 8 Sep 2017 08:45:58 +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 v888jmoa023063; Fri, 8 Sep 2017 01:45:56 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:01 +0530 Message-ID: <1504860327-18451-5-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: 131493339589723741; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(498600001)(54906002)(50986999)(76176999)(110136004)(53936002)(33646002)(105606002)(106466001)(5003940100001)(2351001)(2950100002)(2906002)(6916009)(6666003)(77096006)(36756003)(50466002)(48376002)(189998001)(4326008)(5660300001)(8656003)(356003)(50226002)(85426001)(305945005)(86362001)(8936002)(104016004)(8676002)(81156014)(81166006)(68736007)(97736004)(47776003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3319; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC001; 1:lgQ3jqc1F+p1YYr29jV/1DPU+Y52u1hXzByyUjFukXzfW5fJWR49t0zIUJSTiaxuxZBFBxQuULqgC/9rXmBdTqyUqkLapkZyGNSkM1PeIRsgOZIXJ5ll0vzt+ARpPcVX MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c026edb6-c18c-4e60-e4fe-08d4f6960707 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:CY4PR03MB3319; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 3:eMh4Flks2np2o8zDjreS9KxvKyQRe7IODxAI3+cw5BoQZ75aJJVVjvOsZbNqDh4eP+FNPoM1w87AmZ5aN794HcjNX2tDgh4dVMDsbuyxIL4F8oZkTC34vcjP/g9nHliNxPQXAYtZwENhDDS5Qek7K0hioUv/9Oxcvh+jVwcFhq3TemLueDFg929teDe+FDfvp78WLqtmE0Dil/OwBR6M4jrr93kQBJ+SIh5m6P40Wv9fkvGW8jU+5AIWkndEPhfkmRsUXKjaCzp/1QKfxqNuK+fT+vm2DSwc2izQperKgEZwAc02FqYk+w1zqUirlscMjxEGZouMbmwFq5s/8tAOy3daob3HG9lATYeR9ikey3A=; 25:kX/AdEYFQ2ZAH4wVYpcpf7/uAPATTEC0rekvVxBC7tewUPCs0lydVM7vdmZqaKGt/XG4j0G1Vkg4q3q/sCf+lyOMZcTud7njXjizs3XgOenLQ7HQS2uTBG26bwXwNsTQ+QdiyUwjCJ9X05FBrxJ0B/9/MugsKWOcab/zDQMzCu8vD2ZYpU/ehgnnl3wyj++X6egahh83EcWVM3XIyr7FUgssw6DZvMB41gAr5Dyx+boXl2Zjitg/yWRcQ39xFprhqEgCYQGU4c8GcbLhiZ/xG3seNRlYt5Z4VJn2MObzVulniWyBLm0MpkGJ3VAsbb7p8ndywbdHp0Csaazm1dEpZA== X-MS-TrafficTypeDiagnostic: CY4PR03MB3319: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 31:ZBOZfRz61m9iEHRlPDNH9KcC8XjojJvgbGgZC2olpOtwvUjNxyYS83ZGDRBZFHZLO+yfEuasGuyrZ0pfFhg7/4Ov5CgC8MaL5m1d4cFI5kPmN025CVnXcDSkqIzppQuHh2jxZP+qV/s/d8WX2ipza9KbADxIlkDZEEpMU+vIkiaT778DObhDgJbkKOf9DSytyWFIYSpE6F4KPnd4HUzMf3eCaqPIKXDfYr7uVZzUeIQ=; 4:g5Yl2jxAUdI9SZKEKLDdB5prLkbcvzyd+GOjTUxEREQScWWGvuQBMpoSCT2jHA/Jzi0wyNe+mdPS9ATU1UT3DtQDbMGGTp9I/gww6lXeXLRRZB9OaIXA2aWQvHSLorF0NaE9kriiNsT6uAlaEqF8KjG51a2Rv2XSjn/UceJbc0lA/7xBJJI2MsKqPiZP+qjd7RsBqU4N2KvskIVpzzbeNVuVGTItJRK938pSGbQgLTgJUpukiraaHWsBNAnhoXWTRLPmupkUQNxfQS0KXOV7WVNti8VsWHrYyGNnaBQ8Sow= 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)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123556025)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3319; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3319; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3319; 23:16ybpBFRhZHqcShV7jDl5BQJciq1GQOPP8PxOMvh0?= QztVMcnD/aSNAKh+v02i+7ubHDWToePUdtExPmC2fP7QDmgXUMHxAHP97ndQZOtrx2amxVXi4GpZRCvPE3n4tQNiSPDOdyEnW6J9rz8eTi7/GtR7N3vSgPvKw9gj1/MMHrB36s7o2nksKntFG0oF25dBg7+iDtK3B3JvBf99LzZBCUa/FSgdJ5C8mRrrXtur07v91bCq34L1p0ICNmT+oTE76gv62H7M9eV/pARIMBol2zlaqptf4U8Cp1B2CqRA/EeeZ/Qj+N/leKGAtjfsUVqFqSZPcTMfl8YSkElURbJAUvr8D3vIgyET5vuUmBKhGxPhGm+h9/6VfgwVnZNgJjua2KYCwJMlH0s35dAjVjhM4QuKjkMgbNejITF1Zz5z/LD0S1u8F9uw87z4OowDDeV4ims/Hj5llB1jzLQDBkpB2TqCQ0pv8BSuNRpTpnLK4OfXRZid4+4iPTfsopAt3hKkoMWSCO3ZVnypn7hoKiSzE4x0Sb8yA44m8t7bwVKTXnwXohbN0WLKRdJlb1xl3RjHw9p6WRD1DmfE4ftkjhkIjkrYLnVusYbzOBNNwx2FqTgQGVWHitutjk+/zqPk9xbLiqvEeTvxTh9/r/hRsSpNWyTSVnX8MveFxf/csN0QDueY1o8L1FychtPjiG6HO579b6RlKn/GY170EZ4cRx+BHeXybVDDaX+2aPuLXsMKepW2WfPfMiWcxGYOvH2GdGm0NXMcUHxFa6v6o90j0CQgVu3E7lUTiwSyMePN5Bj7PHpdHYjgJR4tQ3cw/W+CJqsQRzaRAOaWAkZ6ZruD2KLRXGWiQBC7sGJi3NqOH4dDTBNcQoG8qttm1rdfBbwxZjyzLk1is0F57n37Y55cBZy8JtRPeiH19Fzou3yyqTwwIuNvC/snLJSOmWIDENna9SsoHTwTkJ0VH2X81LqQhCWMb7DgBJXzcsh8oGTKw4odcS/jdw8G1XMOtF8Iv7B9bKaxIfGKk/qoIQp8oPhq2kt8btT+Fyit4NPRK/fmqI6q+Ziyfjd6hY9BX4e5uNODlFylyS/qT9If+1Y5lnLZNhN7sbbNa9tvDC3scKb6MKoltSv4pIjOXNU4pZW8tl1/FEXHDHDmKR9k53/uzBlerS3imCptFEJCCM5HpFm6+gu+pejvjB6W/P0vETVFEYhMqQb X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 6:QDHL1eZyORJpr9nNhvi0AuaF0geMa22htCLhU1MAiR8tfc+SAaS3sHDKeSDUrpPWvTPfI7+78Q0raSUzf3pyZva5x7tgonxNyzoFmtdOvmHcmKFV9YprgnEoeT+lOIrXswshwbLwFAEGkwtONzFiHUDcvLj57ysEs286vDMRZQUhGGtQmnLKgTAIxUgTBDDF1MaReiV96DLsyemUY94SiJiOibHWaoTOkpEmKhWCVmIZDGGiEq9V4arfEoEgEWkKqMsSxsYkDVd2xbe5Pd9TC8a0SNLg67t3JwzeloCubwBsxrGe3ABumbtpojEq/8KxPDumwR4KTnjd7C0xWEGJWg==; 5:Cx00II3cdWQabWGTGtY1QBSU7vGAsgKE0YEh4qbgGkZaGToi1tdEXFjK24ExADDnQ5GbZbL4dHId7UugSbgNJbngesieQ47UN2RV06Kejxa61JgHXc9kdCGDt8kbfS0gwANV95pN4y8xH7yuIffGNg==; 24:5Mgoo2SG2nWVtFFssTh25AQaJBlKX+UPLM8ls2b+xrptDYlYBlhdgq4zldmP4hHAzLAbXcOK819q6GPag54OXc/JfUJStXLNbUrH07ygGp4=; 7:FlWKPrVTgdcMOH5YymK7AgftLi8pT8byieqIgdnplb9NqTmGHy2/0ClimuOCfEEMV4z+ELDeYFsf9RheaUFTLz8pSzbGUdVyMw+h1JBMIOksVbvvwg9/lsgdXf+YSOB/9/yl6cchRqgJdtaZzLBe/MZchPLEHRHTJttZBxfgayrsbwdmbq86WfD2093FQV93lSDQxhQZc79SCOoGcFSbzCRSBg+t5fVrNUbCYoVsB74= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:45:58.7851 (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: CY4PR03MB3319 Subject: [dpdk-dev] [PATCH v2 04/30] bus/fslmc: support up to 32 frames in one volatile dequeue 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" From: Haiying Wang QMan5.0 supports up to 32 frames in one volatile dequeue command. For the older Qman versions which only support up to 16 frames, the highest bit in NUMF will be ignored. Signed-off-by: Haiying Wang Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_portal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index f212829..7fc78cd 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -704,7 +704,7 @@ static struct qb_attr_code code_pull_dct = QB_CODE(0, 0, 2); static struct qb_attr_code code_pull_dt = QB_CODE(0, 2, 2); static struct qb_attr_code code_pull_rls = QB_CODE(0, 4, 1); static struct qb_attr_code code_pull_stash = QB_CODE(0, 5, 1); -static struct qb_attr_code code_pull_numframes = QB_CODE(0, 8, 4); +static struct qb_attr_code code_pull_numframes = QB_CODE(0, 8, 5); static struct qb_attr_code code_pull_token = QB_CODE(0, 16, 8); static struct qb_attr_code code_pull_dqsource = QB_CODE(1, 0, 24); static struct qb_attr_code code_pull_rsp_lo = QB_CODE(2, 0, 32); @@ -743,7 +743,6 @@ void qbman_pull_desc_set_numframes(struct qbman_pull_desc *d, uint8_t numframes) { uint32_t *cl = qb_cl(d); - QBMAN_BUG_ON(!numframes || (numframes > 16)); qb_attr_code_encode(&code_pull_numframes, cl, (uint32_t)(numframes - 1)); } From patchwork Fri Sep 8 08:45:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112027 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1243361ybm; Fri, 8 Sep 2017 01:46:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb74NgwxZvEBLdMDBNHeAChhKaF+Jz9dL9Q7FkgQyEP2wtXcifuQqbt9xm6xjNIGYu1Xfleh X-Received: by 10.223.134.93 with SMTP id 29mr1412304wrw.60.1504860416029; Fri, 08 Sep 2017 01:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860416; cv=none; d=google.com; s=arc-20160816; b=fdkn6GlNhfUfyK+JkWQN06hQNKH8Zhi4ycEX13VPLaeutV+IW2YYxScwqq3Cx7aL1L gbOl4SCfNihRAtirrGgdgiPoe3VYXhdRQQ/SLEWjHSD+rqZMTzJ3074alz4g91BLS8PX 6CkPVc+Ymd7sdAj+eMbLXD0PBHXEHcoyilWQ7lcWkgxyfewcUpQf0IQUjrOTFGhBkZMi JGow9nntT6JpFymdOmfrVutcqKOFRup/d6lAm9hZ6ZEQS6uekn5C3h//qF6Lq9cgzjyt yEq1S0IZNhC+pgmfz9yzfhh2/Pst5Y1CCQc5XqnhVmtGeqdvFkr99fQo7O6nhnxS4ueS AMWQ== 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=NHGgHteCwlDEIUOVi9SnyjM5Z06s7Fs6QP7z4K/1IEk=; b=t1mW6JRqriyf/m26gmiIGMqEbF72zR/c3jsu7fGB9qgYkeE/ifdoTwu84j+n2Xyb0m FueMZva8VfAzRD4WrAtKsuFZKkNM5sNtCTi1jioa9fQFs+G3xi+fXQ3qrzYUE9gVbi4c B9F1CtAPNyZqeIRYs0tT7AlGmTsX4otAlN5GWASSCEMA+gdvcCKaliTGLfqzFhKTWoE9 1wFVCdc5sJzRvVXA+/vsqzX0HvKLWOWFcYA83YoXgV6Rnqd3xzyuS/4Xm0wLVnACspwf h2N6fE86uihdL062DO6caFTsReW/MBO5DEanesRWZI3S+E76w0Qtsk2t/aMND7TbjjQE dnjw== 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 b98si1080744wrd.541.2017.09.08.01.46.55; Fri, 08 Sep 2017 01:46:56 -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 8BD78199D4; Fri, 8 Sep 2017 10:46:05 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0049.outbound.protection.outlook.com [104.47.36.49]) by dpdk.org (Postfix) with ESMTP id AFE52199C6 for ; Fri, 8 Sep 2017 10:46:02 +0200 (CEST) Received: from BN6PR03CA0083.namprd03.prod.outlook.com (10.164.122.149) by CY1PR03MB2268.namprd03.prod.outlook.com (10.166.207.20) 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:01 +0000 Received: from BY2FFO11OLC013.protection.gbl (2a01:111:f400:7c0c::173) by BN6PR03CA0083.outlook.office365.com (2603:10b6:405:6f::21) 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:00 +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 BY2FFO11OLC013.mail.protection.outlook.com (10.1.15.25) 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:00 +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 v888jmob023063; Fri, 8 Sep 2017 01:45:58 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:02 +0530 Message-ID: <1504860327-18451-6-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: 131493339608917845; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(104016004)(6666003)(50466002)(85426001)(189998001)(33646002)(47776003)(77096006)(5660300001)(48376002)(54906002)(2950100002)(110136004)(76176999)(356003)(50986999)(6916009)(36756003)(8676002)(8936002)(106466001)(2351001)(81156014)(81166006)(8656003)(97736004)(86362001)(305945005)(105606002)(68736007)(53936002)(5003940100001)(50226002)(4326008)(2906002)(498600001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2268; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC013; 1:zpotHueBrzzEWFUlntV70DuBoIee4hw7EN+iiSYKY05Ewsbow/lHkU7hWsCIoX0oB9LWEWf5RTgOu3eZ+J5SUkAkhox2h/fvckFg+diReaQYUOfq3UYfCRWfvFiwBEtU MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0aff67c9-0a62-4af7-2755-08d4f696082f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2268; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2268; 3:AiDUNVV8fGtWo8r6Q5PZPufyem7Ea3j1AKxsBzy6D25g9qlVMZ5lO6dHzqCvfON8wMEmugM8G2z6cxQ9+IjSSoNOWOqtCI9JQQdKdsRILe305gN+pZyEMGeinDQsG6xCCvaUN8RdVNzPjhSQ2oZPSiKlFVKxpUtQ92L+CR4IUtGNZ2sQCLT0GxKfrtMWFLsE1uauRSRR2F6kth3Hp9YQjyhQviFj7juGZR1avbW/ARw1d4IvZSRzxGV70yg2IDlO3jz680XDfdYeL72q+NmcPRqyhN7xIXmYYHNSvY2lHZWfSHugzDK61VqrQHxhglWVVHFC4iXE2drJAhRmuGhqqu9FOL9fue5CHshZ/sM7aok=; 25:88IufD5OaTSvz20HI9ZrzS1zU3DD7+KvB7c+MH4Ka+8dgkUrBH2ER1pBgX53ZSx2z2vnwlDl37p+EIchsnfjARwq/iz4ZFpV9ub/ldNI77gvpIqrBQmC+XNWpvojbSpzAlMUrgud54rpxZcVgUMjG1cHboH/ugKSEuxiTyjVj7HOnMES8133L6NVjN15az+U+xWotg7AekX0BM8/XN3T6IJwqAMg25Qjm4aVBo+uTfg+IOmxUle1e/xVEppSdxn/HEGPhaKPBky1yxpFBK/qvPPjSR06dFW+wyUs0Vp3WustFI41rJDrM+RwIGkLEbjtylf/bfGWLDHoQ5s75yWlig== X-MS-TrafficTypeDiagnostic: CY1PR03MB2268: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2268; 31:HqOEflGfpG92S9YWGl/wfgq+y3i+IeDv7tPrytBW2HUTwZA735KbJewrotFaB3Z8vWQ24RhyNEXn8RsK10RZ5h3Q4OOxCVkckPo2k2EACaZKJfTlviedELum2UQqBuLkhcdFCwN9qwIBN1iYpWguDeFFMLV00aOhdSodoCQFUwnn6U2UdBKKU9gWZCT+UkHyeUvK4c0N7HgtjVcM7mn/uXyECwuvR2qBnOE393UwO4c=; 4:sujbcnVPe1mqbK5riz2eZctgmX0RUoQxgIzhDByxwS2eyZwwZVT5dAEYmOg0br6JbTmA9sHbg3ZJmVaru/DW47XUXH+Acq2EyzCZwKYDAzhl9jGmMkELW151YTTzfZGJi73WbnoVow4saUQuh2aRLhANIqtBsvaO+MMVKa3gwvW+r4bK9gFM4HIOkA75ZZu8x5PmGF+fWiiCUcArMzkJC11Z3LHYJy1u6tArLPB2DwhcGayEr6vYaufNuYjVL3n7Kko+W0NDAYwMc5A5F+R0vJcZLYY2m7QEbh/yIk6p5PU= 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)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123561025)(20161123559100)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2268; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2268; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2268; 23:FOJ++a1o85lDQiWQA6u2HFmYvGQzH2KmJajgqMvzJ?= ROa90hYr4XHFp/1lsToHCixOrc+YgANxzOop35N+8HUcn5lx8gRbGuwxIHfj9oVlNpb1cqJFhs5JCcszg20OwzlT90bN0W+JUDMT8ONSpx3SmlHvenTyqFYhjwjnW/ZPFjXq284BL3uZjKgza+cL08Q64/VWlHaK0X/Fjb3fD8tINjJZo7LDsLnfFMXo5MWzQyJ+sAByUxaEYWHzlcYBFNjOstL81E/PbsvUI7G0JWbfAD6H5YWZytqYou0tAGk5cWALiST2FuczJ8K8q0sZtGl5tyaBaBAAHKVnY6KzAH47TGOyh4iaXyWJfs3k8JwsSXJARUUfb9PzlwhgbM1bYwMNvJEt0i+w87e4lvk+d/S03pq7f0jUeUij927dtLSAeaRPOYDWmf+5rJ4/RNqsqx730uUNfxCFVHllLXm3L5U3bLHgkE3NCgK3OraseA9MYHO/wYfjNyvQnV3rIeUHNHlX34jJ5xjHqtV99bUwTAoSrvDlW9M5y/73vv2dkMY7309HLSn2ebbqwJqZ7BIZFLaG3isEiyy18AflTGm/T4dPR+AneMN0X4C9m5nsrnYGefrRZu6a4VTad5Ib1ui/won8PmiVvX6Ce9fVqCzL+Vh9SRSuvkt9hpHg2Lh951lxDaGTGGBKSQ3WJGktYO5ma7Fv6+x1Py9H/qYoo7qIQlmO4FbqWTO0acCTGcCseLao7L+yJmbGM9KfzSbKJifYaO27mn5ZT7NqqxgSSgtwk3NGL5cxwwjUVFae8U5SiCN55xCZJhl7HxWH4uPwsOe0f74Y+YryKJ3wAoMW+ZUgV9PFN3VkPB8cQavr2TLnfrzDE2ZNxypozdaBKJGC9x+HEg+nzmS6zhoWjlgibqnAfo2NgNRDsliOsLxo8tx8bkZA38J7ZNRFJYCgot9N+oAXnt2Tr1sXtY2pw9KEcOmIs9dNmN1CS1WvVAbL8oCJ5Xbwd21BG+cPj19csLZ12ub7G9DDM5u0OmpQZyIBtnC3OyBi89A4w+ELtHnM4linCIj6boF1J9sOYp0OR3l8OjJHUmeIhnOIAMFoTMGwCiCQSuvPEeG3bJfWyfp8BueZ5qXbIogeu9GZ4FbzsLViMAo1PmN X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2268; 6:/qFDUFJ4az5JeJjA5pv5V6GXG0hsCTBbAJVKjTGFCLtZWimKtWI+GEoBFFb6zSApJ3vsJSKJofGeqSF9muiVODgMEYFMtEBRvQVwpcYl+J24lEiDwb6BEv00eES9zwXsinXMJr+nnUL339TGUvTJuIxKxGY+wGPS2ehaAIQLj+PY+mrOgGbEGVtYFiZNkkVqkPq5LlsCpS2UH+PdHGp40qU2Qqpj1sDES4lnR8yeNKOzKdBu0DKpVZ+rXhVD0xyy9L1WtdaFKCL0+yEE3+n6dtHYw1PXgpWmvG5Alzh9yMv11PLrVDprPHH6uxAj2/HbKDcfhXVcDR3RYXY98XOUYQ==; 5:sNAyiZnKsDg9fnIeWZfwseEcJGMu0mDbj3zprV77nzcHcM4EYL/vyVjUn/FetWQ9vlO2w27/hpH2AgtlzyhcOpvd46fHDIMs4DfA6mwatCYBoSw6w52HYUCcxNlPa/HbNwuMVa7mdgnYSsBvcD0Qig==; 24:QNSK4SJUIFL96CSJ3snu159SPO8yDBrjkPb6uwx4K3BI2umXV1lnWS5anEboVZ39IKPXlQElKXuihX9z+VC7SlJ3tIRkJwCBu2YAK44ng00=; 7:vKTqHT+kS9UxpF4W/YnjDYNsMoJm5CTrEElj1V2Q7KGlGvPX+fe+uswi9HwB+TCDOEDc8Kcdf0lYg6w8Kc7Nqhl659AEbMMMJqD0K96bqj2RGrXegM4KNjUdn3KpZ0PfZCEASMDSK0VFOLrhHZ707YFPl1Go3V1dL9pX2GCgpJIGUBBr9yq+kMYF/6Erneaszbt+0bVCsypi+6xxso6w5m7WNDMepWO0xEUelupS654= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:00.7045 (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: CY1PR03MB2268 Subject: [dpdk-dev] [PATCH v2 05/30] bus/fslmc: enhance the QBMAN CENA mode 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" From: Haiying Wang Signed-off-by: Haiying Wang Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_sys.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 9ea55de..47da595 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -217,7 +217,6 @@ static inline void qbman_cena_write_complete_wo_shadow(struct qbman_swp_sys *s, #ifdef QBMAN_CENA_TRACE pr_info("qbman_cena_write_complete(%p:%d:0x%03x)\n", s->addr_cena, s->idx, offset); - hexdump(cmd, 64); #endif dcbf(s->addr_cena + offset); } @@ -251,11 +250,7 @@ static inline void *qbman_cena_read_wo_shadow(struct qbman_swp_sys *s, { #ifdef QBMAN_CENA_TRACE pr_info("qbman_cena_read(%p:%d:0x%03x) %p\n", - s->addr_cena, s->idx, offset, shadow); -#endif - -#ifdef QBMAN_CENA_TRACE - hexdump(shadow, 64); + s->addr_cena, s->idx, offset); #endif return s->addr_cena + offset; } From patchwork Fri Sep 8 08:45:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112028 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1243586ybm; Fri, 8 Sep 2017 01:47:08 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5gXwq20Blwlyb+rvaoqpr6ePLA3I0BbvyIVIMahL/sHk3DR40LEGrRo7E7pSJi+sFHarTe X-Received: by 10.223.187.16 with SMTP id r16mr1377639wrg.88.1504860428549; Fri, 08 Sep 2017 01:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860428; cv=none; d=google.com; s=arc-20160816; b=ngMwAMamcIUQ4DKeTjPOflgRVmCMtc0NkERtvHY0l+nEB7555qGRQoNh975TMfXe+/ lx5Vjnd3dtiHayuJUQdm+GDmaQnyM3FGusITxWvbKyQ4pWtnYHVDg+/Ga89XKzHWca/W FmdRbualP2ADzZStf70sMquOpplZW7cap7zjRyB7r+dkycMWcw8Y3LxpggqH8AKWTHSU 3K/fPkuDwlCemPdp/Ic+nOgIzznfbSWLVyFuAfHj4+aDltViaMAAuR4JSbwvaGmNo/LI OSHwY3A8lPCDaci9YsKVRxZW7l4AekjZU3GL3RDy+NLhOWkumiYpe8/kfATYqKLVwx2/ cUaQ== 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=5jeGN+Q+3KdsvdClu1N+oBQjcvsSWq4oxvC1qjMt5+A=; b=RV1DZkuqzLsuwRD9//O8edNrwJ9NLNU0l5SQNVoriwB8uaFDlM6BVeP8XhQXi32Uka DnVhs0KBzGKcKK4AEYsH3oo+CMmfzUoxSiAnib+g3Gtb1nczfUC3fOm6CsGPZ56JRwEw B83NHvoHOnUEKIxBbwG2vvyWwh1p0EMSr1rdmiqUHoRlpcVbnBbEqQA/s2LW9Z3rO5C9 Gve12M9OeNyJ0jLW3/FOWbu6KCWfh6Ym0o0GQGDblQkXX8gYRMCT1P5PWk9aBkTV3Jnt fz/bb9oXPGGN2hQ5EvER5+NrBXNT/KhnvIlJvisPZAQEWKHipJ3UjIK96I+pM8GwQ4s3 TAnA== 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 w44si1158137wrc.191.2017.09.08.01.47.08; Fri, 08 Sep 2017 01:47:08 -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 EAF23199D9; Fri, 8 Sep 2017 10:46:07 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0083.outbound.protection.outlook.com [104.47.34.83]) by dpdk.org (Postfix) with ESMTP id 78C18199D2 for ; Fri, 8 Sep 2017 10:46:05 +0200 (CEST) Received: from BN3PR03CA0072.namprd03.prod.outlook.com (2a01:111:e400:7a4d::32) by SN2PR03MB2271.namprd03.prod.outlook.com (2603:10b6:804:d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:03 +0000 Received: from BN1BFFO11FD008.protection.gbl (2a01:111:f400:7c10::1:154) by BN3PR03CA0072.outlook.office365.com (2a01:111:e400:7a4d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Fri, 8 Sep 2017 08:46:03 +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 BN1BFFO11FD008.mail.protection.outlook.com (10.58.144.71) 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:02 +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 v888jmoc023063; Fri, 8 Sep 2017 01:46:00 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:03 +0530 Message-ID: <1504860327-18451-7-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: 131493339628617365; (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)(189002)(199003)(81156014)(6916009)(498600001)(4326008)(16200700003)(2950100002)(36756003)(53936002)(53946003)(77096006)(189998001)(54906002)(97736004)(85426001)(68736007)(8656003)(110136004)(305945005)(104016004)(356003)(8936002)(48376002)(50986999)(105606002)(76176999)(33646002)(2351001)(50466002)(8676002)(50226002)(5660300001)(106466001)(5003940100001)(2906002)(81166006)(47776003)(86362001)(559001)(579004)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2271; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD008; 1:VmJzw10Z6jdRfYbe56fIsC+9FEO2FlORCGs98lUGsKDz3F7IMstMVqswXMWv/FEIo89xD2uy96MyjVylEgykLWDsyr9B1gJWGbK2SIQsIcWL/gQRwlqHQ8lqXVU3RqLa MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f805387-ee45-4dc8-5d35-08d4f6960959 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:SN2PR03MB2271; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2271; 3:k7+/AQvoZWA51OsKgQREhWEkWNES4J+HOSEIGmNMfvkCWOnUgCGt9yGx07SrebT+caWJcRnl9Ri0Z4deM8GyL/ej3M3pjAUcwtWsJ9QmkE+MRlCBDfa+FtpSY8fLLKltNzOBK9jrND0WTusya1cg0f/509RbkEBgVj4qfwTnjuHSlE+anRNO/rKFYwjHrB7B0dQ+Rwh3ywVTcy8K25PvdTOEUAK1+DcJjsIkqaqV/vJ6N/V0aZmMigTluk3m2JfiLNU5NXPRHom4CZv+HvKJc+5lc+GJOyIiVDHbsPOXV80uBgQe4mDwFMK2pgxApaXxXHvZj9QA5MgcgpE6xYrtKQqKaAwQKXsKChsXhrhbqLw=; 25:O85j9+pKl79TjESirAwLRjA/uT4j0+/OknP3hwpcCJGso/hQ0dtWQkuPGiEC4heyA5quFq1UJberl8juRzYI4PNMlFjDPkmSIClRDfAivTjTFvEbtUGg3p4KV6Fi8JBg2FtC0PAxD/aqYMVESUs20K4TZWdSE8G6GqCB1KDZM631ChnHgjeBcENidckCqwatkpxEfMx4fKY3S0qr5LJbE+vHyqDCU4FEV0fd0UcZ+N3dd3SAhPyLlGRAGwy6AcwSxLDxLge2asXuCdWeUc+w6YNsHTKQfcD1xDiibF4yTpAOSlEbFqGW/l7OhnKQ/mzvNlmVGLkcruUjd3xePNtlCg== X-MS-TrafficTypeDiagnostic: SN2PR03MB2271: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2271; 31:WTHFdKtpQE21ZAHix6d1A9PbJRFEIeiA5JAUaVYUe+1FmQrmvfCRaJCNFc4b7p4lBn3NHumDw8gWNrelpF9WlZqf4ufHqJhbnSxETca9pQW7hpGLHvEommJc4rni+mROsyNy77gacudm9H6SDZe2Ks1OJxwbYjqoYKD1VRP12R36qZ2QHp1mbGR4mz/cJV0whB4UVaqXPfbBQgf3UUh9zITizNr14IOZ6WDw4W1zZnY=; 4:pAlGdqZoXiQuO8l1HJIcKVPqLUoBL6C0BvP6LG56XZDSJLRobHSNUdK0KmTld727udjH8k9tFG4X1kzL+AsKtQysxf919jy5G2cMVB6OZLFgswowxeVE2aNnEPPkk6UTJ+himZPTTtqdK+wNAzg/QE26uRhvzI1pvwrTsR6+Q/iBL72yAZwnJx060STxEuIHN2+ta6reHgGDqkAKxQejz7u8ffxdW0FRAut0c6lco4aZT5VXHpoF5FZKfWUr05KBvE3l2MO0ULPEF7A18QPoCR9BnBy3phUqguV4Pg/JRMteg0LHENIAoaFvLBHEjKY+isjqnoLq+7lZARQnoxgQvw== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(20161123563025)(20161123565025)(20161123556025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2271; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2271; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2271; 23:x0ILfg1iuO05K9EoSxmGaz3b5T7bS/tpiHeVr3Tya?= oEtVpevymWeK2DdIRPJhdvk7gQ1eU8E5FsxSbLUYyx4VrqTHAg2pKWME3uqCrq/TfL5o+VYDhOXfZi5wvalPyQeOFzHJAho6K4A9zgmIJIonaBCew93x4YBcqkDX/ary2pD0x8VIxSASA9wGk2S45vFbdfH2yyHFQoUN4CRdgFq6qEXr1eAEBGKlW46IkjSB1XSbQJOeaSRiT+DjtshlxGRKbjpNmxyjuBZYOEeGJsI2o22x7HwjVLGXnxz2A+gvPxVzSWeac8MSh3HCgD81UKp7avlXfSFzMJtMJvt6J971naSPehpQ44MpmYPUT8AZVyXHYd419eAwMZ6fzt2bmzF4BHj3D5j/y+Xd/33MCf1JJCMB03boolGySfx81mxcMbTGzKELN+n0z80UnDTFMhSm2uwsjiiT3336CvvvRQxWrR3+eGcly9PIUY8iG46KOMfoHFFMMatTfXl3lBY7k8ke98LAwyFf7JWDVgI+bopvSp70KvXKGT5kqtKq+rxTNsMUMsx+OwViN/L6/wf1iH/taEMEMN8Up0ffL14zJXGR/1E8aUJpdsqUjgz56Xp0WNz3JYvYu3eWNoQC6gjvQ7/lXlFBHIoNfxfC0/aLPQQWsCmza245JiqNhkzdYrpIXZspz18Xv0ul2v2+bD9ABCp2btgwe7bOXGg6HD/JOIvnmoSWOw9jucT9PzLE1iiuM/L7TYKnEQff1xrINA11Gc3Uai+T9EkfHsat17mqUeNiuCfarGanz5vhQ5mx5CF6LNJP1kU6BYBGvo9MuP6UbjC5ZwCw6iXIVDcr4h7aCMcms89USM8LokQnyejVgAlOY3D0AYhZ8hOell/wpWYQeizpQ2fqeUrbKeFonT77Dqby873/2CkeWzwDbua1RtXN+b8id8bFKMoDS0jFMAVQtP4ka7dyy5Wq1At4/PWsGbl3FLw/gB7XxOToPAqPf5wnX5aNJPd+cNLb0LIwMh6n151QrwKa4N0utOnufcb34AS0LJHjNoaskg8rTXay4fGsWtMMsvl04niFUD7Ml1zpyu8MkLY5mcIdWDQPPPPaOhQL4f3foBig87ux4RqCVvsCp2sr+dyZC52IifNYFxPyJPGGWpeweL+9Kz0TRX+ZyG0XlJuhYs0DxkGOjPoF8n+9cU= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2271; 6:LE9Lrxk7yJdOWXRMponj2ntClgp1axut72Hhq+l2yjldTJn8LzrbYDojGtvbug8UeVjgFM+F3iKUL31iTgM53K16Lc4mRiWmOcXO2mmA3Z0g5SRlBRXg4c4PNJ4Rd5SHr28OO8peC/UFXFeIAG9sqAUfCYG0qwc+zszCh5vXVarXMOdA6D5TV7NthKnUck/pCDP/tbXBayX9QGBih9TwAW6PU5MkZW0rCGFIdhzJ+ALXKzXZHA/Dz9jclB9k/1ZY8UmgFwcm5kp3hNQTJuyfy/ys/1Zzje65g7fXsb3NbnFFthikwiebDULGWgYfdLyiXlNMMS9pH3BMFLAKc7CihQ==; 5:zK1oSbincDC39lZvEjGUefL452MzfjNkobGqaD9TYu9Fgf1i6QyTZVwqUWaD9fjnnd2kgvP1YA/wti3zZeeIV2tWEUlei6TQwrwPIookUMIYIuwlZFxCc8gInu5ywaUOjumtp8lTyEPV9NxBTAxGUA==; 24:n6BGwOxekcvQEWt1JNsL6DyTFVtnQe8IGv1qIAt6zfID9/qmPMQPDdhPQYLXnxAYrcB01noPbuBtaoqaadywBU0YqT0LyVvjFYZAt24QuP4=; 7:PRq8Iz5+GVPXOCKDHZrfn+eTnX2fmrnv7sIz/7VXbAf9UrZ1FDjKmbZK5e7vn16n0IutLp0kytt0SPbv7g7JFFCGM1PJHRj3A76Uow4LzWcuZhhX4b7mqmnHMKJanlR0TdYAR1VGuIS2Yl4D3ZwqkWnEkR1Sclc+vWMBfjogbkQ8JQe7NgUfivYURDoUhCIHEPBDuM3pX1MgTqlnSDRupPSJp6Sta6S3q/M25f6Lojs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:02.6745 (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: SN2PR03MB2271 Subject: [dpdk-dev] [PATCH v2 06/30] bus/fslmc: qbman remove unused funcs and align names 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" name alignment for check command and result functions putting them as separate functions instead of changing the original functions. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 146 ++-- drivers/bus/fslmc/qbman/qbman_portal.c | 731 ++++++++++----------- drivers/bus/fslmc/qbman/qbman_portal.h | 6 +- drivers/bus/fslmc/qbman/qbman_private.h | 2 +- drivers/bus/fslmc/qbman/qbman_sys.h | 12 - drivers/bus/fslmc/rte_bus_fslmc_version.map | 3 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 +- drivers/net/dpaa2/dpaa2_rxtx.c | 10 +- 8 files changed, 449 insertions(+), 465 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index fe1cc94..24a6d4b 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -194,11 +194,38 @@ void qbman_swp_interrupt_set_inhibit(struct qbman_swp *p, int inhibit); /** * struct qbman_result - structure for qbman dequeue response and/or * notification. - * @dont_manipulate_directly: the 16 32bit data to represent the whole + * @donot_manipulate_directly: the 16 32bit data to represent the whole * possible qbman dequeue result. */ struct qbman_result { - uint32_t dont_manipulate_directly[16]; + union { + struct common { + uint8_t verb; + uint8_t reserved[63]; + } common; + struct dq { + uint8_t verb; + uint8_t stat; + __le16 seqnum; + __le16 oprid; + uint8_t reserved; + uint8_t tok; + __le32 fqid; + uint32_t reserved2; + __le32 fq_byte_cnt; + __le32 fq_frm_cnt; + __le64 fqd_ctx; + uint8_t fd[32]; + } dq; + struct scn { + uint8_t verb; + uint8_t stat; + uint8_t state; + uint8_t reserved; + __le32 rid_tok; + __le64 ctx; + } scn; + }; }; /* TODO: @@ -254,11 +281,21 @@ void qbman_swp_push_set(struct qbman_swp *s, uint8_t channel_idx, int enable); /** * struct qbman_pull_desc - the structure for pull dequeue descriptor - * @dont_manipulate_directly: the 6 32bit data to represent the whole - * possible settings for pull dequeue descriptor. */ struct qbman_pull_desc { - uint32_t dont_manipulate_directly[6]; + union { + uint32_t donot_manipulate_directly[16]; + struct pull { + uint8_t verb; + uint8_t numf; + uint8_t tok; + uint8_t reserved; + uint32_t dq_src; + uint64_t rsp_addr; + uint64_t rsp_addr_virt; + uint8_t padding[40]; + } pull; + }; }; enum qbman_pull_type_e { @@ -415,7 +452,20 @@ struct qbman_result *qbman_get_dqrr_from_idx(struct qbman_swp *s, uint8_t idx); * dequeue result. */ int qbman_result_has_new_result(struct qbman_swp *s, - const struct qbman_result *dq); + struct qbman_result *dq); + +/** + * qbman_check_command_complete() - Check if the previous issued dq commnd + * is completed and results are available in memory. + * @s: the software portal object. + * @dq: the dequeue result read from the memory. + * + * Return 1 for getting a valid dequeue result, or 0 for not getting a valid + * dequeue result. + */ +int qbman_check_command_complete(struct qbman_result *dq); + +int qbman_check_new_result(struct qbman_result *dq); /* -------------------------------------------------------- */ /* Parsing dequeue entries (DQRR and user-provided storage) */ @@ -537,7 +587,7 @@ int qbman_result_is_FQPN(const struct qbman_result *dq); * * Return the state field. */ -uint32_t qbman_result_DQ_flags(const struct qbman_result *dq); +uint8_t qbman_result_DQ_flags(const struct qbman_result *dq); /** * qbman_result_DQ_is_pull() - Check whether the dq response is from a pull @@ -648,24 +698,6 @@ uint32_t qbman_result_SCN_rid(const struct qbman_result *scn); */ uint64_t qbman_result_SCN_ctx(const struct qbman_result *scn); -/** - * qbman_result_SCN_state_in_mem() - Get the state in notification written - * in memory - * @scn: the state change notification. - * - * Return the state. - */ -uint8_t qbman_result_SCN_state_in_mem(const struct qbman_result *scn); - -/** - * qbman_result_SCN_rid_in_mem() - Get the resource id in notification written - * in memory. - * @scn: the state change notification. - * - * Return the resource id. - */ -uint32_t qbman_result_SCN_rid_in_mem(const struct qbman_result *scn); - /* Type-specific "resource IDs". Mainly for illustration purposes, though it * also gives the appropriate type widths. */ @@ -746,22 +778,36 @@ uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn); /* Enqueues */ /************/ -/** - * struct qbman_eq_desc - structure of enqueue descriptor - * @dont_manipulate_directly: the 8 32bit data to represent the whole - * possible qbman enqueue setting in enqueue descriptor. - */ +/* struct qbman_eq_desc - structure of enqueue descriptor */ struct qbman_eq_desc { - uint32_t dont_manipulate_directly[8]; + union { + uint32_t donot_manipulate_directly[8]; + struct eq { + uint8_t verb; + uint8_t dca; + uint16_t seqnum; + uint16_t orpid; + uint16_t reserved1; + uint32_t tgtid; + uint32_t tag; + uint16_t qdbin; + uint8_t qpri; + uint8_t reserved[3]; + uint8_t wae; + uint8_t rspid; + uint64_t rsp_addr; + uint8_t fd[32]; + } eq; + }; }; /** * struct qbman_eq_response - structure of enqueue response - * @dont_manipulate_directly: the 16 32bit data to represent the whole + * @donot_manipulate_directly: the 16 32bit data to represent the whole * enqueue response. */ struct qbman_eq_response { - uint32_t dont_manipulate_directly[16]; + uint32_t donot_manipulate_directly[16]; }; /** @@ -801,7 +847,7 @@ void qbman_eq_desc_set_no_orp(struct qbman_eq_desc *d, int respond_success); * sequeue number. */ void qbman_eq_desc_set_orp(struct qbman_eq_desc *d, int respond_success, - uint32_t opr_id, uint32_t seqnum, int incomplete); + uint16_t opr_id, uint16_t seqnum, int incomplete); /** * qbman_eq_desc_set_orp_hole() - fill a hole in the order-restoration sequence @@ -810,8 +856,8 @@ void qbman_eq_desc_set_orp(struct qbman_eq_desc *d, int respond_success, * @opr_id: the order point record id. * @seqnum: the order restoration sequence number. */ -void qbman_eq_desc_set_orp_hole(struct qbman_eq_desc *d, uint32_t opr_id, - uint32_t seqnum); +void qbman_eq_desc_set_orp_hole(struct qbman_eq_desc *d, uint16_t opr_id, + uint16_t seqnum); /** * qbman_eq_desc_set_orp_nesn() - advance NESN (Next Expected Sequence Number) @@ -820,8 +866,8 @@ void qbman_eq_desc_set_orp_hole(struct qbman_eq_desc *d, uint32_t opr_id, * @opr_id: the order point record id. * @seqnum: the order restoration sequence number. */ -void qbman_eq_desc_set_orp_nesn(struct qbman_eq_desc *d, uint32_t opr_id, - uint32_t seqnum); +void qbman_eq_desc_set_orp_nesn(struct qbman_eq_desc *d, uint16_t opr_id, + uint16_t seqnum); /** * qbman_eq_desc_set_response() - Set the enqueue response info. * @d: the enqueue descriptor @@ -873,7 +919,7 @@ void qbman_eq_desc_set_fq(struct qbman_eq_desc *d, uint32_t fqid); * @qd_prio: the queuing destination priority. */ void qbman_eq_desc_set_qd(struct qbman_eq_desc *d, uint32_t qdid, - uint32_t qd_bin, uint32_t qd_prio); + uint16_t qd_bin, uint8_t qd_prio); /** * qbman_eq_desc_set_eqdi() - enable/disable EQDI interrupt @@ -898,7 +944,7 @@ void qbman_eq_desc_set_eqdi(struct qbman_eq_desc *d, int enable); * being rescheduled.) */ void qbman_eq_desc_set_dca(struct qbman_eq_desc *d, int enable, - uint32_t dqrr_idx, int park); + uint8_t dqrr_idx, int park); /** * qbman_swp_enqueue() - Issue an enqueue command. @@ -957,11 +1003,20 @@ int qbman_swp_enqueue_thresh(struct qbman_swp *s, unsigned int thresh); /*******************/ /** * struct qbman_release_desc - The structure for buffer release descriptor - * @dont_manipulate_directly: the 32bit data to represent the whole + * @donot_manipulate_directly: the 32bit data to represent the whole * possible settings of qbman release descriptor. */ struct qbman_release_desc { - uint32_t dont_manipulate_directly[1]; + union { + uint32_t donot_manipulate_directly[16]; + struct br { + uint8_t verb; + uint8_t reserved; + uint16_t bpid; + uint32_t reserved2; + uint64_t buf[7]; + } br; + }; }; /** @@ -975,7 +1030,7 @@ void qbman_release_desc_clear(struct qbman_release_desc *d); * qbman_release_desc_set_bpid() - Set the ID of the buffer pool to release to * @d: the qbman release descriptor. */ -void qbman_release_desc_set_bpid(struct qbman_release_desc *d, uint32_t bpid); +void qbman_release_desc_set_bpid(struct qbman_release_desc *d, uint16_t bpid); /** * qbman_release_desc_set_rcdi() - Determines whether or not the portal's RCDI @@ -1018,7 +1073,7 @@ int qbman_swp_release_thresh(struct qbman_swp *s, unsigned int thresh); * Return 0 for success, or negative error code if the acquire command * fails. */ -int qbman_swp_acquire(struct qbman_swp *s, uint32_t bpid, uint64_t *buffers, +int qbman_swp_acquire(struct qbman_swp *s, uint16_t bpid, uint64_t *buffers, unsigned int num_buffers); /*****************/ @@ -1133,7 +1188,4 @@ int qbman_swp_CDAN_disable(struct qbman_swp *s, uint16_t channelid); */ int qbman_swp_CDAN_set_context_enable(struct qbman_swp *s, uint16_t channelid, uint64_t ctx); - -int qbman_check_command_complete(struct qbman_swp *s, - const struct qbman_result *dq); #endif /* !_FSL_QBMAN_PORTAL_H */ diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 7fc78cd..072dfe8 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -69,21 +69,23 @@ /* Pre-defined attribute codes */ /*******************************/ -struct qb_attr_code code_generic_verb = QB_CODE(0, 0, 7); -struct qb_attr_code code_generic_rslt = QB_CODE(0, 8, 8); +#define QMAN_RESPONSE_VERB_MASK 0x7f /*************************/ /* SDQCR attribute codes */ /*************************/ +#define QB_SDQCR_FC_SHIFT 29 +#define QB_SDQCR_FC_MASK 0x1 +#define QB_SDQCR_DCT_SHIFT 24 +#define QB_SDQCR_DCT_MASK 0x3 +#define QB_SDQCR_TOK_SHIFT 16 +#define QB_SDQCR_TOK_MASK 0xff +#define QB_SDQCR_SRC_SHIFT 0 +#define QB_SDQCR_SRC_MASK 0xffff + +/* opaque token for static dequeues */ +#define QMAN_SDQCR_TOKEN 0xbb -/* we put these here because at least some of them are required by - * qbman_swp_init() - */ -struct qb_attr_code code_sdqcr_dct = QB_CODE(0, 24, 2); -struct qb_attr_code code_sdqcr_fc = QB_CODE(0, 29, 1); -struct qb_attr_code code_sdqcr_tok = QB_CODE(0, 16, 8); -static struct qb_attr_code code_eq_dca_idx; -#define CODE_SDQCR_DQSRC(n) QB_CODE(0, n, 1) enum qbman_sdqcr_dct { qbman_sdqcr_dct_null = 0, qbman_sdqcr_dct_prio_ics, @@ -96,13 +98,11 @@ enum qbman_sdqcr_fc { qbman_sdqcr_fc_up_to_3 = 1 }; -struct qb_attr_code code_sdqcr_dqsrc = QB_CODE(0, 0, 16); - /* We need to keep track of which SWP triggered a pull command * so keep an array of portal IDs and use the token field to * be able to find the proper portal */ -#define MAX_QBMAN_PORTALS 35 +#define MAX_QBMAN_PORTALS 64 static struct qbman_swp *portal_idx_map[MAX_QBMAN_PORTALS]; /*********************************/ @@ -136,9 +136,10 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) #endif p->mc.valid_bit = QB_VALID_BIT; p->sdq = 0; - qb_attr_code_encode(&code_sdqcr_dct, &p->sdq, qbman_sdqcr_dct_prio_ics); - qb_attr_code_encode(&code_sdqcr_fc, &p->sdq, qbman_sdqcr_fc_up_to_3); - qb_attr_code_encode(&code_sdqcr_tok, &p->sdq, 0xbb); + p->sdq |= qbman_sdqcr_dct_prio_ics << QB_SDQCR_DCT_SHIFT; + p->sdq |= qbman_sdqcr_fc_up_to_3 << QB_SDQCR_FC_SHIFT; + p->sdq |= QMAN_SDQCR_TOKEN << QB_SDQCR_TOK_SHIFT; + atomic_set(&p->vdq.busy, 1); p->vdq.valid_bit = QB_VALID_BIT; p->dqrr.next_idx = 0; @@ -147,13 +148,9 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) { p->dqrr.dqrr_size = 4; p->dqrr.reset_bug = 1; - /* Set size of DQRR to 4, encoded in 2 bits */ - code_eq_dca_idx = (struct qb_attr_code)QB_CODE(0, 8, 2); } else { p->dqrr.dqrr_size = 8; p->dqrr.reset_bug = 0; - /* Set size of DQRR to 8, encoded in 3 bits */ - code_eq_dca_idx = (struct qb_attr_code)QB_CODE(0, 8, 3); } ret = qbman_swp_sys_init(&p->sys, d, p->dqrr.dqrr_size); @@ -165,7 +162,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) /* SDQCR needs to be initialized to 0 when no channels are * being dequeued from or else the QMan HW will indicate an * error. The values that were calculated above will be - * applied when dequeues from a specific channel are enabled + * applied when dequeues from a specific channel are enabled. */ qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_SDQCR, 0); eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); @@ -280,9 +277,9 @@ void *qbman_swp_mc_start(struct qbman_swp *p) return ret; } -void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint32_t cmd_verb) +void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint8_t cmd_verb) { - uint32_t *v = cmd; + uint8_t *v = cmd; #ifdef QBMAN_CHECKING QBMAN_BUG_ON(!(p->mc.check != swp_mc_can_submit)); #endif @@ -323,35 +320,22 @@ void *qbman_swp_mc_result(struct qbman_swp *p) /* Enqueue */ /***********/ -/* These should be const, eventually */ -static struct qb_attr_code code_eq_cmd = QB_CODE(0, 0, 2); -static struct qb_attr_code code_eq_eqdi = QB_CODE(0, 3, 1); -static struct qb_attr_code code_eq_dca_en = QB_CODE(0, 15, 1); -static struct qb_attr_code code_eq_dca_pk = QB_CODE(0, 14, 1); -/* Can't set code_eq_dca_idx width. Need qman version. Read at runtime */ -static struct qb_attr_code code_eq_orp_en = QB_CODE(0, 2, 1); -static struct qb_attr_code code_eq_orp_is_nesn = QB_CODE(0, 31, 1); -static struct qb_attr_code code_eq_orp_nlis = QB_CODE(0, 30, 1); -static struct qb_attr_code code_eq_orp_seqnum = QB_CODE(0, 16, 14); -static struct qb_attr_code code_eq_opr_id = QB_CODE(1, 0, 16); -static struct qb_attr_code code_eq_tgt_id = QB_CODE(2, 0, 24); -/* static struct qb_attr_code code_eq_tag = QB_CODE(3, 0, 32); */ -static struct qb_attr_code code_eq_qd_en = QB_CODE(0, 4, 1); -static struct qb_attr_code code_eq_qd_bin = QB_CODE(4, 0, 16); -static struct qb_attr_code code_eq_qd_pri = QB_CODE(4, 16, 4); -static struct qb_attr_code code_eq_rsp_stash = QB_CODE(5, 16, 1); -static struct qb_attr_code code_eq_rsp_id = QB_CODE(5, 24, 8); -static struct qb_attr_code code_eq_rsp_lo = QB_CODE(6, 0, 32); - -enum qbman_eq_cmd_e { - /* No enqueue, primarily for plugging ORP gaps for dropped frames */ - qbman_eq_cmd_empty, - /* DMA an enqueue response once complete */ - qbman_eq_cmd_respond, - /* DMA an enqueue response only if the enqueue fails */ - qbman_eq_cmd_respond_reject +#define QB_ENQUEUE_CMD_OPTIONS_SHIFT 0 +enum qb_enqueue_commands { + enqueue_empty = 0, + enqueue_response_always = 1, + enqueue_rejects_to_fq = 2 }; +#define QB_ENQUEUE_CMD_EC_OPTION_MASK 0x3 +#define QB_ENQUEUE_CMD_ORP_ENABLE_SHIFT 2 +#define QB_ENQUEUE_CMD_IRQ_ON_DISPATCH_SHIFT 3 +#define QB_ENQUEUE_CMD_TARGET_TYPE_SHIFT 4 +#define QB_ENQUEUE_CMD_DCA_PK_SHIFT 6 +#define QB_ENQUEUE_CMD_DCA_EN_SHIFT 7 +#define QB_ENQUEUE_CMD_NLIS_SHIFT 14 +#define QB_ENQUEUE_CMD_IS_NESN_SHIFT 15 + void qbman_eq_desc_clear(struct qbman_eq_desc *d) { memset(d, 0, sizeof(*d)); @@ -359,115 +343,110 @@ void qbman_eq_desc_clear(struct qbman_eq_desc *d) void qbman_eq_desc_set_no_orp(struct qbman_eq_desc *d, int respond_success) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_orp_en, cl, 0); - qb_attr_code_encode(&code_eq_cmd, cl, - respond_success ? qbman_eq_cmd_respond : - qbman_eq_cmd_respond_reject); + d->eq.verb &= ~(1 << QB_ENQUEUE_CMD_ORP_ENABLE_SHIFT); + if (respond_success) + d->eq.verb |= enqueue_response_always; + else + d->eq.verb |= enqueue_rejects_to_fq; } void qbman_eq_desc_set_orp(struct qbman_eq_desc *d, int respond_success, - uint32_t opr_id, uint32_t seqnum, int incomplete) + uint16_t opr_id, uint16_t seqnum, int incomplete) { - uint32_t *cl = qb_cl(d); + d->eq.verb |= 1 << QB_ENQUEUE_CMD_ORP_ENABLE_SHIFT; + if (respond_success) + d->eq.verb |= enqueue_response_always; + else + d->eq.verb |= enqueue_rejects_to_fq; - qb_attr_code_encode(&code_eq_orp_en, cl, 1); - qb_attr_code_encode(&code_eq_cmd, cl, - respond_success ? qbman_eq_cmd_respond : - qbman_eq_cmd_respond_reject); - qb_attr_code_encode(&code_eq_opr_id, cl, opr_id); - qb_attr_code_encode(&code_eq_orp_seqnum, cl, seqnum); - qb_attr_code_encode(&code_eq_orp_nlis, cl, !!incomplete); + d->eq.orpid = opr_id; + d->eq.seqnum = seqnum; + if (incomplete) + d->eq.seqnum |= 1 << QB_ENQUEUE_CMD_NLIS_SHIFT; + else + d->eq.seqnum &= ~(1 << QB_ENQUEUE_CMD_NLIS_SHIFT); } -void qbman_eq_desc_set_orp_hole(struct qbman_eq_desc *d, uint32_t opr_id, - uint32_t seqnum) +void qbman_eq_desc_set_orp_hole(struct qbman_eq_desc *d, uint16_t opr_id, + uint16_t seqnum) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_orp_en, cl, 1); - qb_attr_code_encode(&code_eq_cmd, cl, qbman_eq_cmd_empty); - qb_attr_code_encode(&code_eq_opr_id, cl, opr_id); - qb_attr_code_encode(&code_eq_orp_seqnum, cl, seqnum); - qb_attr_code_encode(&code_eq_orp_nlis, cl, 0); - qb_attr_code_encode(&code_eq_orp_is_nesn, cl, 0); + d->eq.verb |= 1 << QB_ENQUEUE_CMD_ORP_ENABLE_SHIFT; + d->eq.verb &= ~QB_ENQUEUE_CMD_EC_OPTION_MASK; + d->eq.orpid = opr_id; + d->eq.seqnum = seqnum; + d->eq.seqnum &= ~(1 << QB_ENQUEUE_CMD_NLIS_SHIFT); + d->eq.seqnum &= ~(1 << QB_ENQUEUE_CMD_IS_NESN_SHIFT); } -void qbman_eq_desc_set_orp_nesn(struct qbman_eq_desc *d, uint32_t opr_id, - uint32_t seqnum) +void qbman_eq_desc_set_orp_nesn(struct qbman_eq_desc *d, uint16_t opr_id, + uint16_t seqnum) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_orp_en, cl, 1); - qb_attr_code_encode(&code_eq_cmd, cl, qbman_eq_cmd_empty); - qb_attr_code_encode(&code_eq_opr_id, cl, opr_id); - qb_attr_code_encode(&code_eq_orp_seqnum, cl, seqnum); - qb_attr_code_encode(&code_eq_orp_nlis, cl, 0); - qb_attr_code_encode(&code_eq_orp_is_nesn, cl, 1); + d->eq.verb |= 1 << QB_ENQUEUE_CMD_ORP_ENABLE_SHIFT; + d->eq.verb &= ~QB_ENQUEUE_CMD_EC_OPTION_MASK; + d->eq.orpid = opr_id; + d->eq.seqnum = seqnum; + d->eq.seqnum &= ~(1 << QB_ENQUEUE_CMD_NLIS_SHIFT); + d->eq.seqnum |= 1 << QB_ENQUEUE_CMD_IS_NESN_SHIFT; } void qbman_eq_desc_set_response(struct qbman_eq_desc *d, dma_addr_t storage_phys, int stash) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode_64(&code_eq_rsp_lo, (uint64_t *)cl, storage_phys); - qb_attr_code_encode(&code_eq_rsp_stash, cl, !!stash); + d->eq.rsp_addr = storage_phys; + d->eq.wae = stash; } void qbman_eq_desc_set_token(struct qbman_eq_desc *d, uint8_t token) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_rsp_id, cl, (uint32_t)token); + d->eq.rspid = token; } void qbman_eq_desc_set_fq(struct qbman_eq_desc *d, uint32_t fqid) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_qd_en, cl, 0); - qb_attr_code_encode(&code_eq_tgt_id, cl, fqid); + d->eq.verb &= ~(1 << QB_ENQUEUE_CMD_TARGET_TYPE_SHIFT); + d->eq.tgtid = fqid; } void qbman_eq_desc_set_qd(struct qbman_eq_desc *d, uint32_t qdid, - uint32_t qd_bin, uint32_t qd_prio) + uint16_t qd_bin, uint8_t qd_prio) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_qd_en, cl, 1); - qb_attr_code_encode(&code_eq_tgt_id, cl, qdid); - qb_attr_code_encode(&code_eq_qd_bin, cl, qd_bin); - qb_attr_code_encode(&code_eq_qd_pri, cl, qd_prio); + d->eq.verb |= 1 << QB_ENQUEUE_CMD_TARGET_TYPE_SHIFT; + d->eq.tgtid = qdid; + d->eq.qdbin = qd_bin; + d->eq.qpri = qd_prio; } void qbman_eq_desc_set_eqdi(struct qbman_eq_desc *d, int enable) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_eqdi, cl, !!enable); + if (enable) + d->eq.verb |= 1 << QB_ENQUEUE_CMD_IRQ_ON_DISPATCH_SHIFT; + else + d->eq.verb &= ~(1 << QB_ENQUEUE_CMD_IRQ_ON_DISPATCH_SHIFT); } void qbman_eq_desc_set_dca(struct qbman_eq_desc *d, int enable, - uint32_t dqrr_idx, int park) + uint8_t dqrr_idx, int park) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_eq_dca_en, cl, !!enable); if (enable) { - qb_attr_code_encode(&code_eq_dca_pk, cl, !!park); - qb_attr_code_encode(&code_eq_dca_idx, cl, dqrr_idx); + d->eq.dca = dqrr_idx; + if (park) + d->eq.dca |= 1 << QB_ENQUEUE_CMD_DCA_PK_SHIFT; + else + d->eq.dca &= ~(1 << QB_ENQUEUE_CMD_DCA_PK_SHIFT); + d->eq.dca |= 1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT; + } else { + d->eq.dca &= ~(1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT); } } #define EQAR_IDX(eqar) ((eqar) & 0x7) #define EQAR_VB(eqar) ((eqar) & 0x80) #define EQAR_SUCCESS(eqar) ((eqar) & 0x100) + static int qbman_swp_enqueue_array_mode(struct qbman_swp *s, const struct qbman_eq_desc *d, - const struct qbman_fd *fd) + const struct qbman_fd *fd) { uint32_t *p; const uint32_t *cl = qb_cl(d); @@ -477,20 +456,20 @@ static int qbman_swp_enqueue_array_mode(struct qbman_swp *s, if (!EQAR_SUCCESS(eqar)) return -EBUSY; p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); + QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], fd, sizeof(*fd)); /* Set the verb byte, have to substitute in the valid-bit */ lwsync(); p[0] = cl[0] | EQAR_VB(eqar); qbman_cena_write_complete_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); + QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar))); return 0; } static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, const struct qbman_eq_desc *d, - const struct qbman_fd *fd) + const struct qbman_fd *fd) { uint32_t *p; const uint32_t *cl = qb_cl(d); @@ -509,19 +488,21 @@ static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s, } p = qbman_cena_write_start_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); + QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], fd, sizeof(*fd)); lwsync(); + /* Set the verb byte, have to substitute in the valid-bit */ p[0] = cl[0] | s->eqcr.pi_vb; qbman_cena_write_complete_wo_shadow(&s->sys, - QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); + QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7)); s->eqcr.pi++; s->eqcr.pi &= 0xF; s->eqcr.available--; if (!(s->eqcr.pi & 7)) s->eqcr.pi_vb ^= QB_VALID_BIT; + return 0; } @@ -672,23 +653,26 @@ int qbman_swp_enqueue_multiple_desc(struct qbman_swp *s, void qbman_swp_push_get(struct qbman_swp *s, uint8_t channel_idx, int *enabled) { - struct qb_attr_code code = CODE_SDQCR_DQSRC(channel_idx); + uint16_t src = (s->sdq >> QB_SDQCR_SRC_SHIFT) & QB_SDQCR_SRC_MASK; QBMAN_BUG_ON(channel_idx > 15); - *enabled = (int)qb_attr_code_decode(&code, &s->sdq); + *enabled = src | (1 << channel_idx); } void qbman_swp_push_set(struct qbman_swp *s, uint8_t channel_idx, int enable) { uint16_t dqsrc; - struct qb_attr_code code = CODE_SDQCR_DQSRC(channel_idx); QBMAN_BUG_ON(channel_idx > 15); - qb_attr_code_encode(&code, &s->sdq, !!enable); + if (enable) + s->sdq |= 1 << channel_idx; + else + s->sdq &= ~(1 << channel_idx); + /* Read make the complete src map. If no channels are enabled * the SDQCR must be 0 or else QMan will assert errors */ - dqsrc = (uint16_t)qb_attr_code_decode(&code_sdqcr_dqsrc, &s->sdq); + dqsrc = (s->sdq >> QB_SDQCR_SRC_SHIFT) & QB_SDQCR_SRC_MASK; if (dqsrc != 0) qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_SDQCR, s->sdq); else @@ -700,14 +684,10 @@ void qbman_swp_push_set(struct qbman_swp *s, uint8_t channel_idx, int enable) /***************************/ /* These should be const, eventually */ -static struct qb_attr_code code_pull_dct = QB_CODE(0, 0, 2); -static struct qb_attr_code code_pull_dt = QB_CODE(0, 2, 2); -static struct qb_attr_code code_pull_rls = QB_CODE(0, 4, 1); -static struct qb_attr_code code_pull_stash = QB_CODE(0, 5, 1); -static struct qb_attr_code code_pull_numframes = QB_CODE(0, 8, 5); -static struct qb_attr_code code_pull_token = QB_CODE(0, 16, 8); -static struct qb_attr_code code_pull_dqsource = QB_CODE(1, 0, 24); -static struct qb_attr_code code_pull_rsp_lo = QB_CODE(2, 0, 32); +#define QB_VDQCR_VERB_DCT_SHIFT 0 +#define QB_VDQCR_VERB_DT_SHIFT 2 +#define QB_VDQCR_VERB_RLS_SHIFT 4 +#define QB_VDQCR_VERB_WAE_SHIFT 5 enum qb_pull_dt_e { qb_pull_dt_channel, @@ -725,62 +705,52 @@ void qbman_pull_desc_set_storage(struct qbman_pull_desc *d, dma_addr_t storage_phys, int stash) { - uint32_t *cl = qb_cl(d); - /* Squiggle the pointer 'storage' into the extra 2 words of the - * descriptor (which aren't copied to the hw command) - */ - *(void **)&cl[4] = storage; + d->pull.rsp_addr_virt = (uint64_t)storage; + if (!storage) { - qb_attr_code_encode(&code_pull_rls, cl, 0); + d->pull.verb &= ~(1 << QB_VDQCR_VERB_RLS_SHIFT); return; } - qb_attr_code_encode(&code_pull_rls, cl, 1); - qb_attr_code_encode(&code_pull_stash, cl, !!stash); - qb_attr_code_encode_64(&code_pull_rsp_lo, (uint64_t *)cl, storage_phys); + d->pull.verb |= 1 << QB_VDQCR_VERB_RLS_SHIFT; + if (stash) + d->pull.verb |= 1 << QB_VDQCR_VERB_WAE_SHIFT; + else + d->pull.verb &= ~(1 << QB_VDQCR_VERB_WAE_SHIFT); + + d->pull.rsp_addr = storage_phys; } void qbman_pull_desc_set_numframes(struct qbman_pull_desc *d, uint8_t numframes) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_pull_numframes, cl, - (uint32_t)(numframes - 1)); + d->pull.numf = numframes - 1; } void qbman_pull_desc_set_token(struct qbman_pull_desc *d, uint8_t token) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_pull_token, cl, token); + d->pull.tok = token; } void qbman_pull_desc_set_fq(struct qbman_pull_desc *d, uint32_t fqid) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_pull_dct, cl, 1); - qb_attr_code_encode(&code_pull_dt, cl, qb_pull_dt_framequeue); - qb_attr_code_encode(&code_pull_dqsource, cl, fqid); + d->pull.verb |= 1 << QB_VDQCR_VERB_DCT_SHIFT; + d->pull.verb |= qb_pull_dt_framequeue << QB_VDQCR_VERB_DT_SHIFT; + d->pull.dq_src = fqid; } void qbman_pull_desc_set_wq(struct qbman_pull_desc *d, uint32_t wqid, enum qbman_pull_type_e dct) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_pull_dct, cl, dct); - qb_attr_code_encode(&code_pull_dt, cl, qb_pull_dt_workqueue); - qb_attr_code_encode(&code_pull_dqsource, cl, wqid); + d->pull.verb |= dct << QB_VDQCR_VERB_DCT_SHIFT; + d->pull.verb |= qb_pull_dt_workqueue << QB_VDQCR_VERB_DT_SHIFT; + d->pull.dq_src = wqid; } void qbman_pull_desc_set_channel(struct qbman_pull_desc *d, uint32_t chid, enum qbman_pull_type_e dct) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_pull_dct, cl, dct); - qb_attr_code_encode(&code_pull_dt, cl, qb_pull_dt_channel); - qb_attr_code_encode(&code_pull_dqsource, cl, chid); + d->pull.verb |= dct << QB_VDQCR_VERB_DCT_SHIFT; + d->pull.verb |= qb_pull_dt_channel << QB_VDQCR_VERB_DT_SHIFT; + d->pull.dq_src = chid; } int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) @@ -792,18 +762,18 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) atomic_inc(&s->vdq.busy); return -EBUSY; } - s->vdq.storage = *(void **)&cl[4]; - /* We use portal index +1 as token so that 0 still indicates - * that the result isn't valid yet. - */ - qb_attr_code_encode(&code_pull_token, cl, s->desc.idx + 1); + + d->pull.tok = s->sys.idx + 1; + s->vdq.storage = (void *)d->pull.rsp_addr_virt; p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_VDQCR); memcpy(&p[1], &cl[1], 12); + /* Set the verb byte, have to substitute in the valid-bit */ lwsync(); p[0] = cl[0] | s->vdq.valid_bit; s->vdq.valid_bit ^= QB_VALID_BIT; qbman_cena_write_complete_wo_shadow(&s->sys, QBMAN_CENA_SWP_VDQCR); + return 0; } @@ -811,16 +781,7 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) /* Polling DQRR */ /****************/ -static struct qb_attr_code code_dqrr_verb = QB_CODE(0, 0, 8); -static struct qb_attr_code code_dqrr_response = QB_CODE(0, 0, 7); -static struct qb_attr_code code_dqrr_stat = QB_CODE(0, 8, 8); -static struct qb_attr_code code_dqrr_seqnum = QB_CODE(0, 16, 14); -static struct qb_attr_code code_dqrr_odpid = QB_CODE(1, 0, 16); -/* static struct qb_attr_code code_dqrr_tok = QB_CODE(1, 24, 8); */ -static struct qb_attr_code code_dqrr_fqid = QB_CODE(2, 0, 24); -static struct qb_attr_code code_dqrr_byte_count = QB_CODE(4, 0, 32); -static struct qb_attr_code code_dqrr_frame_count = QB_CODE(5, 0, 24); -static struct qb_attr_code code_dqrr_ctx_lo = QB_CODE(6, 0, 32); +#define QMAN_DQRR_PI_MASK 0xf #define QBMAN_RESULT_DQ 0x60 #define QBMAN_RESULT_FQRN 0x21 @@ -833,8 +794,6 @@ static struct qb_attr_code code_dqrr_ctx_lo = QB_CODE(6, 0, 32); #define QBMAN_RESULT_BPSCN 0x29 #define QBMAN_RESULT_CSCN_WQ 0x2a -static struct qb_attr_code code_dqpi_pi = QB_CODE(0, 0, 4); - /* NULL return if there are no unconsumed DQRR entries. Returns a DQRR entry * only once, so repeated calls can return a sequence of DQRR entries, without * requiring they be consumed immediately or in any particular order. @@ -844,8 +803,7 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) uint32_t verb; uint32_t response_verb; uint32_t flags; - const struct qbman_result *dq; - const uint32_t *p; + const struct qbman_result *p; /* Before using valid-bit to detect if something is there, we have to * handle the case of the DQRR reset bug... @@ -858,11 +816,13 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) * will be much less efficient than all subsequent trips around * it... */ - uint32_t dqpi = qbman_cinh_read(&s->sys, QBMAN_CINH_SWP_DQPI); - uint32_t pi = qb_attr_code_decode(&code_dqpi_pi, &dqpi); + uint8_t pi = qbman_cinh_read(&s->sys, QBMAN_CINH_SWP_DQPI) & + QMAN_DQRR_PI_MASK; + /* there are new entries if pi != next_idx */ if (pi == s->dqrr.next_idx) return NULL; + /* if next_idx is/was the last ring index, and 'pi' is * different, we can disable the workaround as all the ring * entries have now been DMA'd to so valid-bit checking is @@ -877,12 +837,12 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) s->dqrr.reset_bug = 0; } qbman_cena_invalidate_prefetch(&s->sys, - QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); + QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); } - dq = qbman_cena_read_wo_shadow(&s->sys, - QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); - p = qb_cl(dq); - verb = qb_attr_code_decode(&code_dqrr_verb, p); + p = qbman_cena_read_wo_shadow(&s->sys, + QBMAN_CENA_SWP_DQRR(s->dqrr.next_idx)); + verb = p->dq.verb; + /* If the valid-bit isn't of the expected polarity, nothing there. Note, * in the DQRR reset bug workaround, we shouldn't need to skip these * check, because we've already determined that a new entry is available @@ -902,16 +862,16 @@ const struct qbman_result *qbman_swp_dqrr_next(struct qbman_swp *s) s->dqrr.valid_bit ^= QB_VALID_BIT; } /* If this is the final response to a volatile dequeue command - * indicate that the vdq is no longer busy. + * indicate that the vdq is no longer busy */ - flags = qbman_result_DQ_flags(dq); - response_verb = qb_attr_code_decode(&code_dqrr_response, &verb); + flags = p->dq.stat; + response_verb = verb & QMAN_RESPONSE_VERB_MASK; if ((response_verb == QBMAN_RESULT_DQ) && (flags & QBMAN_DQ_STAT_VOLATILE) && (flags & QBMAN_DQ_STAT_EXPIRED)) atomic_inc(&s->vdq.busy); - return dq; + return p; } /* Consume DQRR entries previously returned from qbman_swp_dqrr_next(). */ @@ -924,80 +884,69 @@ void qbman_swp_dqrr_consume(struct qbman_swp *s, /*********************************/ /* Polling user-provided storage */ /*********************************/ - -int qbman_result_has_new_result(__attribute__((unused)) struct qbman_swp *s, - const struct qbman_result *dq) +int qbman_result_has_new_result(struct qbman_swp *s, + struct qbman_result *dq) { - /* To avoid converting the little-endian DQ entry to host-endian prior - * to us knowing whether there is a valid entry or not (and run the - * risk of corrupting the incoming hardware LE write), we detect in - * hardware endianness rather than host. This means we need a different - * "code" depending on whether we are BE or LE in software, which is - * where DQRR_TOK_OFFSET comes in... + if (dq->dq.tok == 0) + return 0; + + /* + * Set token to be 0 so we will detect change back to 1 + * next time the looping is traversed. Const is cast away here + * as we want users to treat the dequeue responses as read only. */ - static struct qb_attr_code code_dqrr_tok_detect = - QB_CODE(0, DQRR_TOK_OFFSET, 8); - /* The user trying to poll for a result treats "dq" as const. It is - * however the same address that was provided to us non-const in the - * first place, for directing hardware DMA to. So we can cast away the - * const because it is mutable from our perspective. + ((struct qbman_result *)dq)->dq.tok = 0; + + /* + * VDQCR "no longer busy" hook - not quite the same as DQRR, because the + * fact "VDQCR" shows busy doesn't mean that we hold the result that + * makes it available. Eg. we may be looking at our 10th dequeue result, + * having released VDQCR after the 1st result and it is now busy due to + * some other command! */ - uint32_t *p = (uint32_t *)(unsigned long)qb_cl(dq); - uint32_t token; + if (s->vdq.storage == dq) { + s->vdq.storage = NULL; + atomic_inc(&s->vdq.busy); + } + + return 1; +} - token = qb_attr_code_decode(&code_dqrr_tok_detect, &p[1]); - if (token == 0) +int qbman_check_new_result(struct qbman_result *dq) +{ + if (dq->dq.tok == 0) return 0; - /* Entry is valid - overwrite token back to 0 so - * a) If this memory is reused tokesn will be 0 - * b) If someone calls "has_new_result()" again on this entry it - * will not appear to be new - */ - qb_attr_code_encode(&code_dqrr_tok_detect, &p[1], 0); - /* Only now do we convert from hardware to host endianness. Also, as we - * are returning success, the user has promised not to call us again, so - * there's no risk of us converting the endianness twice... + /* + * Set token to be 0 so we will detect change back to 1 + * next time the looping is traversed. Const is cast away here + * as we want users to treat the dequeue responses as read only. */ - make_le32_n(p, 16); + ((struct qbman_result *)dq)->dq.tok = 0; + return 1; } -int qbman_check_command_complete(struct qbman_swp *s, - const struct qbman_result *dq) +int qbman_check_command_complete(struct qbman_result *dq) { - /* To avoid converting the little-endian DQ entry to host-endian prior - * to us knowing whether there is a valid entry or not (and run the - * risk of corrupting the incoming hardware LE write), we detect in - * hardware endianness rather than host. This means we need a different - * "code" depending on whether we are BE or LE in software, which is - * where DQRR_TOK_OFFSET comes in... - */ - static struct qb_attr_code code_dqrr_tok_detect = - QB_CODE(0, DQRR_TOK_OFFSET, 8); - /* The user trying to poll for a result treats "dq" as const. It is - * however the same address that was provided to us non-const in the - * first place, for directing hardware DMA to. So we can cast away the - * const because it is mutable from our perspective. - */ - uint32_t *p = (uint32_t *)(unsigned long)qb_cl(dq); - uint32_t token; + struct qbman_swp *s; - token = qb_attr_code_decode(&code_dqrr_tok_detect, &p[1]); - if (token == 0) + if (dq->dq.tok == 0) return 0; - /* TODO: Remove qbman_swp from parameters and make it a local - * once we've tested the reserve portal map change - */ - s = portal_idx_map[token - 1]; - /* When token is set it indicates that VDQ command has been fetched - * by qbman and is working on it. It is safe for software to issue - * another VDQ command, so incrementing the busy variable. + + s = portal_idx_map[dq->dq.tok - 1]; + /* + * VDQCR "no longer busy" hook - not quite the same as DQRR, because the + * fact "VDQCR" shows busy doesn't mean that we hold the result that + * makes it available. Eg. we may be looking at our 10th dequeue result, + * having released VDQCR after the 1st result and it is now busy due to + * some other command! */ if (s->vdq.storage == dq) { s->vdq.storage = NULL; atomic_inc(&s->vdq.busy); } + return 1; } @@ -1005,23 +954,10 @@ int qbman_check_command_complete(struct qbman_swp *s, /* Categorising qbman results */ /********************************/ -static struct qb_attr_code code_result_in_mem = - QB_CODE(0, QBMAN_RESULT_VERB_OFFSET_IN_MEM, 7); - static inline int __qbman_result_is_x(const struct qbman_result *dq, - uint32_t x) -{ - const uint32_t *p = qb_cl(dq); - uint32_t response_verb = qb_attr_code_decode(&code_dqrr_response, p); - - return (response_verb == x); -} - -static inline int __qbman_result_is_x_in_mem(const struct qbman_result *dq, - uint32_t x) + uint8_t x) { - const uint32_t *p = qb_cl(dq); - uint32_t response_verb = qb_attr_code_decode(&code_result_in_mem, p); + uint8_t response_verb = dq->dq.verb & QMAN_RESPONSE_VERB_MASK; return (response_verb == x); } @@ -1043,28 +979,28 @@ int qbman_result_is_CDAN(const struct qbman_result *dq) int qbman_result_is_CSCN(const struct qbman_result *dq) { - return __qbman_result_is_x_in_mem(dq, QBMAN_RESULT_CSCN_MEM) || + return __qbman_result_is_x(dq, QBMAN_RESULT_CSCN_MEM) || __qbman_result_is_x(dq, QBMAN_RESULT_CSCN_WQ); } int qbman_result_is_BPSCN(const struct qbman_result *dq) { - return __qbman_result_is_x_in_mem(dq, QBMAN_RESULT_BPSCN); + return __qbman_result_is_x(dq, QBMAN_RESULT_BPSCN); } int qbman_result_is_CGCU(const struct qbman_result *dq) { - return __qbman_result_is_x_in_mem(dq, QBMAN_RESULT_CGCU); + return __qbman_result_is_x(dq, QBMAN_RESULT_CGCU); } int qbman_result_is_FQRN(const struct qbman_result *dq) { - return __qbman_result_is_x_in_mem(dq, QBMAN_RESULT_FQRN); + return __qbman_result_is_x(dq, QBMAN_RESULT_FQRN); } int qbman_result_is_FQRNI(const struct qbman_result *dq) { - return __qbman_result_is_x_in_mem(dq, QBMAN_RESULT_FQRNI); + return __qbman_result_is_x(dq, QBMAN_RESULT_FQRNI); } int qbman_result_is_FQPN(const struct qbman_result *dq) @@ -1078,109 +1014,62 @@ int qbman_result_is_FQPN(const struct qbman_result *dq) /* These APIs assume qbman_result_is_DQ() is TRUE */ -uint32_t qbman_result_DQ_flags(const struct qbman_result *dq) +uint8_t qbman_result_DQ_flags(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return qb_attr_code_decode(&code_dqrr_stat, p); + return dq->dq.stat; } uint16_t qbman_result_DQ_seqnum(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return (uint16_t)qb_attr_code_decode(&code_dqrr_seqnum, p); + return dq->dq.seqnum; } uint16_t qbman_result_DQ_odpid(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return (uint16_t)qb_attr_code_decode(&code_dqrr_odpid, p); + return dq->dq.oprid; } uint32_t qbman_result_DQ_fqid(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return qb_attr_code_decode(&code_dqrr_fqid, p); + return dq->dq.fqid; } uint32_t qbman_result_DQ_byte_count(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return qb_attr_code_decode(&code_dqrr_byte_count, p); + return dq->dq.fq_byte_cnt; } uint32_t qbman_result_DQ_frame_count(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return qb_attr_code_decode(&code_dqrr_frame_count, p); + return dq->dq.fq_frm_cnt; } uint64_t qbman_result_DQ_fqd_ctx(const struct qbman_result *dq) { - const uint64_t *p = (const uint64_t *)qb_cl(dq); - - return qb_attr_code_decode_64(&code_dqrr_ctx_lo, p); + return dq->dq.fqd_ctx; } const struct qbman_fd *qbman_result_DQ_fd(const struct qbman_result *dq) { - const uint32_t *p = qb_cl(dq); - - return (const struct qbman_fd *)&p[8]; + return (const struct qbman_fd *)&dq->dq.fd[0]; } /**************************************/ /* Parsing state-change notifications */ /**************************************/ - -static struct qb_attr_code code_scn_state = QB_CODE(0, 16, 8); -static struct qb_attr_code code_scn_rid = QB_CODE(1, 0, 24); -static struct qb_attr_code code_scn_state_in_mem = - QB_CODE(0, SCN_STATE_OFFSET_IN_MEM, 8); -static struct qb_attr_code code_scn_rid_in_mem = - QB_CODE(1, SCN_RID_OFFSET_IN_MEM, 24); -static struct qb_attr_code code_scn_ctx_lo = QB_CODE(2, 0, 32); - uint8_t qbman_result_SCN_state(const struct qbman_result *scn) { - const uint32_t *p = qb_cl(scn); - - return (uint8_t)qb_attr_code_decode(&code_scn_state, p); + return scn->scn.state; } uint32_t qbman_result_SCN_rid(const struct qbman_result *scn) { - const uint32_t *p = qb_cl(scn); - - return qb_attr_code_decode(&code_scn_rid, p); + return scn->scn.rid_tok; } uint64_t qbman_result_SCN_ctx(const struct qbman_result *scn) { - const uint64_t *p = (const uint64_t *)qb_cl(scn); - - return qb_attr_code_decode_64(&code_scn_ctx_lo, p); -} - -uint8_t qbman_result_SCN_state_in_mem(const struct qbman_result *scn) -{ - const uint32_t *p = qb_cl(scn); - - return (uint8_t)qb_attr_code_decode(&code_scn_state_in_mem, p); -} - -uint32_t qbman_result_SCN_rid_in_mem(const struct qbman_result *scn) -{ - const uint32_t *p = qb_cl(scn); - uint32_t result_rid; - - result_rid = qb_attr_code_decode(&code_scn_rid_in_mem, p); - return make_le24(result_rid); + return scn->scn.ctx; } /*****************/ @@ -1188,22 +1077,22 @@ uint32_t qbman_result_SCN_rid_in_mem(const struct qbman_result *scn) /*****************/ uint16_t qbman_result_bpscn_bpid(const struct qbman_result *scn) { - return (uint16_t)qbman_result_SCN_rid_in_mem(scn) & 0x3FFF; + return (uint16_t)qbman_result_SCN_rid(scn) & 0x3FFF; } int qbman_result_bpscn_has_free_bufs(const struct qbman_result *scn) { - return !(int)(qbman_result_SCN_state_in_mem(scn) & 0x1); + return !(int)(qbman_result_SCN_state(scn) & 0x1); } int qbman_result_bpscn_is_depleted(const struct qbman_result *scn) { - return (int)(qbman_result_SCN_state_in_mem(scn) & 0x2); + return (int)(qbman_result_SCN_state(scn) & 0x2); } int qbman_result_bpscn_is_surplus(const struct qbman_result *scn) { - return (int)(qbman_result_SCN_state_in_mem(scn) & 0x4); + return (int)(qbman_result_SCN_state(scn) & 0x4); } uint64_t qbman_result_bpscn_ctx(const struct qbman_result *scn) @@ -1214,6 +1103,7 @@ uint64_t qbman_result_bpscn_ctx(const struct qbman_result *scn) ctx = qbman_result_SCN_ctx(scn); ctx_hi = upper32(ctx); ctx_lo = lower32(ctx); + return ((uint64_t)make_le32(ctx_hi) << 32 | (uint64_t)make_le32(ctx_lo)); } @@ -1223,7 +1113,7 @@ uint64_t qbman_result_bpscn_ctx(const struct qbman_result *scn) /*****************/ uint16_t qbman_result_cgcu_cgid(const struct qbman_result *scn) { - return (uint16_t)qbman_result_SCN_rid_in_mem(scn) & 0xFFFF; + return (uint16_t)qbman_result_SCN_rid(scn) & 0xFFFF; } uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn) @@ -1234,6 +1124,7 @@ uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn) ctx = qbman_result_SCN_ctx(scn); ctx_hi = upper32(ctx); ctx_lo = lower32(ctx); + return ((uint64_t)(make_le32(ctx_hi) & 0xFF) << 32) | (uint64_t)make_le32(ctx_lo); } @@ -1241,34 +1132,26 @@ uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn) /******************/ /* Buffer release */ /******************/ - -/* These should be const, eventually */ -/* static struct qb_attr_code code_release_num = QB_CODE(0, 0, 3); */ -static struct qb_attr_code code_release_set_me = QB_CODE(0, 5, 1); -static struct qb_attr_code code_release_rcdi = QB_CODE(0, 6, 1); -static struct qb_attr_code code_release_bpid = QB_CODE(0, 16, 16); +#define QB_BR_RC_VALID_SHIFT 5 +#define QB_BR_RCDI_SHIFT 6 void qbman_release_desc_clear(struct qbman_release_desc *d) { - uint32_t *cl; - memset(d, 0, sizeof(*d)); - cl = qb_cl(d); - qb_attr_code_encode(&code_release_set_me, cl, 1); + d->br.verb = 1 << QB_BR_RC_VALID_SHIFT; } -void qbman_release_desc_set_bpid(struct qbman_release_desc *d, uint32_t bpid) +void qbman_release_desc_set_bpid(struct qbman_release_desc *d, uint16_t bpid) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_release_bpid, cl, bpid); + d->br.bpid = bpid; } void qbman_release_desc_set_rcdi(struct qbman_release_desc *d, int enable) { - uint32_t *cl = qb_cl(d); - - qb_attr_code_encode(&code_release_rcdi, cl, !!enable); + if (enable) + d->br.verb |= 1 << QB_BR_RCDI_SHIFT; + else + d->br.verb &= ~(1 << QB_BR_RCDI_SHIFT); } #define RAR_IDX(rar) ((rar) & 0x7) @@ -1285,12 +1168,16 @@ int qbman_swp_release(struct qbman_swp *s, const struct qbman_release_desc *d, pr_debug("RAR=%08x\n", rar); if (!RAR_SUCCESS(rar)) return -EBUSY; + QBMAN_BUG_ON(!num_buffers || (num_buffers > 7)); + /* Start the release command */ p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_RCR(RAR_IDX(rar))); + /* Copy the caller's buffer pointers to the command */ u64_to_le32_copy(&p[2], buffers, num_buffers); + /* Set the verb byte, have to substitute in the valid-bit and the number * of buffers. */ @@ -1298,25 +1185,38 @@ int qbman_swp_release(struct qbman_swp *s, const struct qbman_release_desc *d, p[0] = cl[0] | RAR_VB(rar) | num_buffers; qbman_cena_write_complete_wo_shadow(&s->sys, QBMAN_CENA_SWP_RCR(RAR_IDX(rar))); + return 0; } /*******************/ /* Buffer acquires */ /*******************/ +struct qbman_acquire_desc { + uint8_t verb; + uint8_t reserved; + uint16_t bpid; + uint8_t num; + uint8_t reserved2[59]; +}; -/* These should be const, eventually */ -static struct qb_attr_code code_acquire_bpid = QB_CODE(0, 16, 16); -static struct qb_attr_code code_acquire_num = QB_CODE(1, 0, 3); -static struct qb_attr_code code_acquire_r_num = QB_CODE(1, 0, 3); +struct qbman_acquire_rslt { + uint8_t verb; + uint8_t rslt; + uint16_t reserved; + uint8_t num; + uint8_t reserved2[3]; + uint64_t buf[7]; +}; -int qbman_swp_acquire(struct qbman_swp *s, uint32_t bpid, uint64_t *buffers, +int qbman_swp_acquire(struct qbman_swp *s, uint16_t bpid, uint64_t *buffers, unsigned int num_buffers) { - uint32_t *p; - uint32_t rslt, num; + struct qbman_acquire_desc *p; + struct qbman_acquire_rslt *r; - QBMAN_BUG_ON(!num_buffers || (num_buffers > 7)); + if (!num_buffers || (num_buffers > 7)) + return -EINVAL; /* Start the management command */ p = qbman_swp_mc_start(s); @@ -1325,59 +1225,81 @@ int qbman_swp_acquire(struct qbman_swp *s, uint32_t bpid, uint64_t *buffers, return -EBUSY; /* Encode the caller-provided attributes */ - qb_attr_code_encode(&code_acquire_bpid, p, bpid); - qb_attr_code_encode(&code_acquire_num, p, num_buffers); + p->bpid = bpid; + p->num = num_buffers; /* Complete the management command */ - p = qbman_swp_mc_complete(s, p, p[0] | QBMAN_MC_ACQUIRE); + r = qbman_swp_mc_complete(s, p, QBMAN_MC_ACQUIRE); + if (unlikely(!r)) { + pr_err("qbman: acquire from BPID %d failed, no response\n", + bpid); + return -EIO; + } /* Decode the outcome */ - rslt = qb_attr_code_decode(&code_generic_rslt, p); - num = qb_attr_code_decode(&code_acquire_r_num, p); - QBMAN_BUG_ON(qb_attr_code_decode(&code_generic_verb, p) != - QBMAN_MC_ACQUIRE); + QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_MC_ACQUIRE); /* Determine success or failure */ - if (unlikely(rslt != QBMAN_MC_RSLT_OK)) { + if (unlikely(r->rslt != QBMAN_MC_RSLT_OK)) { pr_err("Acquire buffers from BPID 0x%x failed, code=0x%02x\n", - bpid, rslt); + bpid, r->rslt); return -EIO; } - QBMAN_BUG_ON(num > num_buffers); + + QBMAN_BUG_ON(r->num > num_buffers); + /* Copy the acquired buffers to the caller's array */ - u64_from_le32_copy(buffers, &p[2], num); - return (int)num; + u64_from_le32_copy(buffers, &r->buf[0], r->num); + + return (int)r->num; } /*****************/ /* FQ management */ /*****************/ +struct qbman_alt_fq_state_desc { + uint8_t verb; + uint8_t reserved[3]; + uint32_t fqid; + uint8_t reserved2[56]; +}; + +struct qbman_alt_fq_state_rslt { + uint8_t verb; + uint8_t rslt; + uint8_t reserved[62]; +}; -static struct qb_attr_code code_fqalt_fqid = QB_CODE(1, 0, 32); +#define ALT_FQ_FQID_MASK 0x00FFFFFF static int qbman_swp_alt_fq_state(struct qbman_swp *s, uint32_t fqid, uint8_t alt_fq_verb) { - uint32_t *p; - uint32_t rslt; + struct qbman_alt_fq_state_desc *p; + struct qbman_alt_fq_state_rslt *r; /* Start the management command */ p = qbman_swp_mc_start(s); if (!p) return -EBUSY; - qb_attr_code_encode(&code_fqalt_fqid, p, fqid); + p->fqid = fqid & ALT_FQ_FQID_MASK; + /* Complete the management command */ - p = qbman_swp_mc_complete(s, p, p[0] | alt_fq_verb); + r = qbman_swp_mc_complete(s, p, alt_fq_verb); + if (unlikely(!r)) { + pr_err("qbman: mgmt cmd failed, no response (verb=0x%x)\n", + alt_fq_verb); + return -EIO; + } /* Decode the outcome */ - rslt = qb_attr_code_decode(&code_generic_rslt, p); - QBMAN_BUG_ON(qb_attr_code_decode(&code_generic_verb, p) != alt_fq_verb); + QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != alt_fq_verb); /* Determine success or failure */ - if (unlikely(rslt != QBMAN_MC_RSLT_OK)) { + if (unlikely(r->rslt != QBMAN_MC_RSLT_OK)) { pr_err("ALT FQID %d failed: verb = 0x%08x, code = 0x%02x\n", - fqid, alt_fq_verb, rslt); + fqid, alt_fq_verb, r->rslt); return -EIO; } @@ -1408,10 +1330,24 @@ int qbman_swp_fq_xoff(struct qbman_swp *s, uint32_t fqid) /* Channel management */ /**********************/ -static struct qb_attr_code code_cdan_cid = QB_CODE(0, 16, 12); -static struct qb_attr_code code_cdan_we = QB_CODE(1, 0, 8); -static struct qb_attr_code code_cdan_en = QB_CODE(1, 8, 1); -static struct qb_attr_code code_cdan_ctx_lo = QB_CODE(2, 0, 32); +struct qbman_cdan_ctrl_desc { + uint8_t verb; + uint8_t reserved; + uint16_t ch; + uint8_t we; + uint8_t ctrl; + uint16_t reserved2; + uint64_t cdan_ctx; + uint8_t reserved3[48]; + +}; + +struct qbman_cdan_ctrl_rslt { + uint8_t verb; + uint8_t rslt; + uint16_t ch; + uint8_t reserved[60]; +}; /* Hide "ICD" for now as we don't use it, don't set it, and don't test it, so it * would be irresponsible to expose it. @@ -1423,8 +1359,8 @@ static int qbman_swp_CDAN_set(struct qbman_swp *s, uint16_t channelid, uint8_t we_mask, uint8_t cdan_en, uint64_t ctx) { - uint32_t *p; - uint32_t rslt; + struct qbman_cdan_ctrl_desc *p; + struct qbman_cdan_ctrl_rslt *r; /* Start the management command */ p = qbman_swp_mc_start(s); @@ -1432,22 +1368,29 @@ static int qbman_swp_CDAN_set(struct qbman_swp *s, uint16_t channelid, return -EBUSY; /* Encode the caller-provided attributes */ - qb_attr_code_encode(&code_cdan_cid, p, channelid); - qb_attr_code_encode(&code_cdan_we, p, we_mask); - qb_attr_code_encode(&code_cdan_en, p, cdan_en); - qb_attr_code_encode_64(&code_cdan_ctx_lo, (uint64_t *)p, ctx); + p->ch = channelid; + p->we = we_mask; + if (cdan_en) + p->ctrl = 1; + else + p->ctrl = 0; + p->cdan_ctx = ctx; + /* Complete the management command */ - p = qbman_swp_mc_complete(s, p, p[0] | QBMAN_WQCHAN_CONFIGURE); + r = qbman_swp_mc_complete(s, p, QBMAN_WQCHAN_CONFIGURE); + if (unlikely(!r)) { + pr_err("qbman: wqchan config failed, no response\n"); + return -EIO; + } /* Decode the outcome */ - rslt = qb_attr_code_decode(&code_generic_rslt, p); - QBMAN_BUG_ON(qb_attr_code_decode(&code_generic_verb, p) - != QBMAN_WQCHAN_CONFIGURE); + QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) + != QBMAN_WQCHAN_CONFIGURE); /* Determine success or failure */ - if (unlikely(rslt != QBMAN_MC_RSLT_OK)) { + if (unlikely(r->rslt != QBMAN_MC_RSLT_OK)) { pr_err("CDAN cQID %d failed: code = 0x%02x\n", - channelid, rslt); + channelid, r->rslt); return -EIO; } diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index 8018048..bfcef8f 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -123,12 +123,12 @@ struct qbman_swp { * non-NULL if only if the response is complete). */ void *qbman_swp_mc_start(struct qbman_swp *p); -void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint32_t cmd_verb); +void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint8_t cmd_verb); void *qbman_swp_mc_result(struct qbman_swp *p); /* Wraps up submit + poll-for-result */ static inline void *qbman_swp_mc_complete(struct qbman_swp *swp, void *cmd, - uint32_t cmd_verb) + uint8_t cmd_verb) { int loopvar; @@ -275,4 +275,4 @@ static inline int32_t qb_attr_code_makesigned(const struct qb_attr_code *code, * an inline) is necessary to work with different descriptor types and to work * correctly with const and non-const inputs (and similarly-qualified outputs). */ -#define qb_cl(d) (&(d)->dont_manipulate_directly[0]) +#define qb_cl(d) (&(d)->donot_manipulate_directly[0]) diff --git a/drivers/bus/fslmc/qbman/qbman_private.h b/drivers/bus/fslmc/qbman/qbman_private.h index b98c330..4f48b47 100644 --- a/drivers/bus/fslmc/qbman/qbman_private.h +++ b/drivers/bus/fslmc/qbman/qbman_private.h @@ -92,7 +92,7 @@ do { \ * */ #ifdef __LP64__ -#define MAKE_MASK32(width) ((uint32_t)(( 1ULL << width) - 1)) +#define MAKE_MASK32(width) ((uint32_t)((1ULL << width) - 1)) #else #define MAKE_MASK32(width) (width == 32 ? 0xffffffff : \ (uint32_t)((1 << width) - 1)) diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 47da595..c73d2bf 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -357,15 +357,3 @@ static inline void qbman_swp_sys_finish(struct qbman_swp_sys *s) { free_page((unsigned long)s->cena); } - -static inline void * -qbman_cena_write_start_wo_shadow_fast(struct qbman_swp_sys *s, - uint32_t offset) -{ -#ifdef QBMAN_CENA_TRACE - pr_info("qbman_cena_write_start(%p:%d:0x%03x)\n", - s->addr_cena, s->idx, offset); -#endif - QBMAN_BUG_ON(offset & 63); - return (s->addr_cena + offset); -} diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 13fb46a..3cc7dad 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -62,11 +62,12 @@ DPDK_17.08 { dpio_remove_static_dequeue_channel; mc_get_soc_version; mc_get_version; + qbman_check_new_result; qbman_eq_desc_set_dca; qbman_get_dqrr_from_idx; qbman_get_dqrr_idx; qbman_result_DQ_fqd_ctx; - qbman_result_SCN_state_in_mem; + qbman_result_SCN_state; qbman_swp_dqrr_consume; qbman_swp_dqrr_next; qbman_swp_enqueue_multiple; diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 094cf30..d2aff28 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -747,13 +747,13 @@ dpaa2_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, * Also seems like the SWP is shared between the Ethernet Driver * and the SEC driver. */ - while (!qbman_check_command_complete(swp, dq_storage)) + while (!qbman_check_command_complete(dq_storage)) ; /* Loop until the dq_storage is updated with * new token by QBMAN */ - while (!qbman_result_has_new_result(swp, dq_storage)) + while (!qbman_check_new_result(dq_storage)) ; /* Check whether Last Pull command is Expired and * setting Condition for Loop termination diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 4342c73..75a06f5 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -422,7 +422,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) qbman_pull_desc_set_storage(&pulldesc, dq_storage, (dma_addr_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) { - while (!qbman_check_command_complete(swp, + while (!qbman_check_command_complete( get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index))) ; clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index); @@ -445,7 +445,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) * Also seems like the SWP is shared between the Ethernet Driver * and the SEC driver. */ - while (!qbman_check_command_complete(swp, dq_storage)) + while (!qbman_check_command_complete(dq_storage)) ; if (dq_storage == get_swp_active_dqs(q_storage->active_dpio_id)) clear_swp_active_dqs(q_storage->active_dpio_id); @@ -453,7 +453,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) /* Loop until the dq_storage is updated with * new token by QBMAN */ - while (!qbman_result_has_new_result(swp, dq_storage)) + while (!qbman_check_new_result(dq_storage)) ; rte_prefetch0((void *)((uint64_t)(dq_storage + 1))); /* Check whether Last Pull command is Expired and @@ -486,7 +486,7 @@ dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } if (check_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index)) { - while (!qbman_check_command_complete(swp, + while (!qbman_check_command_complete( get_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index))) ; clear_swp_active_dqs(DPAA2_PER_LCORE_DPIO->index); @@ -560,7 +560,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) while (nb_pkts) { /*Check if the queue is congested*/ retry_count = 0; - if (qbman_result_SCN_state_in_mem(dpaa2_q->cscn)) { + while (qbman_result_SCN_state(dpaa2_q->cscn)) { retry_count++; /* Retry for some time before giving up */ if (retry_count > CONG_RETRY_COUNT) From patchwork Fri Sep 8 08:45:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112029 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1243811ybm; Fri, 8 Sep 2017 01:47:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB5vHhINsLJQuxiWGKTbtnwJVi7It7d/dR6rYnYTibJ9dKjSAeiDrelNIBgNL952yMLuf5R X-Received: by 10.28.69.11 with SMTP id s11mr586664wma.81.1504860443469; Fri, 08 Sep 2017 01:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860443; cv=none; d=google.com; s=arc-20160816; b=BP1a0hOHVBc6PHEedCVjGb0BeUoCJi4tkeS/7thaEhjVwPhUp4W9dATStrHeP+LyHF 8+Cd/tmXA9Tae8+rdUEiKwl7+FigQMqwoG1z0GnHXg/d6fapNg8DAt+3w05lKeAuFI3M 6m3OVkz2ho6h5VhCRvxkYP7zbuh0vpwUUBuydslwUBqlX4mY5GMQU/9WTCZmzDxF6KSd 9p6/Th65ZotfDG87635kLMAkhweEFm8OKcpfY0Rx7Cd18IGBAZo0LGvSKFIeHbWwixLy tRKWNF6j2P8lL52SbqEDJhwvTsoOD4SifUeigHURtq1HJ/kLVwQcqD8GsyvmJGDrnJz3 nn6w== 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=e0XOuw0Wmls/mP4kuLPmzi04LAIT3/SsiicFZf4QdU8=; b=oxodDBcjfTtphAFnbkd9ukr2dXqx1ox899pKo6YFMxjKEZ+eRYunQxJ+JbURCUolMS tI+Nt7jlzFskhX6/kU/lDyfZ/1XNnRtfahytsmLurYse4V2Ng0MUc1K3PMtySprh0skF UXJKzMKuru7J5eUqLS07UzrU+lexk8+UvF+oG9MnhbvR70pckxBmZtPGFLm15msxCKCs oU60FM2zJGkvjrWYTN59qNKMrWTAAWbR4GQvGTZJxfCpK6WOr6g1+cwNpQm40Myry1Jz lUPqaas2mBUeu4DMFNN12hPZWevvhE9Q99MyU1mIvg3VgopsFKOURTTI4WWwO00SOZy6 ubpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id h27si1082922wmi.142.2017.09.08.01.47.23; Fri, 08 Sep 2017 01:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 F1470199DD; Fri, 8 Sep 2017 10:46:08 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0089.outbound.protection.outlook.com [104.47.34.89]) by dpdk.org (Postfix) with ESMTP id 45039199D2 for ; Fri, 8 Sep 2017 10:46:06 +0200 (CEST) Received: from BN3PR03CA0110.namprd03.prod.outlook.com (10.174.66.28) by DM5PR03MB3324.namprd03.prod.outlook.com (10.174.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:04 +0000 Received: from BL2FFO11FD027.protection.gbl (2a01:111:f400:7c09::158) by BN3PR03CA0110.outlook.office365.com (2603:10b6:400:4::28) 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:04 +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 BL2FFO11FD027.mail.protection.outlook.com (10.173.161.106) 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:04 +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 v888jmod023063; Fri, 8 Sep 2017 01:46:02 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:04 +0530 Message-ID: <1504860327-18451-8-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: 131493339644717907; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(8936002)(68736007)(33646002)(110136004)(6916009)(2950100002)(53936002)(47776003)(104016004)(5003940100001)(5660300001)(85426001)(48376002)(50466002)(50226002)(4326008)(77096006)(54906002)(356003)(305945005)(8676002)(81166006)(36756003)(498600001)(2906002)(97736004)(86362001)(2351001)(8656003)(76176999)(105606002)(106466001)(189998001)(50986999)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3324; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD027; 1:5w5nV6I6Il0zitlHPQK88yB7C1LURy/U95qok49fUX7KdcrVgNaoDhuj0s9kCN25HJ/OyQxqRG90Lq3QuHkYAVasn1oTLOEJ7yo7ox9dvEE9zKErTkUkUHVH2duRHQa4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 426edb6a-19cd-485f-6b53-08d4f6960a51 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:DM5PR03MB3324; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 3:x9RnbzHtM45xKMTedgxD0VJlwzApThSCTOG3egvG3D14nnX8URj2RIAyAzqKL2IAU5VTphBpoPjrZthHRZOI9QH8S3kVkvrFgxihkL7CXjw1rGpymHCFlkbBsm/3955SrXz3HtTI8rNLBOQnpN4nVDc7VW9HiZOUuD1R+o+Ic5zWAUr7irH/xPvT1E94m+eDkYdlK68EmVP+bkGK3hQrWaooenkxU8tyViDWYicS/d3IG4FsRNzmZ09nW/hww5hX0CA4YqqAtAiDUljL4cr5NKLMOaeGIRL+SqR2J+8tWAC64x9lT34gvbm/98JjQ2rBU8Ox07R6NHxjTFpw9n5EFmThqldkm3S4q1Xpf7SE3dc=; 25:aJvbr7T72YavAFf+V8chon1/BqjKhYnPh31fR+zfnxQiYfl0j993/+zRxUXsa/gKM5Fjy/tY1cLV3ENdHuyzDejPIulEXETJtBqBaJ8WhkZgIrI8WgafXLXS9l7UB7djDvz3xXuUCk8/ho/gANq497AOYIt2lRvv+wmNBRIR5HeDtY6lvWrAYZdq9f4HYB4iGPmvWNDYLXeLXmSVURZGvy5gPawNr0Pjxr/bpFqXShcMNgJZiEEIKzjSJcXnobyzRjMLNOFskTIRyeIDb14Q2Qyz4Ba1543v1rPOJ9MLul7h5jht7Hmtha+qzfiNMvRGo/I12FHuj5hEisPaJg3ffQ== X-MS-TrafficTypeDiagnostic: DM5PR03MB3324: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 31:bJ/gzRNdfvzl05t9v059FKY6lMsJCsM43qwBe2Pi8x/Q81GOK6KXuu2d8ofOiY64x1DcmPaPG57HC7zm9S69GLhbCdNLk0297ivuuKdWsnjxWKUG/8xI7fbqc8mgxlQDKGJehXYmEbpK+ZbJai/UvbKQfVvHDeVO8Rl5vg9mtLnZmu2xDJyF3IY/pHDDZNrR47jCaLynLY3bP+HaJONn2iuTJyYPeHlJZXkt0Az/y9k=; 4:LzFshdUBNTEQMta8EzfzU/bWBidActEfQ7fU9yPaqTT3L51Lg6m7bYpanFt7yjexW6LFva7bIsv7pidRndf3kzkOUdSQoZ251fEDU6tfQIU5uzvifsMCzA1ZBn4f5LSWYnNcngNaaiyl7bwmtmH9r3lxcE1Z6uurWjpOW5Igpf6v+23DiwinPV2EGSO94F4zZelEKGK30SAeaqJpYtuL/U63DMuFHjNZ3OJpfgpC2EB7xF4Awun367zbBe4visxpz+jcQUYHAuSlgs+/+b/UrSqVV5TjBWXgTQNLJySQ1Q8= 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3324; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3324; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3324; 23:uWkPasuUYbICJWU1xQZfdWaAOlECHY07HPZZRTzo6?= H6B41yY+qmn81ublP0M3+pI8yx/xsvICy3N1ibvyXBB6GB7hQTJ2VYgGIGiXfyGgo5ub1TM7X+kkQl5oOXjX9Kn31a37sDvGwiX8eogqOXzNLKKUN5iUTnnRlhidCHjlMiFzM50IyXUmqpN0D56x30gQy71oUURBqEwO0dgLvBEXDcQ1I70sAWEv6/QMhofmbjp4rzqXwv8rg4LQPosSEVXY3HZ5SO6j3fXqX8K81CkWqLHLmletBPnxUpCmObmTo6SwtYS8wizl7FKTlB8H1lRwwFA1W9jyVQ08Pdhyg8DPolL3rDJbOUR896w70dtXb4wpUVL8ojqLeOl+s1HWDK/XGs4gdX8Dv72f//z9W0kqU1S3LO4kOYNmGdTzs45ayCGbkkyRBGi3f7V7mjbbjuQNNwL+Dh/GhGQAqViE4g6TSU7fJLaB0KwWehBNzVSypg8SIaySRioWyxaPC+PsMy8hIy7Y26eYQpbuRy6kNV6iZobKjXtwbpoXJTcidSG3d73C0GYz/3kAQE3XT3yVMM0HN6Q30XSgaGex4+hIhe5sMsYo57Zx2U/JgzjJ3LRCwdIKF7Lqq6iibjhjBaTjpOal56weWunCqefufLs5y4ELPWkA/M/0BRi3joYE/S1H4dr/+/8kKDC5oZfxw+3Inj3N8Xre+yoeyuDpkc17CQHsmhaR4BKIOQuHyAlBOfYgSxRa+M9YwsijJiUtxcTv5yNDMcQAzddF0mh5rZXOZt+eAGkRXQv1LHHY53x2haExmronfddQEPzVYW/vhWh/EfCbvt3PNdg4xlNzaQ3TZSxJ3qmL5Uy/PoRT+bEU0FxIHj0mnvE/cNM3yJ+oz3yK94Q5uiTsZjAQu2dS2jUlrb12DY+trcm7gMZbPxyNkJ/uQD15fK3172iTnkLKPVqH2PntqRG/A2C9rMOrdWHIonlzsYr0fRR99+rxoVHuOKQ7WmV8my+92Q2SyzwTLAjI0IsW2eyn8EdVGLulmv4VKKL/jM1yQprXGEIk1SMcnO7yZ8gUyJe6zR66CScPRSstqN+Iuhzm4LM8jrPVyeNWnkhlg== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 6:3znplURyHu4SmNSAbdynKfKYfSI47aNJKmnNvLo2PApUFlqU/wlGZdaPC+8NdoJ42knpYJUfQqkTY9wdfsGAVp0JcNSHOiSKhNpzjnhlkKs5LZ+lLn9CZfu+25DYERTa9ZXQfGTpJOt3xPfEkHPaffhsAruNm36nHyxm+6YAfnw0NonZAsyzBZkZWfULX45RhSwaDi4Jt0LQaDXRJB7T3Uf42Tr7xdzS75HpHaO9rqAsBu590Dx+9aGTZlJ0kgr58xbL3H6sXuDSoOEF8Ds2kgGwNt4Cnf6MDtM235rTe/M68eJ9ICLH3RIyuZgVxaM/xKUMihbsrb+d7Y8A0ypV5w==; 5:lGSDCmKNhjxm2fxeS4OMehaZSD7aaTFbQSevIoIx5DnhqTYUUn7zhfm7Wm74F0HWIvISyOJlFW2VVpN30sr4mYk4JrI+DUC0jCjn2M5/BUPkit5293d6zkxFaGkERjviQrEHRWPok74DNlVrlWgdUQ==; 24:u2rhHKC4LEPVUqLKpeyq1FsrVYvFSliHc+Kp/sS9SPXgMa35kHvSIkqZbgDKHN4GICEimpYs368jp803q+UXPRB7feFLa8ZeFOAUc5AmAsU=; 7:TyVTCYxlsSGtaIk+PFXbccbyxRlAWJQvurf5r5JXIM0R2pRNmiVPITHJVu0yTok+SLJsKoKeq+EiqRFbhiANzYwOyIyuZyltLficNk/9Rs89zJOf1JFwgqovVJ0KprbQseIqLhaDKhwjVCIk/JJdVkf9Wa/u/P4EX7bEPy/9WHpMST6xUgG5gF0w/gfCpeZnwJKoY4zbX2cMkabSsQuvZsohftAbJJHUNcW8uWnX0VU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:04.3001 (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: DM5PR03MB3324 Subject: [dpdk-dev] [PATCH v2 07/30] bus/fslmc: cleanup compat file 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/bus/fslmc/qbman/include/compat.h | 188 +------------------------------ drivers/bus/fslmc/qbman/qbman_private.h | 2 +- 2 files changed, 4 insertions(+), 186 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 7b69fd1..8885d60 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -65,16 +65,9 @@ */ /* Required compiler attributes */ -#define __user #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) -#undef container_of -#define container_of(ptr, type, member) ({ \ - typeof(((type *)0)->member)(*__mptr) = (ptr); \ - (type *)((char *)__mptr - offsetof(type, member)); }) -#define __stringify_1(x) #x -#define __stringify(x) __stringify_1(x) #ifdef ARRAY_SIZE #undef ARRAY_SIZE @@ -88,17 +81,8 @@ typedef uint32_t u32; typedef uint64_t u64; typedef uint64_t dma_addr_t; typedef cpu_set_t cpumask_t; -typedef u32 compat_uptr_t; - -static inline void __user *compat_ptr(compat_uptr_t uptr) -{ - return (void __user *)(unsigned long)uptr; -} - -static inline compat_uptr_t ptr_to_compat(void __user *uptr) -{ - return (u32)(unsigned long)uptr; -} +typedef unsigned int gfp_t; +typedef uint32_t phandle; /* I/O operations */ static inline u32 in_be32(volatile void *__p) @@ -124,12 +108,11 @@ static inline void out_be32(volatile void *__p, u32 val) #define pr_warn(fmt, args...) prflush("WARN:" fmt, ##args) #define pr_info(fmt, args...) prflush(fmt, ##args) +#ifdef RTE_LIBRTE_DPAA2_DEBUG_BUS #ifdef pr_debug #undef pr_debug #endif #define pr_debug(fmt, args...) {} -#define might_sleep_if(c) {} -#define msleep(x) {} #define WARN_ON(c, str) \ do { \ static int warned_##__LINE__; \ @@ -147,103 +130,20 @@ do { \ #define ALIGN(x, a) (((x) + ((typeof(x))(a) - 1)) & ~((typeof(x))(a) - 1)) -/****************/ -/* Linked-lists */ -/****************/ - -struct list_head { - struct list_head *prev; - struct list_head *next; -}; - -#define LIST_HEAD(n) \ -struct list_head n = { \ - .prev = &n, \ - .next = &n \ -} - -#define INIT_LIST_HEAD(p) \ -do { \ - struct list_head *__p298 = (p); \ - __p298->next = __p298; \ - __p298->prev = __p298->next; \ -} while (0) -#define list_entry(node, type, member) \ - (type *)((void *)node - offsetof(type, member)) -#define list_empty(p) \ -({ \ - const struct list_head *__p298 = (p); \ - ((__p298->next == __p298) && (__p298->prev == __p298)); \ -}) -#define list_add(p, l) \ -do { \ - struct list_head *__p298 = (p); \ - struct list_head *__l298 = (l); \ - __p298->next = __l298->next; \ - __p298->prev = __l298; \ - __l298->next->prev = __p298; \ - __l298->next = __p298; \ -} while (0) -#define list_add_tail(p, l) \ -do { \ - struct list_head *__p298 = (p); \ - struct list_head *__l298 = (l); \ - __p298->prev = __l298->prev; \ - __p298->next = __l298; \ - __l298->prev->next = __p298; \ - __l298->prev = __p298; \ -} while (0) -#define list_for_each(i, l) \ - for (i = (l)->next; i != (l); i = i->next) -#define list_for_each_safe(i, j, l) \ - for (i = (l)->next, j = i->next; i != (l); \ - i = j, j = i->next) -#define list_for_each_entry(i, l, name) \ - for (i = list_entry((l)->next, typeof(*i), name); &i->name != (l); \ - i = list_entry(i->name.next, typeof(*i), name)) -#define list_for_each_entry_safe(i, j, l, name) \ - for (i = list_entry((l)->next, typeof(*i), name), \ - j = list_entry(i->name.next, typeof(*j), name); \ - &i->name != (l); \ - i = j, j = list_entry(j->name.next, typeof(*j), name)) -#define list_del(i) \ -do { \ - (i)->next->prev = (i)->prev; \ - (i)->prev->next = (i)->next; \ -} while (0) - /* Other miscellaneous interfaces our APIs depend on; */ - #define lower_32_bits(x) ((u32)(x)) #define upper_32_bits(x) ((u32)(((x) >> 16) >> 16)) /* Compiler/type stuff */ -typedef unsigned int gfp_t; -typedef uint32_t phandle; #define __iomem -#define EINTR 4 -#define ENODEV 19 #define GFP_KERNEL 0 #define __raw_readb(p) (*(const volatile unsigned char *)(p)) #define __raw_readl(p) (*(const volatile unsigned int *)(p)) #define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); } -/* Completion stuff */ -#define DECLARE_COMPLETION(n) int n = 0 -#define complete(n) { *n = 1; } -#define wait_for_completion(n) \ -do { \ - while (!*n) { \ - bman_poll(); \ - qman_poll(); \ - } \ - *n = 0; \ -} while (0) - /* Allocator stuff */ #define kmalloc(sz, t) malloc(sz) -#define vmalloc(sz) malloc(sz) #define kfree(p) { if (p) free(p); } static inline void *kzalloc(size_t sz, gfp_t __foo __rte_unused) { @@ -269,88 +169,6 @@ static inline void free_page(unsigned long p) free((void *)p); } -/* Bitfield stuff. */ -#define BITS_PER_ULONG (sizeof(unsigned long) << 3) -#define SHIFT_PER_ULONG (((1 << 5) == BITS_PER_ULONG) ? 5 : 6) -#define BITS_MASK(idx) ((unsigned long)1 << ((idx) & (BITS_PER_ULONG - 1))) -#define BITS_IDX(idx) ((idx) >> SHIFT_PER_ULONG) -static inline unsigned long test_bits(unsigned long mask, - volatile unsigned long *p) -{ - return *p & mask; -} - -static inline int test_bit(int idx, volatile unsigned long *bits) -{ - return test_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); -} - -static inline void set_bits(unsigned long mask, volatile unsigned long *p) -{ - *p |= mask; -} - -static inline void set_bit(int idx, volatile unsigned long *bits) -{ - set_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); -} - -static inline void clear_bits(unsigned long mask, volatile unsigned long *p) -{ - *p &= ~mask; -} - -static inline void clear_bit(int idx, volatile unsigned long *bits) -{ - clear_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); -} - -static inline unsigned long test_and_set_bits(unsigned long mask, - volatile unsigned long *p) -{ - unsigned long ret = test_bits(mask, p); - - set_bits(mask, p); - return ret; -} - -static inline int test_and_set_bit(int idx, volatile unsigned long *bits) -{ - int ret = test_bit(idx, bits); - - set_bit(idx, bits); - return ret; -} - -static inline int test_and_clear_bit(int idx, volatile unsigned long *bits) -{ - int ret = test_bit(idx, bits); - - clear_bit(idx, bits); - return ret; -} - -static inline int find_next_zero_bit(unsigned long *bits, int limit, int idx) -{ - while ((++idx < limit) && test_bit(idx, bits)) - ; - return idx; -} - -static inline int find_first_zero_bit(unsigned long *bits, int limit) -{ - int idx = 0; - - while (test_bit(idx, bits) && (++idx < limit)) - ; - return idx; -} - -static inline u64 div64_u64(u64 n, u64 d) -{ - return n / d; -} - #define atomic_t rte_atomic32_t #define atomic_read(v) rte_atomic32_read(v) #define atomic_set(v, i) rte_atomic32_set(v, i) diff --git a/drivers/bus/fslmc/qbman/qbman_private.h b/drivers/bus/fslmc/qbman/qbman_private.h index 4f48b47..32e5c5d 100644 --- a/drivers/bus/fslmc/qbman/qbman_private.h +++ b/drivers/bus/fslmc/qbman/qbman_private.h @@ -27,7 +27,7 @@ */ /* Perform extra checking */ -#define QBMAN_CHECKING +/*#define QBMAN_CHECKING*/ /* To maximise the amount of logic that is common between the Linux driver and * other targets (such as the embedded MC firmware), we pivot here between the From patchwork Fri Sep 8 08:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112030 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1244157ybm; Fri, 8 Sep 2017 01:47:39 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCHFhOClXP/2xJrl+pAptxh87oVIu3rqdCqEoP3ndgP5rDoIwpDE2ZaWfonJ7Yfo/KvVCft X-Received: by 10.28.72.87 with SMTP id v84mr1019703wma.138.1504860459874; Fri, 08 Sep 2017 01:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860459; cv=none; d=google.com; s=arc-20160816; b=rEAAdh5QV8W9aBvAFSuViJGQEuDF0pKxhutJPKQGpAPEKBO125+RjZgFrXy4UTNoVp JK3bmQBXyZz75BZsgc11gl+FQL2dsigdF3gaM9dKBFRqF+Gs9hZAH+4uQXb/Ftul0rFe zDaFcJkJmS4rPkA7Xq0J27IFW8sGuc1R+R04x8+FI8Ma0LBgD97+kZ1eFN8qStZ8v/7g 7WmQpseNyrIhWAXYftrNEAL3juBLSnk+ZSQbuKbR0fUG5dsJdFuljKiMwoi49BIRymhl spn/e3gHWmX4rG2G9kL1aPlZ5PdtnoKZBdS37+hlhaB/5vTnTaKzRoGIC9qXHVZCxKsH kkIQ== 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=ryjQrnpIaZa4Y7kZdawJHUMu/oigknqWcDb8YV4nkYk=; b=hg+sTL+6Z5K4q/0CAKkfU908gzUrOcsMgJ6+/VyVsMEPUy30XKcandRCbvOD+joRYm MWTxAL9UWtNJk6tPVw/xDXHFz3S8UtJV2SmKgeLfVVz05moRqoizXkbvbNW8hhN96VeQ 8dP0jG22bsrO6K+kIRg4KqYJHPv6b9vbLhEo0cE6g2LdzhVjyjFms3yBC3TkizL8jp8d FuQnmg4fBS8mxHPE1Ao2bxL0iAZPCapNcbsFHBIJx3dJTwsYUp0fzrChH3XYa4vstUof 7c2P2needC1LwU1AlhAEonUJE9a+Y7G6/0LKN7iRDof+wYw5O3bhFYy5eEPGypqlYWoJ tKSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id o76si1139422wrb.226.2017.09.08.01.47.39; Fri, 08 Sep 2017 01:47:39 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 54B37199E6; Fri, 8 Sep 2017 10:46:11 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0070.outbound.protection.outlook.com [104.47.41.70]) by dpdk.org (Postfix) with ESMTP id 4B4B6199B2 for ; Fri, 8 Sep 2017 10:46:08 +0200 (CEST) Received: from DM5PR03CA0030.namprd03.prod.outlook.com (10.174.189.147) by MWHPR03MB3326.namprd03.prod.outlook.com (10.174.249.144) 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:07 +0000 Received: from BL2FFO11FD030.protection.gbl (2a01:111:f400:7c09::182) by DM5PR03CA0030.outlook.office365.com (2603:10b6:4:3b::19) 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:06 +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 BL2FFO11FD030.mail.protection.outlook.com (10.173.161.40) 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:06 +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 v888jmoe023063; Fri, 8 Sep 2017 01:46:04 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:05 +0530 Message-ID: <1504860327-18451-9-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: 131493339662711095; (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)(189002)(199003)(6916009)(2950100002)(50466002)(77096006)(189998001)(5660300001)(5003940100001)(48376002)(97736004)(104016004)(68736007)(36756003)(54906002)(85426001)(8656003)(4326008)(110136004)(53936002)(8676002)(50226002)(81166006)(81156014)(356003)(8936002)(105606002)(305945005)(106466001)(47776003)(76176999)(2351001)(33646002)(50986999)(2906002)(86362001)(498600001)(183404003)(309714004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3326; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD030; 1:YchRZx4t9X7zIMhH0MwGjNt76V1rs2STVc1RtvDCfWiGcGjKJxY145SmDgPLIn33Y0tBLecm5Z/yqay4KA28hQpKfuAHQNA2oH10SbnAQPoobUaMFFpXSL46P3byo+AH MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c850075-e1c6-4243-f937-08d4f6960b63 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR03MB3326; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 3:KZ60nhJF45L8UPJPAs/s3p5WQqTeqzdFzc3ZnnolKUrte41W1cLNNXMf1kMvvkfFXQp+ifS/A+//1K6PTMKiEKeH2KUHEcUFWm0UESqq5AnkKxTLny0jMeQyLbED4S8AMBiydXMWyW99S/2QD8f4nCbPfZ2lgUdV94OX3mssnnPYI5TiX4+LB8AAjArDXW6ntBLD6kC7GwBF2/M185kC0bwEblxbWjPJIlJwbryXdiPJkiNdTibmoaKmLTKSAa06sPWpPSZ4+OF2G/rNHHw6uvW4mL7/pRXg5/XTujGvzvKH3aya3EcEDkWEbizMClkYWFjZJVOqMcUmx+SKDg2uWXVWFJdADeLPT1F6HdzRm64=; 25:NNFUSLqvWnJ46zvTLWzHYuvn52SJKuxCifwJ33yR6dHgYtAWuMlmVgi06Z/qruuGZJAFpAhoYyO+z6uluf7/UxkKCrO2Zzg5TAOYX001Q04L7nfmyj2FGlsikW3jMxTsjmAAq/3lDtTEnNlZc33VoAdwTSqsddGU3owJisqZjAEHQMMaZHmyAj2A7NmfhyxqRgZ2fKjI2R8o10GOzwFzhGGhvKlvFFCE2NZIBwprKro/7N+0ynJEVdffqRGFjj4e9nvB1g7mrPgpRUFM3KasDCLUTpvL+zF2KX+dN/iMHZDSdXpRXIFqmG1obPuwbVwACVIoHs0+6e+khci+9kKXNA== X-MS-TrafficTypeDiagnostic: MWHPR03MB3326: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 31:T0SlZ1NuBBuynwwKBj1Bqi6p1B8DxhfMv3jNCNKJw+0gu13uxgCRHV4xHuNNgY3oN2H6VQRXsLDKrOG2WymUzoflACEdYyJ1vSYKdOyEJx4aPMn+hBvyZoq22avYFVyjXU5gZSTdKoh/SjIx6eCgkFsLdD0xsaxoWSKOLDmU3xVd1FiyTAiN6FhRdoNRQ6AO2VkQxtGGxjGSu4e0jNgU4Ekbme8gE3Mmhx9PBfs2SdM=; 4:ceRijBWrTvUqZ1wH+zpl0qwBjUV/NID8D32ZZegK2KsN+9o0180OgXMW6c7I0EbK0vtRXxnakH9G478EdSAWp4rxZgS0KDprRzBIW1Q7AHaaAfskAhT/PTeGlU2R/O1D44ARygWuYOt4KROGFXsKi8iGrnoQ1F9HJzQFtLlpsgTja7oiCzsoJ0joz57s+EZ/CIt+k2IC3YG7mpaYD7DGU/s3fj75b0EZMNV1IvKXvD+Fn1oBZACoWPN4V1jL45RczAjodGnOfBE5gl0zpBN+iSeok9TLqZ1/sPmr85smSDanN8ZX2JhcIqcPZ8jkClMEaKCKgW6SxSY2ilRq3g18+A== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3326; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3326; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3326; 23:5yJUYlsDR5Yyix/lTPkqZ2rbaBX4TZZnkoANwvUFd?= 4GVqGVpzPkvU74pgGylE7eDDUiuklP9zZ3MGuaoRTIH9F5V3OXU1O8KOtRihHd+5ZbzGviWQeoXDScBeQGy6RBM40bD5tIXReyulfk5GnccSJ3Qbtzsh3jLHCrJpZoc3/nlGA9T2HtgwhCvsdkivXHX0nEfYiPEAqYzWIxbxAzREn/imya4bUpGkQXJxiK9XDZEfDy63ICR12tg3WSWgR/KPTFNOsxjiQA+Frptkw+WqE2GpaOL0MVvlp1NGkPkASvJ14lmZ7XtajNXup30EhdoBvsiA1j4sY2CfNyRZnepH3Cu+JRzVLX5d+zDp3AoIBemV2BhM1IDuXwoANcio11wIuo9vl3INHg1ALYJgq9s/m5xnShGWxdmWCE9GNQi0MZDz9yZEej5XlEcavDZkOG5C3blgii6w1gIAZNnYb2ttXz+CStzbVjeRdWnozHBG2pqLkuVX1rItMd1uSNnrfzNb8RZJkkvgRxybePnbLaBHy9hzTdwGo99fbEz0/u8PiEXE2g9aCVfB3bh7xrw4mWVS1yqlBr5F0bBaRu2Rnd3jmJAXr6FJyKvJH9whim9ak2M7trDWG0iVsAQj8taXnGMJM/2m3vamUqVT3igOq42p+ZbE4RyxGDCMPdnwrpJ3jB8Vx/qLUR/Ucn8TwiZPIKgsMYG3jknkXb/c9li6xpRctZb7bqz7ADVdEUfhXGYWAwff6+W6uZop6P44oWttWOdYFGZvp/0gis//VjkFJ38pyGl4FS3IHZ1jjfcYNWbTZLV31j4PfEvNPpqnAJh/Ncmobr+frt5806Qmf2ikZrprpZy8MHj24gwnarnEM2jmDxUzlaNsx+1uPu5fg5mcQ/dm4Wm+Tt+GRkOToFOa548duG5MVnTB5DnJeXHFmoDEvIGnHhVANUCIMuc4qMrcNVNmim57tSv/Tk15aJ1ixW2B/cjDxB81G8BoHEixk+xskcgmsV3+ysCI1oBY66OtG0cXwebW65YM9100FCGKL9l1Tva4qW2Xt0jwGS37yOOmdSt8J0Cr8YnnGhKYk2FbSYkUaFGsEZ+p0x/X8Ih64DxqN6u4oJuY6ATrowZ/hSEJ0B2LToB3VPsTHzCdMPLIpqGkCdg/3oT0AXk2AD2qN/Jgg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 6:VqKzj1IBptfqEnVGSdYyi2Y0LS8zt8y2Op/7Ona9Is5ASeFOPxaVsC3VfoeSIKEexRm61CVhY7P5/QeM/RocwUGgOx+4TOTX65aOuhJPuXUnv+Y7xeE/td6FkDCQUQTgJ00ISpsQ2OwbGYD1RxLazQ+BH5RJw7FS9lXNrqRNCbvymmasD/ez1zVZBUfmDkmgji+cIhv/rvsWTogPiKS/e7UGB0PS0nQMuC3QVu0Umq80z2VU644mHvPlRegG/MlmUMXrvPukpAAta9h+JRcNTDQDRa8uz74740y/ISldDQmgXTr8IRiHY8QZxQAysu8aBLY9tCRvVHZj6fiHvKAtAw==; 5:61CIAOao8aIr/7EGgOz1blU712ZlZrX71dcNtfS2qXZIaaxa2GayevHzeNav8woANz+6/Mvu9XLBe0JXB2Em12AAagiQ2zAJYRDZdgX2mWexeT3sOqQ7bk9bLPBoRElQCpU1B9jlZARpSvKq5YoqaQ==; 24:J/zEr75YZjse9HPHwqfEn5ZVLE/J9yUvwljTmaXF5KLdwvBXZZJHOW5zoyZ7wrw8wjayYqsVC3Je9m752RYyiVbe3AMEJg2pNd/FNLQ4kak=; 7:B6KMIkBaZX3srDB3saE3iXslEv0g+52CrGbOcpl+ohJPz2g9La+DIK4O+dK25ZXrZ/qdBxa9OxtNPO5lt28prQl77U2E6sFHMLR/NhHI1EO0R+yIPvC5upF4PYwjQTJ2LyGKOApAZx1qeO/a67a9A0Nb6s/IdNh8fsS854ugx0DMIUwxWqHx6f+o7mTGcWxn867918aishux9m3heJK7x68o5OO8AiVlsdtilITNdc8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:06.1151 (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: MWHPR03MB3326 Subject: [dpdk-dev] [PATCH v2 08/30] bus/fslmc: clean the qbman support code 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/bus/fslmc/qbman/include/compat.h | 87 +--------- drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 5 +- drivers/bus/fslmc/qbman/qbman_portal.c | 26 +-- drivers/bus/fslmc/qbman/qbman_portal.h | 133 ++------------- drivers/bus/fslmc/qbman/qbman_private.h | 178 --------------------- drivers/bus/fslmc/qbman/qbman_sys.h | 124 ++++++++------ drivers/bus/fslmc/qbman/qbman_sys_decl.h | 25 +-- 7 files changed, 102 insertions(+), 476 deletions(-) delete mode 100644 drivers/bus/fslmc/qbman/qbman_private.h -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 8885d60..97904b8 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -30,32 +30,17 @@ #ifndef HEADER_COMPAT_H #define HEADER_COMPAT_H -#include - #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include -#include #include #include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include #include +#include #include /* The following definitions are primarily to allow the single-source driver @@ -67,35 +52,9 @@ /* Required compiler attributes */ #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) -#define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) - -#ifdef ARRAY_SIZE -#undef ARRAY_SIZE -#endif -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) /* Required types */ -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; typedef uint64_t dma_addr_t; -typedef cpu_set_t cpumask_t; -typedef unsigned int gfp_t; -typedef uint32_t phandle; - -/* I/O operations */ -static inline u32 in_be32(volatile void *__p) -{ - volatile u32 *p = __p; - return *p; -} - -static inline void out_be32(volatile void *__p, u32 val) -{ - volatile u32 *p = __p; - *p = val; -} /* Debugging */ #define prflush(fmt, args...) \ @@ -112,8 +71,8 @@ static inline void out_be32(volatile void *__p, u32 val) #ifdef pr_debug #undef pr_debug #endif -#define pr_debug(fmt, args...) {} -#define WARN_ON(c, str) \ +#define pr_debug(fmt, args...) printf(fmt, ##args) +#define QBMAN_BUG_ON(c) \ do { \ static int warned_##__LINE__; \ if ((c) && !warned_##__LINE__) { \ @@ -122,53 +81,23 @@ do { \ warned_##__LINE__ = 1; \ } \ } while (0) -#ifdef CONFIG_BUGON -#define QBMAN_BUG_ON(c) WARN_ON(c, "BUG") #else #define QBMAN_BUG_ON(c) {} +#define pr_debug(fmt, args...) {} #endif -#define ALIGN(x, a) (((x) + ((typeof(x))(a) - 1)) & ~((typeof(x))(a) - 1)) - /* Other miscellaneous interfaces our APIs depend on; */ -#define lower_32_bits(x) ((u32)(x)) -#define upper_32_bits(x) ((u32)(((x) >> 16) >> 16)) -/* Compiler/type stuff */ +#define lower_32_bits(x) ((uint32_t)(x)) +#define upper_32_bits(x) ((uint32_t)(((x) >> 16) >> 16)) + #define __iomem -#define GFP_KERNEL 0 + #define __raw_readb(p) (*(const volatile unsigned char *)(p)) #define __raw_readl(p) (*(const volatile unsigned int *)(p)) #define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); } -/* Allocator stuff */ -#define kmalloc(sz, t) malloc(sz) -#define kfree(p) { if (p) free(p); } -static inline void *kzalloc(size_t sz, gfp_t __foo __rte_unused) -{ - void *ptr = malloc(sz); - - if (ptr) - memset(ptr, 0, sz); - return ptr; -} - -static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused) -{ - void *p; - - if (posix_memalign(&p, 4096, 4096)) - return 0; - memset(p, 0, 4096); - return (unsigned long)p; -} - -static inline void free_page(unsigned long p) -{ - free((void *)p); -} - #define atomic_t rte_atomic32_t #define atomic_read(v) rte_atomic32_read(v) #define atomic_set(v, i) rte_atomic32_set(v, i) diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h index 24a6d4b..1e65660 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -329,7 +329,7 @@ void qbman_pull_desc_clear(struct qbman_pull_desc *d); */ void qbman_pull_desc_set_storage(struct qbman_pull_desc *d, struct qbman_result *storage, - dma_addr_t storage_phys, + uint64_t storage_phys, int stash); /** * qbman_pull_desc_set_numframes() - Set the number of frames to be dequeued. @@ -796,7 +796,6 @@ struct qbman_eq_desc { uint8_t wae; uint8_t rspid; uint64_t rsp_addr; - uint8_t fd[32]; } eq; }; }; @@ -881,7 +880,7 @@ void qbman_eq_desc_set_orp_nesn(struct qbman_eq_desc *d, uint16_t opr_id, * expresses a cache-warming attribute. */ void qbman_eq_desc_set_response(struct qbman_eq_desc *d, - dma_addr_t storage_phys, + uint64_t storage_phys, int stash); /** diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 072dfe8..ace2c56 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -126,7 +126,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) { int ret; uint32_t eqcr_pi; - struct qbman_swp *p = kmalloc(sizeof(*p), GFP_KERNEL); + struct qbman_swp *p = malloc(sizeof(*p)); if (!p) return NULL; @@ -155,7 +155,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) ret = qbman_swp_sys_init(&p->sys, d, p->dqrr.dqrr_size); if (ret) { - kfree(p); + free(p); pr_err("qbman_swp_sys_init() failed %d\n", ret); return NULL; } @@ -183,7 +183,7 @@ void qbman_swp_finish(struct qbman_swp *p) #endif qbman_swp_sys_finish(&p->sys); portal_idx_map[p->desc.idx] = NULL; - kfree(p); + free(p); } const struct qbman_swp_desc *qbman_swp_get_desc(struct qbman_swp *p) @@ -1097,15 +1097,7 @@ int qbman_result_bpscn_is_surplus(const struct qbman_result *scn) uint64_t qbman_result_bpscn_ctx(const struct qbman_result *scn) { - uint64_t ctx; - uint32_t ctx_hi, ctx_lo; - - ctx = qbman_result_SCN_ctx(scn); - ctx_hi = upper32(ctx); - ctx_lo = lower32(ctx); - - return ((uint64_t)make_le32(ctx_hi) << 32 | - (uint64_t)make_le32(ctx_lo)); + return qbman_result_SCN_ctx(scn); } /*****************/ @@ -1118,15 +1110,7 @@ uint16_t qbman_result_cgcu_cgid(const struct qbman_result *scn) uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn) { - uint64_t ctx; - uint32_t ctx_hi, ctx_lo; - - ctx = qbman_result_SCN_ctx(scn); - ctx_hi = upper32(ctx); - ctx_lo = lower32(ctx); - - return ((uint64_t)(make_le32(ctx_hi) & 0xFF) << 32) | - (uint64_t)make_le32(ctx_lo); + return qbman_result_SCN_ctx(scn); } /******************/ diff --git a/drivers/bus/fslmc/qbman/qbman_portal.h b/drivers/bus/fslmc/qbman/qbman_portal.h index bfcef8f..d9f3ed7 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.h +++ b/drivers/bus/fslmc/qbman/qbman_portal.h @@ -26,10 +26,14 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "qbman_private.h" +#include "qbman_sys.h" #include uint32_t qman_version; +#define QMAN_REV_4000 0x04000000 +#define QMAN_REV_4100 0x04010000 +#define QMAN_REV_4101 0x04010001 + /* All QBMan command and result structures use this "valid bit" encoding */ #define QB_VALID_BIT ((uint32_t)0x80) @@ -40,7 +44,8 @@ uint32_t qman_version; #define QBMAN_EQCR_SIZE 8 -static inline u8 qm_cyc_diff(u8 ringsize, u8 first, u8 last) +static inline uint8_t qm_cyc_diff(uint8_t ringsize, uint8_t first, + uint8_t last) { /* 'first' is included, 'last' is excluded */ if (first <= last) @@ -130,131 +135,15 @@ void *qbman_swp_mc_result(struct qbman_swp *p); static inline void *qbman_swp_mc_complete(struct qbman_swp *swp, void *cmd, uint8_t cmd_verb) { - int loopvar; + int loopvar = 1000; qbman_swp_mc_submit(swp, cmd, cmd_verb); - DBG_POLL_START(loopvar); do { - DBG_POLL_CHECK(loopvar); cmd = qbman_swp_mc_result(swp); - } while (!cmd); - return cmd; -} - -/* ------------ */ -/* qb_attr_code */ -/* ------------ */ - -/* This struct locates a sub-field within a QBMan portal (CENA) cacheline which - * is either serving as a configuration command or a query result. The - * representation is inherently little-endian, as the indexing of the words is - * itself little-endian in nature and DPAA2 QBMan is little endian for anything - * that crosses a word boundary too (64-bit fields are the obvious examples). - */ -struct qb_attr_code { - unsigned int word; /* which uint32_t[] array member encodes the field */ - unsigned int lsoffset; /* encoding offset from ls-bit */ - unsigned int width; /* encoding width. (bool must be 1.) */ -}; - -/* Some pre-defined codes */ -extern struct qb_attr_code code_generic_verb; -extern struct qb_attr_code code_generic_rslt; - -/* Macros to define codes */ -#define QB_CODE(a, b, c) { a, b, c} -#define QB_CODE_NULL \ - QB_CODE((unsigned int)-1, (unsigned int)-1, (unsigned int)-1) - -/* Rotate a code "ms", meaning that it moves from less-significant bytes to - * more-significant, from less-significant words to more-significant, etc. The - * "ls" version does the inverse, from more-significant towards - * less-significant. - */ -static inline void qb_attr_code_rotate_ms(struct qb_attr_code *code, - unsigned int bits) -{ - code->lsoffset += bits; - while (code->lsoffset > 31) { - code->word++; - code->lsoffset -= 32; - } -} - -static inline void qb_attr_code_rotate_ls(struct qb_attr_code *code, - unsigned int bits) -{ - /* Don't be fooled, this trick should work because the types are - * unsigned. So the case that interests the while loop (the rotate has - * gone too far and the word count needs to compensate for it), is - * manifested when lsoffset is negative. But that equates to a really - * large unsigned value, starting with lots of "F"s. As such, we can - * continue adding 32 back to it until it wraps back round above zero, - * to a value of 31 or less... - */ - code->lsoffset -= bits; - while (code->lsoffset > 31) { - code->word--; - code->lsoffset += 32; - } -} + } while (!cmd && loopvar--); + QBMAN_BUG_ON(!loopvar); -/* Implement a loop of code rotations until 'expr' evaluates to FALSE (0). */ -#define qb_attr_code_for_ms(code, bits, expr) \ - for (; expr; qb_attr_code_rotate_ms(code, bits)) -#define qb_attr_code_for_ls(code, bits, expr) \ - for (; expr; qb_attr_code_rotate_ls(code, bits)) - -/* decode a field from a cacheline */ -static inline uint32_t qb_attr_code_decode(const struct qb_attr_code *code, - const uint32_t *cacheline) -{ - return d32_uint32_t(code->lsoffset, code->width, cacheline[code->word]); -} - -static inline uint64_t qb_attr_code_decode_64(const struct qb_attr_code *code, - const uint64_t *cacheline) -{ - return cacheline[code->word / 2]; -} - -/* encode a field to a cacheline */ -static inline void qb_attr_code_encode(const struct qb_attr_code *code, - uint32_t *cacheline, uint32_t val) -{ - cacheline[code->word] = - r32_uint32_t(code->lsoffset, code->width, cacheline[code->word]) - | e32_uint32_t(code->lsoffset, code->width, val); -} - -static inline void qb_attr_code_encode_64(const struct qb_attr_code *code, - uint64_t *cacheline, uint64_t val) -{ - cacheline[code->word / 2] = val; -} - -/* Small-width signed values (two's-complement) will decode into medium-width - * positives. (Eg. for an 8-bit signed field, which stores values from -128 to - * +127, a setting of -7 would appear to decode to the 32-bit unsigned value - * 249. Likewise -120 would decode as 136.) This function allows the caller to - * "re-sign" such fields to 32-bit signed. (Eg. -7, which was 249 with an 8-bit - * encoding, will become 0xfffffff9 if you cast the return value to uint32_t). - */ -static inline int32_t qb_attr_code_makesigned(const struct qb_attr_code *code, - uint32_t val) -{ - QBMAN_BUG_ON(val >= (1u << code->width)); - /* code->width should never exceed the width of val. If it does then a - * different function with larger val size must be used to translate - * from unsigned to signed - */ - QBMAN_BUG_ON(code->width > sizeof(val) * CHAR_BIT); - /* If the high bit was set, it was encoding a negative */ - if (val >= 1u << (code->width - 1)) - return (int32_t)0 - (int32_t)(((uint32_t)1 << code->width) - - val); - /* Otherwise, it was encoding a positive */ - return (int32_t)val; + return cmd; } /* ---------------------- */ diff --git a/drivers/bus/fslmc/qbman/qbman_private.h b/drivers/bus/fslmc/qbman/qbman_private.h deleted file mode 100644 index 32e5c5d..0000000 --- a/drivers/bus/fslmc/qbman/qbman_private.h +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * BSD LICENSE - * - * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Freescale Semiconductor nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* Perform extra checking */ -/*#define QBMAN_CHECKING*/ - -/* To maximise the amount of logic that is common between the Linux driver and - * other targets (such as the embedded MC firmware), we pivot here between the - * inclusion of two platform-specific headers. - * - * The first, qbman_sys_decl.h, includes any and all required system headers as - * well as providing any definitions for the purposes of compatibility. The - * second, qbman_sys.h, is where platform-specific routines go. - * - * The point of the split is that the platform-independent code (including this - * header) may depend on platform-specific declarations, yet other - * platform-specific routines may depend on platform-independent definitions. - */ - -#include "qbman_sys_decl.h" - -/* When things go wrong, it is a convenient trick to insert a few FOO() - * statements in the code to trace progress. TODO: remove this once we are - * hacking the code less actively. - */ -#define FOO() fsl_os_print("FOO: %s:%d\n", __FILE__, __LINE__) - -/* Any time there is a register interface which we poll on, this provides a - * "break after x iterations" scheme for it. It's handy for debugging, eg. - * where you don't want millions of lines of log output from a polling loop - * that won't, because such things tend to drown out the earlier log output - * that might explain what caused the problem. (NB: put ";" after each macro!) - * TODO: we should probably remove this once we're done sanitising the - * simulator... - */ -#define DBG_POLL_START(loopvar) (loopvar = 10) -#define DBG_POLL_CHECK(loopvar) \ -do { \ - if (!(loopvar--)) \ - QBMAN_BUG_ON(NULL == "DBG_POLL_CHECK"); \ -} while (0) - -/* For CCSR or portal-CINH registers that contain fields at arbitrary offsets - * and widths, these macro-generated encode/decode/isolate/remove inlines can - * be used. - * - * Eg. to "d"ecode a 14-bit field out of a register (into a "uint16_t" type), - * where the field is located 3 bits "up" from the least-significant bit of the - * register (ie. the field location within the 32-bit register corresponds to a - * mask of 0x0001fff8), you would do; - * uint16_t field = d32_uint16_t(3, 14, reg_value); - * - * Or to "e"ncode a 1-bit boolean value (input type is "int", zero is FALSE, - * non-zero is TRUE, so must convert all non-zero inputs to 1, hence the "!!" - * operator) into a register at bit location 0x00080000 (19 bits "in" from the - * LS bit), do; - * reg_value |= e32_int(19, 1, !!field); - * - * If you wish to read-modify-write a register, such that you leave the 14-bit - * field as-is but have all other fields set to zero, then "i"solate the 14-bit - * value using; - * reg_value = i32_uint16_t(3, 14, reg_value); - * - * Alternatively, you could "r"emove the 1-bit boolean field (setting it to - * zero) but leaving all other fields as-is; - * reg_val = r32_int(19, 1, reg_value); - * - */ -#ifdef __LP64__ -#define MAKE_MASK32(width) ((uint32_t)((1ULL << width) - 1)) -#else -#define MAKE_MASK32(width) (width == 32 ? 0xffffffff : \ - (uint32_t)((1 << width) - 1)) -#endif -#define DECLARE_CODEC32(t) \ -static inline uint32_t e32_##t(uint32_t lsoffset, uint32_t width, t val) \ -{ \ - QBMAN_BUG_ON(width > (sizeof(t) * 8)); \ - return ((uint32_t)val & MAKE_MASK32(width)) << lsoffset; \ -} \ -static inline t d32_##t(uint32_t lsoffset, uint32_t width, uint32_t val) \ -{ \ - QBMAN_BUG_ON(width > (sizeof(t) * 8)); \ - return (t)((val >> lsoffset) & MAKE_MASK32(width)); \ -} \ -static inline uint32_t i32_##t(uint32_t lsoffset, uint32_t width, \ - uint32_t val) \ -{ \ - QBMAN_BUG_ON(width > (sizeof(t) * 8)); \ - return e32_##t(lsoffset, width, d32_##t(lsoffset, width, val)); \ -} \ -static inline uint32_t r32_##t(uint32_t lsoffset, uint32_t width, \ - uint32_t val) \ -{ \ - QBMAN_BUG_ON(width > (sizeof(t) * 8)); \ - return ~(MAKE_MASK32(width) << lsoffset) & val; \ -} -DECLARE_CODEC32(uint32_t) -DECLARE_CODEC32(uint16_t) -DECLARE_CODEC32(uint8_t) -DECLARE_CODEC32(int) - - /*********************/ - /* Debugging assists */ - /*********************/ - -static inline void __hexdump(unsigned long start, unsigned long end, - unsigned long p, size_t sz, const unsigned char *c) -{ - while (start < end) { - unsigned int pos = 0; - char buf[64]; - int nl = 0; - - pos += sprintf(buf + pos, "%08lx: ", start); - do { - if ((start < p) || (start >= (p + sz))) - pos += sprintf(buf + pos, ".."); - else - pos += sprintf(buf + pos, "%02x", *(c++)); - if (!(++start & 15)) { - buf[pos++] = '\n'; - nl = 1; - } else { - nl = 0; - if (!(start & 1)) - buf[pos++] = ' '; - if (!(start & 3)) - buf[pos++] = ' '; - } - } while (start & 15); - if (!nl) - buf[pos++] = '\n'; - buf[pos] = '\0'; - pr_info("%s", buf); - } -} - -static inline void hexdump(const void *ptr, size_t sz) -{ - unsigned long p = (unsigned long)ptr; - unsigned long start = p & ~(unsigned long)15; - unsigned long end = (p + sz + 15) & ~(unsigned long)15; - const unsigned char *c = ptr; - - __hexdump(start, end, p, sz, c); -} - -#define QMAN_REV_4000 0x04000000 -#define QMAN_REV_4100 0x04010000 -#define QMAN_REV_4101 0x04010001 - -#include "qbman_sys.h" diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index c73d2bf..d56bd69 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -40,6 +40,8 @@ * *not* to provide linux compatibility. */ +#include "qbman_sys_decl.h" + /* Trace the 3 different classes of read/write access to QBMan. #undef as * required. */ @@ -47,6 +49,49 @@ #undef QBMAN_CINH_TRACE #undef QBMAN_CENA_TRACE +/* Debugging assists */ +static inline void __hexdump(unsigned long start, unsigned long end, + unsigned long p, size_t sz, const unsigned char *c) +{ + while (start < end) { + unsigned int pos = 0; + char buf[64]; + int nl = 0; + + pos += sprintf(buf + pos, "%08lx: ", start); + do { + if ((start < p) || (start >= (p + sz))) + pos += sprintf(buf + pos, ".."); + else + pos += sprintf(buf + pos, "%02x", *(c++)); + if (!(++start & 15)) { + buf[pos++] = '\n'; + nl = 1; + } else { + nl = 0; + if (!(start & 1)) + buf[pos++] = ' '; + if (!(start & 3)) + buf[pos++] = ' '; + } + } while (start & 15); + if (!nl) + buf[pos++] = '\n'; + buf[pos] = '\0'; + pr_info("%s", buf); + } +} + +static inline void hexdump(const void *ptr, size_t sz) +{ + unsigned long p = (unsigned long)ptr; + unsigned long start = p & ~15; + unsigned long end = (p + sz + 15) & ~15; + const unsigned char *c = ptr; + + __hexdump(start, end, p, sz, c); +} + /* Currently, the CENA support code expects each 32-bit word to be written in * host order, and these are converted to hardware (little-endian) order on * command submission. However, 64-bit quantities are must be written (and read) @@ -94,34 +139,6 @@ static inline void u64_from_le32_copy(uint64_t *d, const void *s, } } -/* Convert a host-native 32bit value into little endian */ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -static inline uint32_t make_le32(uint32_t val) -{ - return ((val & 0xff) << 24) | ((val & 0xff00) << 8) | - ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24); -} - -static inline uint32_t make_le24(uint32_t val) -{ - return (((val & 0xff) << 16) | (val & 0xff00) | - ((val & 0xff0000) >> 16)); -} - -static inline void make_le32_n(uint32_t *val, unsigned int num) -{ - while (num--) { - *val = make_le32(*val); - val++; - } -} - -#else -#define make_le32(val) (val) -#define make_le24(val) (val) -#define make_le32_n(val, len) do {} while (0) -#endif - /******************/ /* Portal access */ /******************/ @@ -283,20 +300,20 @@ static inline void qbman_cena_prefetch(struct qbman_swp_sys *s, * qbman_portal.c. So use of it is declared locally here. */ #define QBMAN_CINH_SWP_CFG 0xd00 +#define QBMAN_CINH_SWP_CFG 0xd00 +#define SWP_CFG_DQRR_MF_SHIFT 20 +#define SWP_CFG_EST_SHIFT 16 +#define SWP_CFG_WN_SHIFT 14 +#define SWP_CFG_RPM_SHIFT 12 +#define SWP_CFG_DCM_SHIFT 10 +#define SWP_CFG_EPM_SHIFT 8 +#define SWP_CFG_SD_SHIFT 5 +#define SWP_CFG_SP_SHIFT 4 +#define SWP_CFG_SE_SHIFT 3 +#define SWP_CFG_DP_SHIFT 2 +#define SWP_CFG_DE_SHIFT 1 +#define SWP_CFG_EP_SHIFT 0 -/* For MC portal use, we always configure with - * DQRR_MF is (SWP_CFG,20,3) - DQRR max fill (<- 0x4) - * EST is (SWP_CFG,16,3) - EQCR_CI stashing threshold (<- 0x2) - * RPM is (SWP_CFG,12,2) - RCR production notification mode (<- 0x3) - * DCM is (SWP_CFG,10,2) - DQRR consumption notification mode (<- 0x2) - * EPM is (SWP_CFG,8,2) - EQCR production notification mode (<- 0x2) - * SD is (SWP_CFG,5,1) - memory stashing drop enable (<- TRUE) - * SP is (SWP_CFG,4,1) - memory stashing priority (<- TRUE) - * SE is (SWP_CFG,3,1) - memory stashing enable (<- TRUE) - * DP is (SWP_CFG,2,1) - dequeue stashing priority (<- TRUE) - * DE is (SWP_CFG,1,1) - dequeue stashing enable (<- TRUE) - * EP is (SWP_CFG,0,1) - EQCR_CI stashing priority (<- TRUE) - */ static inline uint32_t qbman_set_swp_cfg(uint8_t max_fill, uint8_t wn, uint8_t est, uint8_t rpm, uint8_t dcm, uint8_t epm, int sd, int sp, int se, @@ -304,12 +321,19 @@ static inline uint32_t qbman_set_swp_cfg(uint8_t max_fill, uint8_t wn, { uint32_t reg; - reg = e32_uint8_t(20, (uint32_t)(3 + (max_fill >> 3)), max_fill) | - e32_uint8_t(16, 3, est) | - e32_uint8_t(12, 2, rpm) | e32_uint8_t(10, 2, dcm) | - e32_uint8_t(8, 2, epm) | e32_int(5, 1, sd) | - e32_int(4, 1, sp) | e32_int(3, 1, se) | e32_int(2, 1, dp) | - e32_int(1, 1, de) | e32_int(0, 1, ep) | e32_uint8_t(14, 1, wn); + reg = (max_fill << SWP_CFG_DQRR_MF_SHIFT | + est << SWP_CFG_EST_SHIFT | + wn << SWP_CFG_WN_SHIFT | + rpm << SWP_CFG_RPM_SHIFT | + dcm << SWP_CFG_DCM_SHIFT | + epm << SWP_CFG_EPM_SHIFT | + sd << SWP_CFG_SD_SHIFT | + sp << SWP_CFG_SP_SHIFT | + se << SWP_CFG_SE_SHIFT | + dp << SWP_CFG_DP_SHIFT | + de << SWP_CFG_DE_SHIFT | + ep << SWP_CFG_EP_SHIFT); + return reg; } @@ -322,7 +346,7 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, s->addr_cena = d->cena_bar; s->addr_cinh = d->cinh_bar; s->idx = (uint32_t)d->idx; - s->cena = (void *)get_zeroed_page(GFP_KERNEL); + s->cena = malloc(4096); if (!s->cena) { pr_err("Could not allocate page for cena shadow\n"); return -1; @@ -347,7 +371,7 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG); if (!reg) { pr_err("The portal %d is not enabled!\n", s->idx); - kfree(s->cena); + free(s->cena); return -1; } return 0; @@ -355,5 +379,5 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, static inline void qbman_swp_sys_finish(struct qbman_swp_sys *s) { - free_page((unsigned long)s->cena); + free(s->cena); } diff --git a/drivers/bus/fslmc/qbman/qbman_sys_decl.h b/drivers/bus/fslmc/qbman/qbman_sys_decl.h index e52f5ed..e1125cf 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys_decl.h +++ b/drivers/bus/fslmc/qbman/qbman_sys_decl.h @@ -34,27 +34,6 @@ #error "Unknown endianness!" #endif -/* The platform-independent code shouldn't need endianness, except for - * weird/fast-path cases like qbman_result_has_token(), which needs to - * perform a passive and endianness-specific test on a read-only data structure - * very quickly. It's an exception, and this symbol is used for that case. - */ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define DQRR_TOK_OFFSET 0 -#define QBMAN_RESULT_VERB_OFFSET_IN_MEM 24 -#define SCN_STATE_OFFSET_IN_MEM 8 -#define SCN_RID_OFFSET_IN_MEM 8 -#else -#define DQRR_TOK_OFFSET 24 -#define QBMAN_RESULT_VERB_OFFSET_IN_MEM 0 -#define SCN_STATE_OFFSET_IN_MEM 16 -#define SCN_RID_OFFSET_IN_MEM 0 -#endif - -/* Similarly-named functions */ -#define upper32(a) upper_32_bits(a) -#define lower32(a) lower_32_bits(a) - /****************/ /* arch assists */ /****************/ @@ -64,10 +43,10 @@ #define dccivac(p) { asm volatile("dc civac, %0" : : "r"(p) : "memory"); } static inline void prefetch_for_load(void *p) { - asm volatile("prfm pldl1keep, [%0, #64]" : : "r" (p)); + asm volatile("prfm pldl1keep, [%0, #0]" : : "r" (p)); } static inline void prefetch_for_store(void *p) { - asm volatile("prfm pstl1keep, [%0, #64]" : : "r" (p)); + asm volatile("prfm pstl1keep, [%0, #0]" : : "r" (p)); } From patchwork Fri Sep 8 08:45:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112031 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1244362ybm; Fri, 8 Sep 2017 01:47:53 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4cFuac60SiCCy1z+yy4vcq2Las5/OZ4HB6LBKSbi5VYwuYBNq6AysMVhYzS3wrVTA2wEUh X-Received: by 10.223.130.77 with SMTP id 71mr1378903wrb.247.1504860473702; Fri, 08 Sep 2017 01:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860473; cv=none; d=google.com; s=arc-20160816; b=n6DSg2A4jLbsWQ1RUv38nLplyyja4Ur65klXus8gQcHUO9PxnVOaZJ6zcMARfrwmt1 2MlfzvTIcnAoYrHJCuSWFXFrOBr8ohO4XtW2oLDCxzR9i5Im1b0GfE33FEbJKm4rHb5W YbQcnpjmmoAsrBN0WAFZJrvr9tA+5gyKDbXikP15NcvvHlhPWTnm6ZDgQY/MdQR06vgZ CDm6HSLvxOwsy8C76b1gd198cOmCMWOTFBtDTYFcUwJGjOp5R3gRTeXs0YViWzVghdLM 40N6ZdgKeasgcJiBMdr2SFBr1uFRgm/fL5fiWI1PwjD11PUc17Ehcy78XXWzEIYE97FT nTaQ== 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=P+QUtgM7P7q6qhB1H/JRfBuJJAlq7GRsUuCKoY91jtk=; b=E9HLT3uDJO3FJBYEMr+BP4v+JN1n5Ms1eF6ZfFavJgabQM08W2K/oxsgxUACJQlV/r xMp4ruKvJ5AUO1A67GNZdZm43cmbblEsP9T38a2YzpTIz2/IlCBWO+GsSpbCT317Owu3 KIN/ZOeQwfbOYjARnbihxUtg4Mz7xTOkdTYDwbUGcvvHyGclvcQOME3bsCLzdYTZM/Do vrSqmJQY7sxIHA79Vik4G0oQf9X9OBul2MNwWBHvUxepzNGSlhfSXJuK0WvY+mlajqV+ bmzhgTJVeQnA5eJhGqGIwRHyx1CgTxYb1ddqASXF9ryPRlO96VYKAKhzddxAOfzTfgTk HX4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id h142si1125649wma.113.2017.09.08.01.47.53; Fri, 08 Sep 2017 01:47:53 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 51CA6199C8; Fri, 8 Sep 2017 10:46:13 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0078.outbound.protection.outlook.com [104.47.32.78]) by dpdk.org (Postfix) with ESMTP id 9E837199C8 for ; Fri, 8 Sep 2017 10:46:11 +0200 (CEST) Received: from MWHPR03CA0038.namprd03.prod.outlook.com (10.174.173.155) by BN3PR03MB2257.namprd03.prod.outlook.com (10.166.74.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:08 +0000 Received: from BY2FFO11OLC012.protection.gbl (2a01:111:f400:7c0c::104) by MWHPR03CA0038.outlook.office365.com (2603:10b6:301:3b::27) 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:08 +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 BY2FFO11OLC012.mail.protection.outlook.com (10.1.15.23) 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:08 +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 v888jmof023063; Fri, 8 Sep 2017 01:46:06 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:06 +0530 Message-ID: <1504860327-18451-10-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: 131493339688972272; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(97736004)(2906002)(48376002)(47776003)(68736007)(36756003)(105606002)(50466002)(77096006)(5660300001)(53936002)(54906002)(560934005)(110136004)(85426001)(16200700003)(4326008)(2950100002)(6916009)(50226002)(53946003)(76176999)(5003940100001)(104016004)(50986999)(356003)(189998001)(15650500001)(81156014)(81166006)(498600001)(575784001)(86362001)(305945005)(8676002)(2351001)(106466001)(33646002)(8936002)(8656003)(579004)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2257; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC012; 1:aVOmyg5BII1I2VLdpmw+RzqKQTka1ihbfvBs7N/OlE130AsfbhjQvV9WhK034hM5JtRshgNgwEb78Jkud80mvesC7qWZdzmnBV8od8z3f/8+eF7lJsBpIpUXAra0nl1N MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1161bbd6-5288-44fc-4e93-08d4f6960cf2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN3PR03MB2257; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2257; 3:Mr//Mzi5PK86+6O1Xrj03FG1VQ6PM0HN2ECsqYhyDFURlBHPMUs1EQjM7sJOpWYg0i1pjExzGBY43ekChlPWIQtQSznwfDsmJrdaQriTHrW922ijeRjwmhbxx2paEQVVIC3X4pAADYSefd1WzAG0l2VWOT4b80who4JbIZB4o5jkftPpAXWnX5tn2KSwd83Q9XUh4V3sbmUQXNNChjGRbJmpU95zw8XofwADrm4kGGkaOQc5Te3J2/xNecZclcZpBdtg1bT4LVu7/VsPK/2d891wuZeAThQzXk04SO/Md1GnRNm2EuHoXCASJTICQx+73K/bkc8S3Y6Aaznox1rXTl50SQPB4Qy1AZS87zWDiLE=; 25:ucdZem7Yv8BjUnV1ixaZLutOKEBxFJBbahJSYm4EX7BFalseOfxEFSlprpHP2ouWcxOEyOdTuAku1vpYk95/pxPz7zbMxfSg6HQTBgi3OzVhPmAly2CLHgfT3Q4U1lyPMmLcJUyur6SCFyv6NQxx62jQY/YZyFBfFbORXb0+ikQLfgaaQ3EIXZdfH5fkqwQ1QSdfD1qpbk3lmq6vZMduNaHi1+kXv2LJ1AFnBf4dKSvrYB+gtbk97AJWBpcgis5+X1wKCYyJpeHeggNi7yfIUYAxDFK3MrNxI2R0c2PZZfGj+w9pJ50kkvnBE6ZkI4TMOWveGSWH3MwlVZxkISgP+w== X-MS-TrafficTypeDiagnostic: BN3PR03MB2257: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2257; 31:Zj2FWWsZfeqwX5NfaeP3eC9+RVuCoK5ZCEG/TigyITKjlNmaAiFwGakk+ZFWMifb50kfKwQZ3zW6GEWIZ8AcqSA6DG0oPXz0z6Y32nNZLCjHIft1wMfRHBm0l25qqNYHZkDx4VpD3S7KmXNyyL9l6QYhecn/1g25eP4orHNM7BsShu3xvEnliP1+W5Y5q7JLKQCl2jjQ8aDLw3mA4Yf4qvjsfLJu7doCGyqOZpwMsyE=; 4:lkehgCk8zanLjRJ87lKrceExjHErUr3l62viM8tR4bipzJWgxt6f8TuzOYYmZnnD7H4hhcHiQ8wu1qrthiLX5cQviwpECaE9L530pGiCihWVN+UBhlRq5IiF+CWElTG1rBwqZRKObxT3T6bPEG2hGmQCI6gCWfUPpvlducgVB53X8AZchwCFgSNP2nSgzS3HO33EMlq6rQxxN8LBMRpogvtPeBEipxycg9VU7QFkQR83YtwTOTtXnI6WIGJriju/BC6jIJqMbeaBVw7dFRYErVLFvZxG5nPQdY2BTnpDXH3VUymSI9H2X9shdrH1EjDhYLC16XHTamMbL5wG9ZWig7KSpP0BZ3E6IkvygE80rtIBlPee4MWanMbdlh4gdQbv X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2257; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2257; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2257; 23:Ojnyb3nmx19A/oHZc1RmFlobdRtxxbKL2/DEqL9hK?= 25A6wsOPJ3iyOzphMlgy4wgrDk/SAQT33/IK0ZSkhUvU+N3gvbep7DKOfjfl9AvifMZhfiGeLBiRPCq9Q66Sre//H2SGA5WNI9IA4jjF+js3zphLfzpA4upz5FeuUZon4JKUpb5fuF0wbIgtOC9e2fVYm8oEDQahlVHWNynZ4ABZ89GFUays2uu1CEMA4Q9w56BSATVPXWUNurEE4IfUMusRM7i6Mc1EuwaqQUwEziK/5Ps5Atl7oAX5ew3J8wgyBO1Gfy/w9m+S5ndNlB902ZsmWGm0917BJucVfG+dBX2tV8HGdcMA+QVmfRJb5G1hBez5fqLs99OssqvfMY0fVR+PwtLiAv4t4xxl65dF/IOf6QWX6x1qewLCJbgs128tDP7KBBgfId0Yf9HyuPkq4TxFCGFgSvd6nf3liu2kP+D8ozTAlYEMITfKiE/j0pJsVgGIgTnru7D0iVKGAC2cXsFLJLcjrxJG1q4bDqTKIHqPU5VdLGAVyjS0PFNdCnNN/BhlwHpu19utUM52r5DCehoSyFJvmtgCyr87Zox7eYEkUoKfeIn2AJhwbomsWQLYeLXyxbaMRb/fiMcIdC8gtlI0oBNiS/LZF39l6rbZH5t7L89gXc4reBP0qxIH/bpnADm5T3apb1srnUg4PCEuMwPZzkRQ0hspIfbqjYEyVFFhxI9M6ogMFSWODyCO3l2MhDX0O90O7IUYldAScAT0deYBjNHfxSRrcR1qwAKJugMU26U0U+DNUeEY/ZJHmaMwmn2hWd3mv3zueho/R9qTwuiw+ZtJSDi4FkyalMVmNv3Yt/1WnPEmVdABU3Vt5QkAyvokHIZqZdhkWDbFn2i5c9eGxnYVU6B0VREZZFr2E1K6PzL2lv5BQ6thUrkFv2r2pHR72h3TjZnKfxSESNObeeVresNAXCooNyvBFqT/uxu0WwiKHxyDBr/+CGxgkgwaBRhMf+MXrVEY6E7zhNlJ7CUizxLl6xADbTKsWBAs2WbYXeboLKPqPt9j/5/7ZiPk7JHbg6LbVbmTLgqe0qobYPnH6f/EYjKjedC2fHrAjDnWrjrJcmOfBY0gLQhZ1XZH+ZMxI/viU8xsbJhmwwebCNhrYqYVmmuI1FTdcMhPWulQiAzCDiFUoUNkiPsNQDZXUBSDS4U7u1CpKmC3dbALuR9lI0xOJvcPmaqHab75krE5Cg3exKWRy+MMgNrOz1aFcg= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2257; 6:S4ZMPpWvtt97hLv/w1Y0yGbm+x45CJGwlffTlAgdwfCW9rg+RsSwElqDFDKnk2uuzQzH3lihT/ZRfEFs6EqWAjMfMAWFyPrkwD6lrAHI5S9mmU5UAthKuqHTFax91FdwU6BWbYhEn9LP5vyQrefkGmQSnNOMl7u3J/5RD1aMc0ws548KBzXwrhhVH3TttZZGIZPnhttQzgpx+a2/N4l8SJoXNBSv8+lAyYaaZI68T2F28Qwbk96Yu24SJ7soU4DqiLkSW1IOWKY6lYqGAJxgB+emhLVzZzQY+LlLXBKS1w8diu3lABikeQ63narIjp9HKGQpxLHP5Ro2OBcorHUyBA==; 5:Z2KQ/cca8Y8LRv9iTkbSjjlT1pOckAchj1ElNHWh4wCC16DyxJALVvBkNGxmdE0n80mkre6iids5NObS2s6k6DpGFhf6V81dNQS+RUB/dXQ6+S2a9uEvsn2x7udJ8ZqQeOWa7mivQTvJbjD9GZmr5Q==; 24:vhzt49pV4D5GUNdogOEFw2iZY9j6t0hSgCJuJcq/D7g/SaABnng/JHnC/XnxwYpC0f4JkJQ3N7I/hfGKxSt9234LfoGZe+kCI5Y5//uSr+Y=; 7:wJD70KJVCdEnIZD3rI273YpaL6hftGEdQrTErSEhgsAORAwihECpMaCsThJZC7EHlv0QXXK1cGKH5nyUeBogMtdGjL9PWpzYvqH06mwsZHiky3jJDySmWdJQzhOhd1Kugm7QJH0b2/fS0iTbF9Iap+k+KGlnfnEJFTU9UlOTITl+1JIHyAad9TItlo53sz6CdHaqxpkRdcuEm7ej7Nn5RAAivdbSk5RoysYQucF5lfk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:08.6788 (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: BN3PR03MB2257 Subject: [dpdk-dev] [PATCH v2 09/30] bus/fslmc: update MC to 10.3.x 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" From: Shreyansh Jain Signed-off-by: Shreyansh Jain Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 19 +++ drivers/bus/fslmc/mc/dpbp.c | 182 +++++++++++++++++---- drivers/bus/fslmc/mc/dpci.c | 202 ++++++++++++++++++++--- drivers/bus/fslmc/mc/dpcon.c | 163 ++++++++++++++++--- drivers/bus/fslmc/mc/dpio.c | 230 ++++++++++++++++++++++++--- drivers/bus/fslmc/mc/dpmng.c | 33 +++- drivers/bus/fslmc/mc/fsl_dpbp.h | 191 +++++----------------- drivers/bus/fslmc/mc/fsl_dpbp_cmd.h | 125 ++++++++++----- drivers/bus/fslmc/mc/fsl_dpci.h | 257 +++++++----------------------- drivers/bus/fslmc/mc/fsl_dpci_cmd.h | 222 ++++++++++++++------------ drivers/bus/fslmc/mc/fsl_dpcon.h | 186 ++++------------------ drivers/bus/fslmc/mc/fsl_dpcon_cmd.h | 193 ++++++++-------------- drivers/bus/fslmc/mc/fsl_dpio.h | 299 +++++++++-------------------------- drivers/bus/fslmc/mc/fsl_dpio_cmd.h | 178 ++++++++++++--------- drivers/bus/fslmc/mc/fsl_dpmng.h | 41 ++--- drivers/bus/fslmc/mc/fsl_dpmng_cmd.h | 41 +++-- drivers/bus/fslmc/mc/fsl_mc_cmd.h | 217 +++++++++++-------------- drivers/bus/fslmc/mc/fsl_mc_sys.h | 36 ++--- drivers/bus/fslmc/mc/mc_sys.c | 5 +- 19 files changed, 1452 insertions(+), 1368 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 42a99e8..cdc982b 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -58,6 +58,7 @@ #include "rte_fslmc.h" #include "fslmc_vfio.h" +#include #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h" @@ -417,6 +418,8 @@ fslmc_process_mcp(struct rte_dpaa2_device *dev) { int64_t v_addr; char *dev_name; + struct fsl_mc_io dpmng = {0}; + struct mc_version mc_ver_info = {0}; rte_mcp_ptr_list = malloc(sizeof(void *) * 1); if (!rte_mcp_ptr_list) { @@ -441,6 +444,22 @@ fslmc_process_mcp(struct rte_dpaa2_device *dev) return -1; } + /* check the MC version compatibility */ + dpmng.regs = (void *)v_addr; + if (mc_get_version(&dpmng, CMD_PRI_LOW, &mc_ver_info)) + RTE_LOG(WARNING, PMD, "\tmc_get_version failed\n"); + + if ((mc_ver_info.major != MC_VER_MAJOR) || + (mc_ver_info.minor < MC_VER_MINOR)) { + RTE_LOG(ERR, PMD, "DPAA2 MC version not compatible!" + " Expected %d.%d.x, Detected %d.%d.%d\n", + MC_VER_MAJOR, MC_VER_MINOR, + mc_ver_info.major, mc_ver_info.minor, + mc_ver_info.revision); + free(rte_mcp_ptr_list); + rte_mcp_ptr_list = NULL; + return -1; + } rte_mcp_ptr_list[0] = (void *)v_addr; return 0; diff --git a/drivers/bus/fslmc/mc/dpbp.c b/drivers/bus/fslmc/mc/dpbp.c index fd9a52d..a846245 100644 --- a/drivers/bus/fslmc/mc/dpbp.c +++ b/drivers/bus/fslmc/mc/dpbp.c @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -42,19 +42,37 @@ #include #include +/** + * dpbp_open() - Open a control session for the specified object. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpbp_id: DPBP unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpbp_create function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpbp_id, uint16_t *token) { + struct dpbp_cmd_open *cmd_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_OPEN, - cmd_flags, - 0); - DPBP_CMD_OPEN(cmd, dpbp_id); + cmd_flags, 0); + cmd_params = (struct dpbp_cmd_open *)cmd.params; + cmd_params->dpbp_id = cpu_to_le32(dpbp_id); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -62,11 +80,22 @@ int dpbp_open(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + *token = mc_cmd_hdr_read_token(&cmd); return err; } +/** + * dpbp_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -81,6 +110,24 @@ int dpbp_close(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpbp_create() - Create the DPBP object. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: Returned object id; use in subsequent API calls + * + * Create the DPBP object, allocate required resources and + * perform required initialization. + * + * This function accepts an authentication token of a parent + * container that this object should be assigned to and returns + * an object id. This object_id will be used in all subsequent calls to + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_create(struct fsl_mc_io *mc_io, uint16_t dprc_token, uint32_t cmd_flags, @@ -94,8 +141,7 @@ int dpbp_create(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_CREATE, - cmd_flags, - dprc_token); + cmd_flags, dprc_token); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -103,28 +149,47 @@ int dpbp_create(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + *obj_id = mc_cmd_read_object_id(&cmd); return 0; } +/** + * dpbp_destroy() - Destroy the DPBP object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @obj_id: ID of DPBP object + * + * Return: '0' on Success; error code otherwise. + */ int dpbp_destroy(struct fsl_mc_io *mc_io, uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id) + uint32_t cmd_flags, + uint32_t obj_id) { + struct dpbp_cmd_destroy *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_DESTROY, - cmd_flags, - dprc_token); - /* set object id to destroy */ - CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); + cmd_flags, dprc_token); + + cmd_params = (struct dpbp_cmd_destroy *)cmd.params; + cmd_params->object_id = cpu_to_le32(obj_id); + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpbp_enable() - Enable the DPBP. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_enable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -139,6 +204,14 @@ int dpbp_enable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpbp_disable() - Disable the DPBP. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_disable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -147,20 +220,30 @@ int dpbp_disable(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_DISABLE, - cmd_flags, - token); + cmd_flags, token); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpbp_is_enabled() - Check if the DPBP is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { + struct dpbp_rsp_is_enabled *rsp_params; struct mc_command cmd = { 0 }; int err; + /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_IS_ENABLED, cmd_flags, token); @@ -171,11 +254,20 @@ int dpbp_is_enabled(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPBP_RSP_IS_ENABLED(cmd, *en); + rsp_params = (struct dpbp_rsp_is_enabled *)cmd.params; + *en = rsp_params->enabled & DPBP_ENABLE; return 0; } +/** + * dpbp_reset() - Reset the DPBP, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_reset(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -184,8 +276,7 @@ int dpbp_reset(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_RESET, - cmd_flags, - token); + cmd_flags, token); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -195,13 +286,13 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io, uint16_t token, struct dpbp_attr *attr) { + struct dpbp_rsp_get_attributes *rsp_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_ATTR, - cmd_flags, - token); + cmd_flags, token); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -209,38 +300,64 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPBP_RSP_GET_ATTRIBUTES(cmd, attr); + rsp_params = (struct dpbp_rsp_get_attributes *)cmd.params; + attr->bpid = le16_to_cpu(rsp_params->bpid); + attr->id = le32_to_cpu(rsp_params->id); return 0; } - +/** + * dpbp_get_api_version - Get Data Path Buffer Pool API version + * @mc_io: Pointer to Mc portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of Buffer Pool API + * @minor_ver: Minor version of Buffer Pool API + * + * Return: '0' on Success; Error code otherwise. + */ int dpbp_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver) + uint16_t *major_ver, + uint16_t *minor_ver) { + struct dpbp_rsp_get_api_version *rsp_params; struct mc_command cmd = { 0 }; int err; + /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_API_VERSION, - cmd_flags, - 0); + cmd_flags, 0); + /* send command to mc */ err = mc_send_command(mc_io, &cmd); if (err) return err; - DPBP_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + /* retrieve response parameters */ + rsp_params = (struct dpbp_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); return 0; } -int dpbp_get_num_free_bufs(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, +/** + * dpbp_get_num_free_bufs() - Get number of free buffers in the buffer pool + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * @num_free_bufs: Number of free buffers + * + * Return: '0' on Success; Error code otherwise. + */ + +int dpbp_get_num_free_bufs(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, uint32_t *num_free_bufs) { + struct dpbp_rsp_get_num_free_bufs *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -255,7 +372,8 @@ int dpbp_get_num_free_bufs(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPBP_RSP_GET_NUM_FREE_BUFS(cmd, *num_free_bufs); + rsp_params = (struct dpbp_rsp_get_num_free_bufs *)cmd.params; + *num_free_bufs = le32_to_cpu(rsp_params->num_free_bufs); return 0; } diff --git a/drivers/bus/fslmc/mc/dpci.c b/drivers/bus/fslmc/mc/dpci.c index 0ea7837..5471024 100644 --- a/drivers/bus/fslmc/mc/dpci.c +++ b/drivers/bus/fslmc/mc/dpci.c @@ -41,11 +41,29 @@ #include #include +/** + * dpci_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpci_id: DPCI unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpci_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpci_id, uint16_t *token) { + struct dpci_cmd_open *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -53,7 +71,8 @@ int dpci_open(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPCI_CMDID_OPEN, cmd_flags, 0); - DPCI_CMD_OPEN(cmd, dpci_id); + cmd_params = (struct dpci_cmd_open *)cmd.params; + cmd_params->dpci_id = cpu_to_le32(dpci_id); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -61,11 +80,22 @@ int dpci_open(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + *token = mc_cmd_hdr_read_token(&cmd); return 0; } +/** + * dpci_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -81,12 +111,35 @@ int dpci_close(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpci_create() - Create the DPCI object. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: Returned object id + * + * Create the DPCI object, allocate required resources and perform required + * initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * The function accepts an authentication token of a parent + * container that this object should be assigned to. The token + * can be '0' so the object will be assigned to the default container. + * The newly created object can be opened with the returned + * object id and using the container's associated tokens and MC portals. + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_create(struct fsl_mc_io *mc_io, uint16_t dprc_token, uint32_t cmd_flags, const struct dpci_cfg *cfg, uint32_t *obj_id) { + struct dpci_cmd_create *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -94,7 +147,8 @@ int dpci_create(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPCI_CMDID_CREATE, cmd_flags, dprc_token); - DPCI_CMD_CREATE(cmd, cfg); + cmd_params = (struct dpci_cmd_create *)cmd.params; + cmd_params->num_of_priorities = cfg->num_of_priorities; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -102,28 +156,53 @@ int dpci_create(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + *obj_id = mc_cmd_read_object_id(&cmd); return 0; } +/** + * dpci_destroy() - Destroy the DPCI object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @object_id: The object id; it must be a valid id within the container that + * created this object; + * + * The function accepts the authentication token of the parent container that + * created the object (not the one that currently owns the object). The object + * is searched within parent using the provided 'object_id'. + * All tokens to the object must be closed before calling destroy. + * + * Return: '0' on Success; error code otherwise. + */ int dpci_destroy(struct fsl_mc_io *mc_io, uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id) + uint32_t cmd_flags, + uint32_t object_id) { + struct dpci_cmd_destroy *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPCI_CMDID_DESTROY, cmd_flags, dprc_token); - /* set object id to destroy */ - CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); + cmd_params = (struct dpci_cmd_destroy *)cmd.params; + cmd_params->dpci_id = cpu_to_le32(object_id); + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpci_enable() - Enable the DPCI, allow sending and receiving frames. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_enable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -139,6 +218,14 @@ int dpci_enable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpci_disable() - Disable the DPCI, stop sending and receiving frames. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_disable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -154,13 +241,24 @@ int dpci_disable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpci_is_enabled() - Check if the DPCI is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { + struct dpci_rsp_is_enabled *rsp_params; struct mc_command cmd = { 0 }; int err; + /* prepare command */ cmd.header = mc_encode_cmd_header(DPCI_CMDID_IS_ENABLED, cmd_flags, token); @@ -171,11 +269,20 @@ int dpci_is_enabled(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPCI_RSP_IS_ENABLED(cmd, *en); + rsp_params = (struct dpci_rsp_is_enabled *)cmd.params; + *en = dpci_get_field(rsp_params->en, ENABLE); return 0; } +/** + * dpci_reset() - Reset the DPCI, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_reset(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -196,6 +303,7 @@ int dpci_get_attributes(struct fsl_mc_io *mc_io, uint16_t token, struct dpci_attr *attr) { + struct dpci_rsp_get_attr *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -210,7 +318,9 @@ int dpci_get_attributes(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPCI_RSP_GET_ATTRIBUTES(cmd, attr); + rsp_params = (struct dpci_rsp_get_attr *)cmd.params; + attr->id = le32_to_cpu(rsp_params->id); + attr->num_of_priorities = rsp_params->num_of_priorities; return 0; } @@ -221,24 +331,46 @@ int dpci_set_rx_queue(struct fsl_mc_io *mc_io, uint8_t priority, const struct dpci_rx_queue_cfg *cfg) { + struct dpci_cmd_set_rx_queue *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPCI_CMDID_SET_RX_QUEUE, cmd_flags, token); - DPCI_CMD_SET_RX_QUEUE(cmd, priority, cfg); + cmd_params = (struct dpci_cmd_set_rx_queue *)cmd.params; + cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); + cmd_params->dest_priority = cfg->dest_cfg.priority; + cmd_params->priority = priority; + cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx); + cmd_params->options = cpu_to_le32(cfg->options); + dpci_set_field(cmd_params->dest_type, + DEST_TYPE, + cfg->dest_cfg.dest_type); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpci_get_rx_queue() - Retrieve Rx queue attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @priority: Select the queue relative to number of + * priorities configured at DPCI creation + * @attr: Returned Rx queue attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_get_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t priority, struct dpci_rx_queue_attr *attr) { + struct dpci_cmd_get_queue *cmd_params; + struct dpci_rsp_get_rx_queue *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -246,7 +378,8 @@ int dpci_get_rx_queue(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_RX_QUEUE, cmd_flags, token); - DPCI_CMD_GET_RX_QUEUE(cmd, priority); + cmd_params = (struct dpci_cmd_get_queue *)cmd.params; + cmd_params->priority = priority; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -254,17 +387,36 @@ int dpci_get_rx_queue(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPCI_RSP_GET_RX_QUEUE(cmd, attr); + rsp_params = (struct dpci_rsp_get_rx_queue *)cmd.params; + attr->user_ctx = le64_to_cpu(rsp_params->user_ctx); + attr->fqid = le32_to_cpu(rsp_params->fqid); + attr->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id); + attr->dest_cfg.priority = rsp_params->dest_priority; + attr->dest_cfg.dest_type = dpci_get_field(rsp_params->dest_type, + DEST_TYPE); return 0; } +/** + * dpci_get_tx_queue() - Retrieve Tx queue attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCI object + * @priority: Select the queue relative to number of + * priorities of the peer DPCI object + * @attr: Returned Tx queue attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_get_tx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t priority, struct dpci_tx_queue_attr *attr) { + struct dpci_cmd_get_queue *cmd_params; + struct dpci_rsp_get_tx_queue *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -272,7 +424,8 @@ int dpci_get_tx_queue(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPCI_CMDID_GET_TX_QUEUE, cmd_flags, token); - DPCI_CMD_GET_TX_QUEUE(cmd, priority); + cmd_params = (struct dpci_cmd_get_queue *)cmd.params; + cmd_params->priority = priority; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -280,16 +433,27 @@ int dpci_get_tx_queue(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPCI_RSP_GET_TX_QUEUE(cmd, attr); + rsp_params = (struct dpci_rsp_get_tx_queue *)cmd.params; + attr->fqid = le32_to_cpu(rsp_params->fqid); return 0; } +/** + * dpci_get_api_version() - Get communication interface API version + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of data path communication interface API + * @minor_ver: Minor version of data path communication interface API + * + * Return: '0' on Success; Error code otherwise. + */ int dpci_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver) + uint16_t *major_ver, + uint16_t *minor_ver) { + struct dpci_rsp_get_api_version *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -301,7 +465,9 @@ int dpci_get_api_version(struct fsl_mc_io *mc_io, if (err) return err; - DPCI_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + rsp_params = (struct dpci_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); return 0; } diff --git a/drivers/bus/fslmc/mc/dpcon.c b/drivers/bus/fslmc/mc/dpcon.c index b078dff..477ee46 100644 --- a/drivers/bus/fslmc/mc/dpcon.c +++ b/drivers/bus/fslmc/mc/dpcon.c @@ -34,19 +34,38 @@ #include #include +/** + * dpcon_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpcon_id: DPCON unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpcon_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ int dpcon_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpcon_id, uint16_t *token) { struct mc_command cmd = { 0 }; + struct dpcon_cmd_open *dpcon_cmd; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPCON_CMDID_OPEN, cmd_flags, 0); - DPCON_CMD_OPEN(cmd, dpcon_id); + dpcon_cmd = (struct dpcon_cmd_open *)cmd.params; + dpcon_cmd->dpcon_id = cpu_to_le32(dpcon_id); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -54,11 +73,22 @@ int dpcon_open(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + *token = mc_cmd_hdr_read_token(&cmd); return 0; } +/** + * dpcon_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ int dpcon_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -74,12 +104,34 @@ int dpcon_close(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpcon_create() - Create the DPCON object. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: Returned object id; use in subsequent API calls + * + * Create the DPCON object, allocate required resources and + * perform required initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * This function accepts an authentication token of a parent + * container that this object should be assigned to and returns + * an object id. This object_id will be used in all subsequent calls to + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ int dpcon_create(struct fsl_mc_io *mc_io, uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpcon_cfg *cfg, - uint32_t *obj_id) + uint32_t cmd_flags, + const struct dpcon_cfg *cfg, + uint32_t *obj_id) { + struct dpcon_cmd_create *dpcon_cmd; struct mc_command cmd = { 0 }; int err; @@ -87,7 +139,8 @@ int dpcon_create(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPCON_CMDID_CREATE, cmd_flags, dprc_token); - DPCON_CMD_CREATE(cmd, cfg); + dpcon_cmd = (struct dpcon_cmd_create *)cmd.params; + dpcon_cmd->num_priorities = cfg->num_priorities; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -95,28 +148,47 @@ int dpcon_create(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + *obj_id = mc_cmd_read_object_id(&cmd); return 0; } +/** + * dpcon_destroy() - Destroy the DPCON object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @obj_id: ID of DPCON object + * + * Return: '0' on Success; error code otherwise. + */ int dpcon_destroy(struct fsl_mc_io *mc_io, uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id) + uint32_t cmd_flags, + uint32_t obj_id) { + struct dpcon_cmd_destroy *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPCON_CMDID_DESTROY, cmd_flags, dprc_token); - /* set object id to destroy */ - CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); + cmd_params = (struct dpcon_cmd_destroy *)cmd.params; + cmd_params->object_id = cpu_to_le32(obj_id); + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpcon_enable() - Enable the DPCON + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * Return: '0' on Success; Error code otherwise + */ int dpcon_enable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -132,6 +204,14 @@ int dpcon_enable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpcon_disable() - Disable the DPCON + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * Return: '0' on Success; Error code otherwise + */ int dpcon_disable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -147,13 +227,24 @@ int dpcon_disable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpcon_is_enabled() - Check if the DPCON is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpcon_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { + struct dpcon_rsp_is_enabled *dpcon_rsp; struct mc_command cmd = { 0 }; int err; + /* prepare command */ cmd.header = mc_encode_cmd_header(DPCON_CMDID_IS_ENABLED, cmd_flags, @@ -165,11 +256,20 @@ int dpcon_is_enabled(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPCON_RSP_IS_ENABLED(cmd, *en); + dpcon_rsp = (struct dpcon_rsp_is_enabled *)cmd.params; + *en = dpcon_rsp->enabled & DPCON_ENABLE; return 0; } +/** + * dpcon_reset() - Reset the DPCON, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * Return: '0' on Success; Error code otherwise. + */ int dpcon_reset(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -184,11 +284,21 @@ int dpcon_reset(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpcon_get_attributes() - Retrieve DPCON attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * @attr: Object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpcon_get_attributes(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, struct dpcon_attr *attr) { + struct dpcon_rsp_get_attr *dpcon_rsp; struct mc_command cmd = { 0 }; int err; @@ -203,28 +313,45 @@ int dpcon_get_attributes(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPCON_RSP_GET_ATTR(cmd, attr); + dpcon_rsp = (struct dpcon_rsp_get_attr *)cmd.params; + attr->id = le32_to_cpu(dpcon_rsp->id); + attr->qbman_ch_id = le16_to_cpu(dpcon_rsp->qbman_ch_id); + attr->num_priorities = dpcon_rsp->num_priorities; return 0; } +/** + * dpcon_get_api_version - Get Data Path Concentrator API version + * @mc_io: Pointer to MC portal's DPCON object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of DPCON API + * @minor_ver: Minor version of DPCON API + * + * Return: '0' on Success; Error code otherwise + */ int dpcon_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver) + uint16_t *major_ver, + uint16_t *minor_ver) { + struct dpcon_rsp_get_api_version *rsp_params; struct mc_command cmd = { 0 }; int err; + /* prepare command */ cmd.header = mc_encode_cmd_header(DPCON_CMDID_GET_API_VERSION, - cmd_flags, - 0); + cmd_flags, 0); + /* send command to mc */ err = mc_send_command(mc_io, &cmd); if (err) return err; - DPCON_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + /* retrieve response parameters */ + rsp_params = (struct dpcon_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); return 0; } diff --git a/drivers/bus/fslmc/mc/dpio.c b/drivers/bus/fslmc/mc/dpio.c index 608b57a..76c5d7b 100644 --- a/drivers/bus/fslmc/mc/dpio.c +++ b/drivers/bus/fslmc/mc/dpio.c @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -42,11 +42,29 @@ #include #include +/** + * dpio_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpio_id: DPIO unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpio_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and any MC portals + * assigned to the parent container; this token must be used in + * all subsequent commands for this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpio_id, uint16_t *token) { + struct dpio_cmd_open *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -54,7 +72,8 @@ int dpio_open(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPIO_CMDID_OPEN, cmd_flags, 0); - DPIO_CMD_OPEN(cmd, dpio_id); + cmd_params = (struct dpio_cmd_open *)cmd.params; + cmd_params->dpio_id = cpu_to_le32(dpio_id); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -62,11 +81,19 @@ int dpio_open(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + *token = mc_cmd_hdr_read_token(&cmd); return 0; } +/** + * dpio_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -82,12 +109,35 @@ int dpio_close(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } -int dpio_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpio_cfg *cfg, - uint32_t *obj_id) +/** + * dpio_create() - Create the DPIO object. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: Returned object id + * + * Create the DPIO object, allocate required resources and + * perform required initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * The function accepts an authentication token of a parent + * container that this object should be assigned to. The token + * can be '0' so the object will be assigned to the default container. + * The newly created object can be opened with the returned + * object id and using the container's associated tokens and MC portals. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpio_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpio_cfg *cfg, + uint32_t *obj_id) { + struct dpio_cmd_create *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -95,7 +145,11 @@ int dpio_create(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPIO_CMDID_CREATE, cmd_flags, dprc_token); - DPIO_CMD_CREATE(cmd, cfg); + cmd_params = (struct dpio_cmd_create *)cmd.params; + cmd_params->num_priorities = cfg->num_priorities; + dpio_set_field(cmd_params->channel_mode, + CHANNEL_MODE, + cfg->channel_mode); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -103,28 +157,55 @@ int dpio_create(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + *obj_id = mc_cmd_read_object_id(&cmd); return 0; } -int dpio_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id) +/** + * dpio_destroy() - Destroy the DPIO object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @object_id: The object id; it must be a valid id within the container that + * created this object; + * + * The function accepts the authentication token of the parent container that + * created the object (not the one that currently owns the object). The object + * is searched within parent using the provided 'object_id'. + * All tokens to the object must be closed before calling destroy. + * + * Return: '0' on Success; Error code otherwise + */ +int dpio_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id) { + struct dpio_cmd_destroy *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPIO_CMDID_DESTROY, cmd_flags, dprc_token); + /* set object id to destroy */ - CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); + cmd_params = (struct dpio_cmd_destroy *)cmd.params; + cmd_params->dpio_id = cpu_to_le32(object_id); + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpio_enable() - Enable the DPIO, allow I/O portal operations. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * + * Return: '0' on Success; Error code otherwise + */ int dpio_enable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -140,6 +221,14 @@ int dpio_enable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpio_disable() - Disable the DPIO, stop any I/O portal operation. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * + * Return: '0' on Success; Error code otherwise + */ int dpio_disable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -155,13 +244,24 @@ int dpio_disable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpio_is_enabled() - Check if the DPIO is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { + struct dpio_rsp_is_enabled *rsp_params; struct mc_command cmd = { 0 }; int err; + /* prepare command */ cmd.header = mc_encode_cmd_header(DPIO_CMDID_IS_ENABLED, cmd_flags, token); @@ -172,11 +272,20 @@ int dpio_is_enabled(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPIO_RSP_IS_ENABLED(cmd, *en); + rsp_params = (struct dpio_rsp_is_enabled *)cmd.params; + *en = dpio_get_field(rsp_params->en, ENABLE); return 0; } +/** + * dpio_reset() - Reset the DPIO, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_reset(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -197,6 +306,7 @@ int dpio_get_attributes(struct fsl_mc_io *mc_io, uint16_t token, struct dpio_attr *attr) { + struct dpio_rsp_get_attr *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -211,33 +321,65 @@ int dpio_get_attributes(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPIO_RSP_GET_ATTRIBUTES(cmd, attr); + rsp_params = (struct dpio_rsp_get_attr *)cmd.params; + attr->id = le32_to_cpu(rsp_params->id); + attr->qbman_portal_id = le16_to_cpu(rsp_params->qbman_portal_id); + attr->num_priorities = rsp_params->num_priorities; + attr->qbman_portal_ce_offset = + le64_to_cpu(rsp_params->qbman_portal_ce_offset); + attr->qbman_portal_ci_offset = + le64_to_cpu(rsp_params->qbman_portal_ci_offset); + attr->qbman_version = le32_to_cpu(rsp_params->qbman_version); + attr->clk = le32_to_cpu(rsp_params->clk); + attr->channel_mode = dpio_get_field(rsp_params->channel_mode, + ATTR_CHANNEL_MODE); return 0; } +/** + * dpio_set_stashing_destination() - Set the stashing destination. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * @sdest: Stashing destination value + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_set_stashing_destination(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t sdest) { + struct dpio_stashing_dest *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPIO_CMDID_SET_STASHING_DEST, cmd_flags, token); - DPIO_CMD_SET_STASHING_DEST(cmd, sdest); + cmd_params = (struct dpio_stashing_dest *)cmd.params; + cmd_params->sdest = sdest; /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpio_get_stashing_destination() - Get the stashing destination.. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * @sdest: Returns the stashing destination value + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_get_stashing_destination(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t *sdest) { + struct dpio_stashing_dest *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -252,17 +394,30 @@ int dpio_get_stashing_destination(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPIO_RSP_GET_STASHING_DEST(cmd, *sdest); + rsp_params = (struct dpio_stashing_dest *)cmd.params; + *sdest = rsp_params->sdest; return 0; } +/** + * dpio_add_static_dequeue_channel() - Add a static dequeue channel. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * @dpcon_id: DPCON object ID + * @channel_index: Returned channel index to be used in qbman API + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int dpcon_id, uint8_t *channel_index) { + struct dpio_rsp_add_static_dequeue_channel *rsp_params; + struct dpio_cmd_static_dequeue_channel *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -270,7 +425,8 @@ int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPIO_CMDID_ADD_STATIC_DEQUEUE_CHANNEL, cmd_flags, token); - DPIO_CMD_ADD_STATIC_DEQUEUE_CHANNEL(cmd, dpcon_id); + cmd_params = (struct dpio_cmd_static_dequeue_channel *)cmd.params; + cmd_params->dpcon_id = cpu_to_le32(dpcon_id); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -278,16 +434,27 @@ int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPIO_RSP_ADD_STATIC_DEQUEUE_CHANNEL(cmd, *channel_index); + rsp_params = (struct dpio_rsp_add_static_dequeue_channel *)cmd.params; + *channel_index = rsp_params->channel_index; return 0; } +/** + * dpio_remove_static_dequeue_channel() - Remove a static dequeue channel. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPIO object + * @dpcon_id: DPCON object ID + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int dpcon_id) { + struct dpio_cmd_static_dequeue_channel *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ @@ -295,17 +462,28 @@ int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io, DPIO_CMDID_REMOVE_STATIC_DEQUEUE_CHANNEL, cmd_flags, token); - DPIO_CMD_REMOVE_STATIC_DEQUEUE_CHANNEL(cmd, dpcon_id); + cmd_params = (struct dpio_cmd_static_dequeue_channel *)cmd.params; + cmd_params->dpcon_id = cpu_to_le32(dpcon_id); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpio_get_api_version() - Get Data Path I/O API version + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of data path i/o API + * @minor_ver: Minor version of data path i/o API + * + * Return: '0' on Success; Error code otherwise. + */ int dpio_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver) + uint16_t *major_ver, + uint16_t *minor_ver) { + struct dpio_rsp_get_api_version *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -317,7 +495,9 @@ int dpio_get_api_version(struct fsl_mc_io *mc_io, if (err) return err; - DPIO_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + rsp_params = (struct dpio_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); return 0; } diff --git a/drivers/bus/fslmc/mc/dpmng.c b/drivers/bus/fslmc/mc/dpmng.c index dd1c3ac..f9946e8 100644 --- a/drivers/bus/fslmc/mc/dpmng.c +++ b/drivers/bus/fslmc/mc/dpmng.c @@ -5,6 +5,7 @@ * BSD LICENSE * * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -41,11 +42,21 @@ #include #include +/** + * mc_get_version() - Retrieves the Management Complex firmware + * version information + * @mc_io: Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @mc_ver_info: Returned version information structure + * + * Return: '0' on Success; Error code otherwise. + */ int mc_get_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, struct mc_version *mc_ver_info) { struct mc_command cmd = { 0 }; + struct dpmng_rsp_get_version *rsp_params; int err; /* prepare command */ @@ -59,15 +70,31 @@ int mc_get_version(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPMNG_RSP_GET_VERSION(cmd, mc_ver_info); + rsp_params = (struct dpmng_rsp_get_version *)cmd.params; + mc_ver_info->revision = le32_to_cpu(rsp_params->revision); + mc_ver_info->major = le32_to_cpu(rsp_params->version_major); + mc_ver_info->minor = le32_to_cpu(rsp_params->version_minor); return 0; } +/** + * mc_get_soc_version() - Retrieves the Management Complex firmware + * version information + * @mc_io Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @mc_platform_info: Returned version information structure. The structure + * contains the values of SVR and PVR registers. + * Please consult platform specific reference manual + * for detailed information. + * + * Return: '0' on Success; Error code otherwise. + */ int mc_get_soc_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, struct mc_soc_version *mc_platform_info) { + struct dpmng_rsp_get_soc_version *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -82,7 +109,9 @@ int mc_get_soc_version(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPMNG_RSP_GET_SOC_VERSION(cmd, mc_platform_info); + rsp_params = (struct dpmng_rsp_get_soc_version *)cmd.params; + mc_platform_info->svr = le32_to_cpu(rsp_params->svr); + mc_platform_info->pvr = le32_to_cpu(rsp_params->pvr); return 0; } diff --git a/drivers/bus/fslmc/mc/fsl_dpbp.h b/drivers/bus/fslmc/mc/fsl_dpbp.h index 32bb9aa..77ea6f2 100644 --- a/drivers/bus/fslmc/mc/fsl_dpbp.h +++ b/drivers/bus/fslmc/mc/fsl_dpbp.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -40,48 +40,21 @@ #ifndef __FSL_DPBP_H #define __FSL_DPBP_H -/* Data Path Buffer Pool API +/* + * Data Path Buffer Pool API * Contains initialization APIs and runtime control APIs for DPBP */ struct fsl_mc_io; -/** - * dpbp_open() - Open a control session for the specified object. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @dpbp_id: DPBP unique ID - * @token: Returned token; use in subsequent API calls - * - * This function can be used to open a control session for an - * already created object; an object may have been declared in - * the DPL or by calling the dpbp_create function. - * This function returns a unique authentication token, - * associated with the specific object ID and the specific MC - * portal; this token must be used in all subsequent commands for - * this specific object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpbp_id, - uint16_t *token); +int dpbp_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpbp_id, + uint16_t *token); -/** - * dpbp_close() - Close the control session of the object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * - * After this function is called, no further operations are - * allowed on the object without opening a new control session. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpbp_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpbp_cfg - Structure representing DPBP configuration @@ -91,98 +64,33 @@ struct dpbp_cfg { uint32_t options; }; -/** - * dpbp_create() - Create the DPBP object. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @cfg: Configuration structure - * @obj_id: returned object id - * - * Create the DPBP object, allocate required resources and - * perform required initialization. - * - * The object can be created either by declaring it in the - * DPL file, or by calling this function. - * - * The function accepts an authentication token of a parent - * container that this object should be assigned to. The token - * can be '0' so the object will be assigned to the default container. - * The newly created object can be opened with the returned - * object id and using the container's associated tokens and MC portals. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpbp_cfg *cfg, - uint32_t *obj_id); +int dpbp_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpbp_cfg *cfg, + uint32_t *obj_id); -/** - * dpbp_destroy() - Destroy the DPBP object and release all its resources. - * @dprc_token: Parent container token; '0' for default container - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @object_id: The object id; it must be a valid id within the container that - * created this object; - * - * Return: '0' on Success; error code otherwise. - */ -int dpbp_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id); +int dpbp_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t obj_id); -/** - * dpbp_enable() - Enable the DPBP. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpbp_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpbp_disable() - Disable the DPBP. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpbp_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpbp_is_enabled() - Check if the DPBP is enabled. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * @en: Returns '1' if object is enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_is_enabled(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); +int dpbp_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); -/** - * dpbp_reset() - Reset the DPBP, returns the object to initial state. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpbp_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpbp_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpbp_attr - Structure representing DPBP attributes @@ -195,44 +103,23 @@ struct dpbp_attr { uint16_t bpid; }; +int dpbp_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpbp_attr *attr); + /** - * dpbp_get_attributes - Retrieve DPBP attributes. - * - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * @attr: Returned object's attributes - * - * Return: '0' on Success; Error code otherwise. + * DPBP notifications options */ -int dpbp_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpbp_attr *attr); /** - * dpbp_get_api_version() - Get buffer pool API version - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @major_ver: Major version of data path buffer pool API - * @minor_ver: Minor version of data path buffer pool API - * - * Return: '0' on Success; Error code otherwise. + * BPSCN write will attempt to allocate into a cache (coherent write) */ int dpbp_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, uint16_t *minor_ver); -/** - * dpbp_get_num_free_bufs() - Get number of free buffers in the buffer pool - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPBP object - * @num_free_bufs: Number of free buffers - * - * Return: '0' on Success; Error code otherwise. - */ int dpbp_get_num_free_bufs(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, diff --git a/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h b/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h index f0ee65a..ce38c79 100644 --- a/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpbp_cmd.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -42,47 +42,90 @@ /* DPBP Version */ #define DPBP_VER_MAJOR 3 -#define DPBP_VER_MINOR 2 +#define DPBP_VER_MINOR 3 + +/* Command versioning */ +#define DPBP_CMD_BASE_VERSION 1 +#define DPBP_CMD_ID_OFFSET 4 + +#define DPBP_CMD(id) ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION) /* Command IDs */ -#define DPBP_CMDID_CLOSE 0x8001 -#define DPBP_CMDID_OPEN 0x8041 -#define DPBP_CMDID_CREATE 0x9041 -#define DPBP_CMDID_DESTROY 0x9841 -#define DPBP_CMDID_GET_API_VERSION 0xa041 - -#define DPBP_CMDID_ENABLE 0x0021 -#define DPBP_CMDID_DISABLE 0x0031 -#define DPBP_CMDID_GET_ATTR 0x0041 -#define DPBP_CMDID_RESET 0x0051 -#define DPBP_CMDID_IS_ENABLED 0x0061 - -#define DPBP_CMDID_GET_FREE_BUFFERS_NUM 0x1b21 - -/* cmd, param, offset, width, type, arg_name */ -#define DPBP_CMD_OPEN(cmd, dpbp_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpbp_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPBP_RSP_IS_ENABLED(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPBP_RSP_GET_ATTRIBUTES(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, (attr)->bpid); \ - MC_RSP_OP(cmd, 0, 32, 32, int, (attr)->id);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPBP_RSP_GET_API_VERSION(cmd, major, minor) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPBP_RSP_GET_NUM_FREE_BUFS(cmd, num_free_bufs) \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, num_free_bufs) +#define DPBP_CMDID_CLOSE DPBP_CMD(0x800) +#define DPBP_CMDID_OPEN DPBP_CMD(0x804) +#define DPBP_CMDID_CREATE DPBP_CMD(0x904) +#define DPBP_CMDID_DESTROY DPBP_CMD(0x984) +#define DPBP_CMDID_GET_API_VERSION DPBP_CMD(0xa04) + +#define DPBP_CMDID_ENABLE DPBP_CMD(0x002) +#define DPBP_CMDID_DISABLE DPBP_CMD(0x003) +#define DPBP_CMDID_GET_ATTR DPBP_CMD(0x004) +#define DPBP_CMDID_RESET DPBP_CMD(0x005) +#define DPBP_CMDID_IS_ENABLED DPBP_CMD(0x006) + +#define DPBP_CMDID_SET_IRQ_ENABLE DPBP_CMD(0x012) +#define DPBP_CMDID_GET_IRQ_ENABLE DPBP_CMD(0x013) +#define DPBP_CMDID_SET_IRQ_MASK DPBP_CMD(0x014) +#define DPBP_CMDID_GET_IRQ_MASK DPBP_CMD(0x015) +#define DPBP_CMDID_GET_IRQ_STATUS DPBP_CMD(0x016) +#define DPBP_CMDID_CLEAR_IRQ_STATUS DPBP_CMD(0x017) + +#define DPBP_CMDID_SET_NOTIFICATIONS DPBP_CMD(0x1b0) +#define DPBP_CMDID_GET_NOTIFICATIONS DPBP_CMD(0x1b1) + +#define DPBP_CMDID_GET_FREE_BUFFERS_NUM DPBP_CMD(0x1b2) + +#pragma pack(push, 1) +struct dpbp_cmd_open { + uint32_t dpbp_id; +}; + +struct dpbp_cmd_destroy { + uint32_t object_id; +}; + +#define DPBP_ENABLE 0x1 + +struct dpbp_rsp_is_enabled { + uint8_t enabled; +}; + +struct dpbp_rsp_get_attributes { + uint16_t pad; + uint16_t bpid; + uint32_t id; +}; + +struct dpbp_cmd_set_notifications { + uint32_t depletion_entry; + uint32_t depletion_exit; + uint32_t surplus_entry; + uint32_t surplus_exit; + uint16_t options; + uint16_t pad[3]; + uint64_t message_ctx; + uint64_t message_iova; +}; + +struct dpbp_rsp_get_notifications { + uint32_t depletion_entry; + uint32_t depletion_exit; + uint32_t surplus_entry; + uint32_t surplus_exit; + uint16_t options; + uint16_t pad[3]; + uint64_t message_ctx; + uint64_t message_iova; +}; + +struct dpbp_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; + +struct dpbp_rsp_get_num_free_bufs { + uint32_t num_free_bufs; +}; +#pragma pack(pop) #endif /* _FSL_DPBP_CMD_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpci.h b/drivers/bus/fslmc/mc/fsl_dpci.h index 1e155dd..f4aa6e5 100644 --- a/drivers/bus/fslmc/mc/fsl_dpci.h +++ b/drivers/bus/fslmc/mc/fsl_dpci.h @@ -62,42 +62,14 @@ struct fsl_mc_io; */ #define DPCI_ALL_QUEUES (uint8_t)(-1) -/** - * dpci_open() - Open a control session for the specified object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @dpci_id: DPCI unique ID - * @token: Returned token; use in subsequent API calls - * - * This function can be used to open a control session for an - * already created object; an object may have been declared in - * the DPL or by calling the dpci_create() function. - * This function returns a unique authentication token, - * associated with the specific object ID and the specific MC - * portal; this token must be used in all subsequent commands for - * this specific object. - * - * Return: '0' on Success; Error code otherwise. - */ int dpci_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpci_id, - uint16_t *token); + uint32_t cmd_flags, + int dpci_id, + uint16_t *token); -/** - * dpci_close() - Close the control session of the object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * - * After this function is called, no further operations are - * allowed on the object without opening a new control session. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpci_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * Enable the Order Restoration support @@ -124,107 +96,37 @@ struct dpci_cfg { uint8_t num_of_priorities; }; -/** - * dpci_create() - Create the DPCI object. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @cfg: Configuration structure - * @obj_id: returned object id - * - * Create the DPCI object, allocate required resources and perform required - * initialization. - * - * The object can be created either by declaring it in the - * DPL file, or by calling this function. - * - * The function accepts an authentication token of a parent - * container that this object should be assigned to. The token - * can be '0' so the object will be assigned to the default container. - * The newly created object can be opened with the returned - * object id and using the container's associated tokens and MC portals. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpci_cfg *cfg, - uint32_t *obj_id); +int dpci_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpci_cfg *cfg, + uint32_t *obj_id); -/** - * dpci_destroy() - Destroy the DPCI object and release all its resources. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @object_id: The object id; it must be a valid id within the container that - * created this object; - * - * The function accepts the authentication token of the parent container that - * created the object (not the one that currently owns the object). The object - * is searched within parent using the provided 'object_id'. - * All tokens to the object must be closed before calling destroy. - * - * Return: '0' on Success; error code otherwise. - */ -int dpci_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id); +int dpci_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id); -/** - * dpci_enable() - Enable the DPCI, allow sending and receiving frames. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpci_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpci_disable() - Disable the DPCI, stop sending and receiving frames. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpci_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpci_is_enabled() - Check if the DPCI is enabled. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * @en: Returns '1' if object is enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_is_enabled(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); +int dpci_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); -/** - * dpci_reset() - Reset the DPCI, returns the object to initial state. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * - * Return: '0' on Success; Error code otherwise. - */ int dpci_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); + uint32_t cmd_flags, + uint16_t token); /** * struct dpci_attr - Structure representing DPCI attributes - * @id: DPCI object ID + * @id: DPCI object ID * @num_of_priorities: Number of receive priorities */ struct dpci_attr { @@ -232,19 +134,10 @@ struct dpci_attr { uint8_t num_of_priorities; }; -/** - * dpci_get_attributes() - Retrieve DPCI attributes. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * @attr: Returned object's attributes - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpci_attr *attr); +int dpci_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpci_attr *attr); /** * enum dpci_dest - DPCI destination types @@ -310,24 +203,11 @@ struct dpci_rx_queue_cfg { struct dpci_dest_cfg dest_cfg; }; -/** - * dpci_set_rx_queue() - Set Rx queue configuration - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * @priority: Select the queue relative to number of - * priorities configured at DPCI creation; use - * DPCI_ALL_QUEUES to configure all Rx queues - * identically. - * @cfg: Rx queue configuration - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_set_rx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t priority, - const struct dpci_rx_queue_cfg *cfg); +int dpci_set_rx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t priority, + const struct dpci_rx_queue_cfg *cfg); /** * struct dpci_rx_queue_attr - Structure representing Rx queue attributes @@ -337,26 +217,15 @@ int dpci_set_rx_queue(struct fsl_mc_io *mc_io, * @fqid: Virtual FQID value to be used for dequeue operations */ struct dpci_rx_queue_attr { - uint64_t user_ctx; - struct dpci_dest_cfg dest_cfg; - uint32_t fqid; + uint64_t user_ctx; + struct dpci_dest_cfg dest_cfg; + uint32_t fqid; }; -/** - * dpci_get_rx_queue() - Retrieve Rx queue attributes. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * @priority: Select the queue relative to number of - * priorities configured at DPCI creation - * @attr: Returned Rx queue attributes - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_get_rx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t priority, +int dpci_get_rx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t priority, struct dpci_rx_queue_attr *attr); /** @@ -370,35 +239,15 @@ struct dpci_tx_queue_attr { uint32_t fqid; }; -/** - * dpci_get_tx_queue() - Retrieve Tx queue attributes. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCI object - * @priority: Select the queue relative to number of - * priorities of the peer DPCI object - * @attr: Returned Tx queue attributes - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_get_tx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t priority, - struct dpci_tx_queue_attr *attr); +int dpci_get_tx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t priority, + struct dpci_tx_queue_attr *attr); -/** - * dpci_get_api_version() - Get communication interface API version - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @major_ver: Major version of data path communication interface API - * @minor_ver: Minor version of data path communication interface API - * - * Return: '0' on Success; Error code otherwise. - */ -int dpci_get_api_version(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver); +int dpci_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver); #endif /* __FSL_DPCI_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpci_cmd.h b/drivers/bus/fslmc/mc/fsl_dpci_cmd.h index 6d4e273..73a551a 100644 --- a/drivers/bus/fslmc/mc/fsl_dpci_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpci_cmd.h @@ -40,108 +40,126 @@ #define _FSL_DPCI_CMD_H /* DPCI Version */ -#define DPCI_VER_MAJOR 3 -#define DPCI_VER_MINOR 3 +#define DPCI_VER_MAJOR 3 +#define DPCI_VER_MINOR 3 -/* Command IDs */ -#define DPCI_CMDID_CLOSE 0x8001 -#define DPCI_CMDID_OPEN 0x8071 -#define DPCI_CMDID_CREATE 0x9072 -#define DPCI_CMDID_DESTROY 0x9871 -#define DPCI_CMDID_GET_API_VERSION 0xa071 - -#define DPCI_CMDID_ENABLE 0x0021 -#define DPCI_CMDID_DISABLE 0x0031 -#define DPCI_CMDID_GET_ATTR 0x0041 -#define DPCI_CMDID_RESET 0x0051 -#define DPCI_CMDID_IS_ENABLED 0x0061 - -#define DPCI_CMDID_SET_IRQ_ENABLE 0x0121 -#define DPCI_CMDID_GET_IRQ_ENABLE 0x0131 -#define DPCI_CMDID_SET_IRQ_MASK 0x0141 -#define DPCI_CMDID_GET_IRQ_MASK 0x0151 -#define DPCI_CMDID_GET_IRQ_STATUS 0x0161 -#define DPCI_CMDID_CLEAR_IRQ_STATUS 0x0171 - -#define DPCI_CMDID_SET_RX_QUEUE 0x0e01 -#define DPCI_CMDID_GET_LINK_STATE 0x0e11 -#define DPCI_CMDID_GET_PEER_ATTR 0x0e21 -#define DPCI_CMDID_GET_RX_QUEUE 0x0e31 -#define DPCI_CMDID_GET_TX_QUEUE 0x0e41 -#define DPCI_CMDID_SET_OPR 0x0e51 -#define DPCI_CMDID_GET_OPR 0x0e61 - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_CMD_OPEN(cmd, dpci_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpci_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_CMD_CREATE(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->num_of_priorities);\ - MC_CMD_OP(cmd, 2, 0, 32, uint32_t, cfg->options);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_IS_ENABLED(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_GET_ATTRIBUTES(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, (attr)->id);\ - MC_RSP_OP(cmd, 0, 48, 8, uint8_t, (attr)->num_of_priorities);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_GET_PEER_ATTR(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, attr->peer_id);\ - MC_RSP_OP(cmd, 1, 0, 8, uint8_t, attr->num_of_priorities);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_GET_LINK_STATE(cmd, up) \ - MC_RSP_OP(cmd, 0, 0, 1, int, up) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_CMD_SET_RX_QUEUE(cmd, priority, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dest_cfg.dest_id);\ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->dest_cfg.priority);\ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, priority);\ - MC_CMD_OP(cmd, 0, 48, 4, enum dpci_dest, cfg->dest_cfg.dest_type);\ - MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx);\ - MC_CMD_OP(cmd, 2, 0, 32, uint32_t, cfg->options);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_CMD_GET_RX_QUEUE(cmd, priority) \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, priority) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_GET_RX_QUEUE(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, attr->dest_cfg.dest_id);\ - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->dest_cfg.priority);\ - MC_RSP_OP(cmd, 0, 48, 4, enum dpci_dest, attr->dest_cfg.dest_type);\ - MC_RSP_OP(cmd, 1, 0, 8, uint64_t, attr->user_ctx);\ - MC_RSP_OP(cmd, 2, 0, 32, uint32_t, attr->fqid);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_CMD_GET_TX_QUEUE(cmd, priority) \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, priority) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_GET_TX_QUEUE(cmd, attr) \ - MC_RSP_OP(cmd, 0, 32, 32, uint32_t, attr->fqid) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCI_RSP_GET_API_VERSION(cmd, major, minor) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ -} while (0) +#define DPCI_CMD_BASE_VERSION 1 +#define DPCI_CMD_BASE_VERSION_V2 2 +#define DPCI_CMD_ID_OFFSET 4 + +#define DPCI_CMD_V1(id) ((id << DPCI_CMD_ID_OFFSET) | DPCI_CMD_BASE_VERSION) +#define DPCI_CMD_V2(id) ((id << DPCI_CMD_ID_OFFSET) | DPCI_CMD_BASE_VERSION_V2) +/* Command IDs */ +#define DPCI_CMDID_CLOSE DPCI_CMD_V1(0x800) +#define DPCI_CMDID_OPEN DPCI_CMD_V1(0x807) +#define DPCI_CMDID_CREATE DPCI_CMD_V2(0x907) +#define DPCI_CMDID_DESTROY DPCI_CMD_V1(0x987) +#define DPCI_CMDID_GET_API_VERSION DPCI_CMD_V1(0xa07) + +#define DPCI_CMDID_ENABLE DPCI_CMD_V1(0x002) +#define DPCI_CMDID_DISABLE DPCI_CMD_V1(0x003) +#define DPCI_CMDID_GET_ATTR DPCI_CMD_V1(0x004) +#define DPCI_CMDID_RESET DPCI_CMD_V1(0x005) +#define DPCI_CMDID_IS_ENABLED DPCI_CMD_V1(0x006) + +#define DPCI_CMDID_SET_RX_QUEUE DPCI_CMD_V1(0x0e0) +#define DPCI_CMDID_GET_LINK_STATE DPCI_CMD_V1(0x0e1) +#define DPCI_CMDID_GET_PEER_ATTR DPCI_CMD_V1(0x0e2) +#define DPCI_CMDID_GET_RX_QUEUE DPCI_CMD_V1(0x0e3) +#define DPCI_CMDID_GET_TX_QUEUE DPCI_CMD_V1(0x0e4) + +/* Macros for accessing command fields smaller than 1byte */ +#define DPCI_MASK(field) \ + GENMASK(DPCI_##field##_SHIFT + DPCI_##field##_SIZE - 1, \ + DPCI_##field##_SHIFT) +#define dpci_set_field(var, field, val) \ + ((var) |= (((val) << DPCI_##field##_SHIFT) & DPCI_MASK(field))) +#define dpci_get_field(var, field) \ + (((var) & DPCI_MASK(field)) >> DPCI_##field##_SHIFT) + +#pragma pack(push, 1) +struct dpci_cmd_open { + uint32_t dpci_id; +}; + +struct dpci_cmd_create { + uint8_t num_of_priorities; + uint8_t pad[15]; + uint32_t options; +}; + +struct dpci_cmd_destroy { + uint32_t dpci_id; +}; + +#define DPCI_ENABLE_SHIFT 0 +#define DPCI_ENABLE_SIZE 1 + +struct dpci_rsp_is_enabled { + /* only the LSB bit */ + uint8_t en; +}; + +struct dpci_rsp_get_attr { + uint32_t id; + uint16_t pad; + uint8_t num_of_priorities; +}; + +struct dpci_rsp_get_peer_attr { + uint32_t id; + uint32_t pad; + uint8_t num_of_priorities; +}; + +#define DPCI_UP_SHIFT 0 +#define DPCI_UP_SIZE 1 + +struct dpci_rsp_get_link_state { + /* only the LSB bit */ + uint8_t up; +}; + +#define DPCI_DEST_TYPE_SHIFT 0 +#define DPCI_DEST_TYPE_SIZE 4 + +struct dpci_cmd_set_rx_queue { + uint32_t dest_id; + uint8_t dest_priority; + uint8_t priority; + /* from LSB: dest_type:4 */ + uint8_t dest_type; + uint8_t pad; + uint64_t user_ctx; + uint32_t options; +}; + +struct dpci_cmd_get_queue { + uint8_t pad[5]; + uint8_t priority; +}; + +struct dpci_rsp_get_rx_queue { + uint32_t dest_id; + uint8_t dest_priority; + uint8_t pad; + /* from LSB: dest_type:4 */ + uint8_t dest_type; + uint8_t pad1; + uint64_t user_ctx; + uint32_t fqid; +}; + +struct dpci_rsp_get_tx_queue { + uint32_t pad; + uint32_t fqid; +}; + +struct dpci_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; + +#pragma pack(pop) #endif /* _FSL_DPCI_CMD_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpcon.h b/drivers/bus/fslmc/mc/fsl_dpcon.h index 0ed9db5..1da807f 100644 --- a/drivers/bus/fslmc/mc/fsl_dpcon.h +++ b/drivers/bus/fslmc/mc/fsl_dpcon.h @@ -52,42 +52,14 @@ struct fsl_mc_io; */ #define DPCON_INVALID_DPIO_ID (int)(-1) -/** - * dpcon_open() - Open a control session for the specified object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @dpcon_id: DPCON unique ID - * @token: Returned token; use in subsequent API calls - * - * This function can be used to open a control session for an - * already created object; an object may have been declared in - * the DPL or by calling the dpcon_create() function. - * This function returns a unique authentication token, - * associated with the specific object ID and the specific MC - * portal; this token must be used in all subsequent commands for - * this specific object. - * - * Return: '0' on Success; Error code otherwise. - */ int dpcon_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpcon_id, - uint16_t *token); + uint32_t cmd_flags, + int dpcon_id, + uint16_t *token); -/** - * dpcon_close() - Close the control session of the object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCON object - * - * After this function is called, no further operations are - * allowed on the object without opening a new control session. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpcon_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpcon_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpcon_cfg - Structure representing DPCON configuration @@ -97,109 +69,39 @@ struct dpcon_cfg { uint8_t num_priorities; }; -/** - * dpcon_create() - Create the DPCON object. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @cfg: Configuration structure - * @obj_id: returned object id - * - * Create the DPCON object, allocate required resources and - * perform required initialization. - * - * The object can be created either by declaring it in the - * DPL file, or by calling this function. - * - * The function accepts an authentication token of a parent - * container that this object should be assigned to. The token - * can be '0' so the object will be assigned to the default container. - * The newly created object can be opened with the returned - * object id and using the container's associated tokens and MC portals. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpcon_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpcon_cfg *cfg, - uint32_t *obj_id); +int dpcon_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpcon_cfg *cfg, + uint32_t *obj_id); -/** - * dpcon_destroy() - Destroy the DPCON object and release all its resources. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @object_id: The object id; it must be a valid id within the container that - * created this object; - * - * The function accepts the authentication token of the parent container that - * created the object (not the one that currently owns the object). The object - * is searched within parent using the provided 'object_id'. - * All tokens to the object must be closed before calling destroy. - * - * Return: '0' on Success; error code otherwise. - */ -int dpcon_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id); +int dpcon_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t obj_id); -/** - * dpcon_enable() - Enable the DPCON - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCON object - * - * Return: '0' on Success; Error code otherwise - */ -int dpcon_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpcon_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpcon_disable() - Disable the DPCON - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCON object - * - * Return: '0' on Success; Error code otherwise - */ -int dpcon_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpcon_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpcon_is_enabled() - Check if the DPCON is enabled. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCON object - * @en: Returns '1' if object is enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpcon_is_enabled(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); +int dpcon_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); -/** - * dpcon_reset() - Reset the DPCON, returns the object to initial state. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCON object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpcon_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpcon_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpcon_attr - Structure representing DPCON attributes - * @id: DPCON object ID - * @qbman_ch_id: Channel ID to be used by dequeue operation - * @num_priorities: Number of priorities for the DPCON channel (1-8) + * @id: DPCON object ID + * @qbman_ch_id: Channel ID to be used by dequeue operation + * @num_priorities: Number of priorities for the DPCON channel (1-8) */ struct dpcon_attr { int id; @@ -207,29 +109,11 @@ struct dpcon_attr { uint8_t num_priorities; }; -/** - * dpcon_get_attributes() - Retrieve DPCON attributes. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPCON object - * @attr: Object's attributes - * - * Return: '0' on Success; Error code otherwise. - */ -int dpcon_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpcon_attr *attr); +int dpcon_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpcon_attr *attr); -/** - * dpcon_get_api_version() - Get Data Path Concentrator API version - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @major_ver: Major version of data path concentrator API - * @minor_ver: Minor version of data path concentrator API - * - * Return: '0' on Success; Error code otherwise. - */ int dpcon_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, diff --git a/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h b/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h index f7f7690..4d0522c 100644 --- a/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h @@ -5,6 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -40,136 +41,68 @@ #define _FSL_DPCON_CMD_H /* DPCON Version */ -#define DPCON_VER_MAJOR 3 -#define DPCON_VER_MINOR 2 +#define DPCON_VER_MAJOR 3 +#define DPCON_VER_MINOR 3 -/* Command IDs */ -#define DPCON_CMDID_CLOSE ((0x800 << 4) | (0x1)) -#define DPCON_CMDID_OPEN ((0x808 << 4) | (0x1)) -#define DPCON_CMDID_CREATE ((0x908 << 4) | (0x1)) -#define DPCON_CMDID_DESTROY ((0x988 << 4) | (0x1)) -#define DPCON_CMDID_GET_API_VERSION ((0xa08 << 4) | (0x1)) - -#define DPCON_CMDID_ENABLE ((0x002 << 4) | (0x1)) -#define DPCON_CMDID_DISABLE ((0x003 << 4) | (0x1)) -#define DPCON_CMDID_GET_ATTR ((0x004 << 4) | (0x1)) -#define DPCON_CMDID_RESET ((0x005 << 4) | (0x1)) -#define DPCON_CMDID_IS_ENABLED ((0x006 << 4) | (0x1)) - -#define DPCON_CMDID_SET_IRQ ((0x010 << 4) | (0x1)) -#define DPCON_CMDID_GET_IRQ ((0x011 << 4) | (0x1)) -#define DPCON_CMDID_SET_IRQ_ENABLE ((0x012 << 4) | (0x1)) -#define DPCON_CMDID_GET_IRQ_ENABLE ((0x013 << 4) | (0x1)) -#define DPCON_CMDID_SET_IRQ_MASK ((0x014 << 4) | (0x1)) -#define DPCON_CMDID_GET_IRQ_MASK ((0x015 << 4) | (0x1)) -#define DPCON_CMDID_GET_IRQ_STATUS ((0x016 << 4) | (0x1)) -#define DPCON_CMDID_CLEAR_IRQ_STATUS ((0x017 << 4) | (0x1)) - -#define DPCON_CMDID_SET_NOTIFICATION ((0x100 << 4) | (0x1)) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_OPEN(cmd, dpcon_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpcon_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_CREATE(cmd, cfg) \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->num_priorities) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_IS_ENABLED(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_SET_IRQ(cmd, irq_index, irq_cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, irq_index);\ - MC_CMD_OP(cmd, 0, 32, 32, uint32_t, irq_cfg->val);\ - MC_CMD_OP(cmd, 1, 0, 64, uint64_t, irq_cfg->addr);\ - MC_CMD_OP(cmd, 2, 0, 32, int, irq_cfg->irq_num); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_GET_IRQ(cmd, irq_index) \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_GET_IRQ(cmd, type, irq_cfg) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, irq_cfg->val);\ - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, irq_cfg->addr);\ - MC_RSP_OP(cmd, 2, 0, 32, int, irq_cfg->irq_num); \ - MC_RSP_OP(cmd, 2, 32, 32, int, type);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_SET_IRQ_ENABLE(cmd, irq_index, en) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, en); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_GET_IRQ_ENABLE(cmd, irq_index) \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_GET_IRQ_ENABLE(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 8, uint8_t, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_SET_IRQ_MASK(cmd, irq_index, mask) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, mask); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_GET_IRQ_MASK(cmd, irq_index) \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_GET_IRQ_MASK(cmd, mask) \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mask) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_GET_IRQ_STATUS(cmd, irq_index, status) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status);\ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_GET_IRQ_STATUS(cmd, status) \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, status) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_CLEAR_IRQ_STATUS(cmd, irq_index, status) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_GET_ATTR(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, attr->id);\ - MC_RSP_OP(cmd, 0, 32, 16, uint16_t, attr->qbman_ch_id);\ - MC_RSP_OP(cmd, 0, 48, 8, uint8_t, attr->num_priorities);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_CMD_SET_NOTIFICATION(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dpio_id);\ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->priority);\ - MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPCON_RSP_GET_API_VERSION(cmd, major, minor) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ -} while (0) +/* Command versioning */ +#define DPCON_CMD_BASE_VERSION 1 +#define DPCON_CMD_ID_OFFSET 4 + +#define DPCON_CMD(id) ((id << DPCON_CMD_ID_OFFSET) | DPCON_CMD_BASE_VERSION) + +/* Command IDs */ +#define DPCON_CMDID_CLOSE DPCON_CMD(0x800) +#define DPCON_CMDID_OPEN DPCON_CMD(0x808) +#define DPCON_CMDID_CREATE DPCON_CMD(0x908) +#define DPCON_CMDID_DESTROY DPCON_CMD(0x988) +#define DPCON_CMDID_GET_API_VERSION DPCON_CMD(0xa08) + +#define DPCON_CMDID_ENABLE DPCON_CMD(0x002) +#define DPCON_CMDID_DISABLE DPCON_CMD(0x003) +#define DPCON_CMDID_GET_ATTR DPCON_CMD(0x004) +#define DPCON_CMDID_RESET DPCON_CMD(0x005) +#define DPCON_CMDID_IS_ENABLED DPCON_CMD(0x006) + +#define DPCON_CMDID_SET_NOTIFICATION DPCON_CMD(0x100) + +#pragma pack(push, 1) +struct dpcon_cmd_open { + uint32_t dpcon_id; +}; + +struct dpcon_cmd_create { + uint8_t num_priorities; +}; + +struct dpcon_cmd_destroy { + uint32_t object_id; +}; + +#define DPCON_ENABLE 1 + +struct dpcon_rsp_is_enabled { + uint8_t enabled; +}; + +struct dpcon_rsp_get_attr { + uint32_t id; + uint16_t qbman_ch_id; + uint8_t num_priorities; + uint8_t pad; +}; + +struct dpcon_cmd_set_notification { + uint32_t dpio_id; + uint8_t priority; + uint8_t pad[3]; + uint64_t user_ctx; +}; + +struct dpcon_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; + +#pragma pack(pop) #endif /* _FSL_DPCON_CMD_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpio.h b/drivers/bus/fslmc/mc/fsl_dpio.h index 4448cca..3d96adf 100644 --- a/drivers/bus/fslmc/mc/fsl_dpio.h +++ b/drivers/bus/fslmc/mc/fsl_dpio.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -46,44 +46,19 @@ struct fsl_mc_io; -/** - * dpio_open() - Open a control session for the specified object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @dpio_id: DPIO unique ID - * @token: Returned token; use in subsequent API calls - * - * This function can be used to open a control session for an - * already created object; an object may have been declared in - * the DPL or by calling the dpio_create() function. - * This function returns a unique authentication token, - * associated with the specific object ID and any MC portals - * assigned to the parent container; this token must be used in - * all subsequent commands for this specific object. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpio_id, - uint16_t *token); +int dpio_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpio_id, + uint16_t *token); -/** - * dpio_close() - Close the control session of the object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpio_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * enum dpio_channel_mode - DPIO notification channel mode - * @DPIO_NO_CHANNEL: No support for notification channel - * @DPIO_LOCAL_CHANNEL: Notifications on data availability can be received by a + * @DPIO_NO_CHANNEL: No support for notification channel + * @DPIO_LOCAL_CHANNEL: Notifications on data availability can be received by a * dedicated channel in the DPIO; user should point the queue's * destination in the relevant interface to this DPIO */ @@ -94,216 +69,94 @@ enum dpio_channel_mode { /** * struct dpio_cfg - Structure representing DPIO configuration - * @channel_mode: Notification channel mode - * @num_priorities: Number of priorities for the notification channel (1-8); + * @channel_mode: Notification channel mode + * @num_priorities: Number of priorities for the notification channel (1-8); * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL' */ struct dpio_cfg { - enum dpio_channel_mode channel_mode; - uint8_t num_priorities; + enum dpio_channel_mode channel_mode; + uint8_t num_priorities; }; -/** - * dpio_create() - Create the DPIO object. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @cfg: Configuration structure - * @obj_id: returned object id - * - * Create the DPIO object, allocate required resources and - * perform required initialization. - * - * The object can be created either by declaring it in the - * DPL file, or by calling this function. - * - * The function accepts an authentication token of a parent - * container that this object should be assigned to. The token - * can be '0' so the object will be assigned to the default container. - * The newly created object can be opened with the returned - * object id and using the container's associated tokens and MC portals. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpio_cfg *cfg, - uint32_t *obj_id); -/** - * dpio_destroy() - Destroy the DPIO object and release all its resources. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @object_id: The object id; it must be a valid id within the container that - * created this object; - * - * The function accepts the authentication token of the parent container that - * created the object (not the one that currently owns the object). The object - * is searched within parent using the provided 'object_id'. - * All tokens to the object must be closed before calling destroy. - * - * Return: '0' on Success; Error code otherwise - */ -int dpio_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id); +int dpio_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpio_cfg *cfg, + uint32_t *obj_id); -/** - * dpio_enable() - Enable the DPIO, allow I/O portal operations. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * - * Return: '0' on Success; Error code otherwise - */ -int dpio_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpio_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id); -/** - * dpio_disable() - Disable the DPIO, stop any I/O portal operation. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * - * Return: '0' on Success; Error code otherwise - */ -int dpio_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpio_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpio_is_enabled() - Check if the DPIO is enabled. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * @en: Returns '1' if object is enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_is_enabled(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); +int dpio_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpio_reset() - Reset the DPIO, returns the object to initial state. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpio_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); -/** - * dpio_set_stashing_destination() - Set the stashing destination. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * @sdest: stashing destination value - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_set_stashing_destination(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t sdest); +int dpio_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpio_get_stashing_destination() - Get the stashing destination.. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * @sdest: Returns the stashing destination value - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_get_stashing_destination(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t *sdest); +int dpio_set_stashing_destination(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t sdest); -/** - * dpio_add_static_dequeue_channel() - Add a static dequeue channel. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * @dpcon_id: DPCON object ID - * @channel_index: Returned channel index to be used in qbman API - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int dpcon_id, - uint8_t *channel_index); +int dpio_get_stashing_destination(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t *sdest); -/** - * dpio_remove_static_dequeue_channel() - Remove a static dequeue channel. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * @dpcon_id: DPCON object ID - * - * Return: '0' on Success; Error code otherwise. - */ -int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int dpcon_id); +int dpio_add_static_dequeue_channel(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int dpcon_id, + uint8_t *channel_index); + +int dpio_remove_static_dequeue_channel(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int dpcon_id); /** * struct dpio_attr - Structure representing DPIO attributes - * @id: DPIO object ID - * @qbman_portal_ce_offset: offset of the software portal cache-enabled area - * @qbman_portal_ci_offset: offset of the software portal cache-inhibited area - * @qbman_portal_id: Software portal ID - * @channel_mode: Notification channel mode - * @num_priorities: Number of priorities for the notification channel (1-8); - * relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL' - * @qbman_version: QBMAN version + * @id: DPIO object ID + * @qbman_portal_ce_offset: Offset of the software portal cache-enabled area + * @qbman_portal_ci_offset: Offset of the software portal + * cache-inhibited area + * @qbman_portal_id: Software portal ID + * @channel_mode: Notification channel mode + * @num_priorities: Number of priorities for the notification + * channel (1-8); relevant only if + * 'channel_mode = DPIO_LOCAL_CHANNEL' + * @qbman_version: QBMAN version */ struct dpio_attr { - int id; - uint64_t qbman_portal_ce_offset; - uint64_t qbman_portal_ci_offset; - uint16_t qbman_portal_id; - enum dpio_channel_mode channel_mode; - uint8_t num_priorities; - uint32_t qbman_version; - uint32_t clk; + int id; + uint64_t qbman_portal_ce_offset; + uint64_t qbman_portal_ci_offset; + uint16_t qbman_portal_id; + enum dpio_channel_mode channel_mode; + uint8_t num_priorities; + uint32_t qbman_version; + uint32_t clk; }; -/** - * dpio_get_attributes() - Retrieve DPIO attributes - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPIO object - * @attr: Returned object's attributes - * - * Return: '0' on Success; Error code otherwise - */ -int dpio_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpio_attr *attr); +int dpio_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpio_attr *attr); -/** - * dpio_get_api_version() - Get Data Path I/O API version - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @major_ver: Major version of data path i/o API - * @minor_ver: Minor version of data path i/o API - * - * Return: '0' on Success; Error code otherwise. - */ int dpio_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, diff --git a/drivers/bus/fslmc/mc/fsl_dpio_cmd.h b/drivers/bus/fslmc/mc/fsl_dpio_cmd.h index d757507..3e9e1f6 100644 --- a/drivers/bus/fslmc/mc/fsl_dpio_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpio_cmd.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -41,82 +41,108 @@ #define _FSL_DPIO_CMD_H /* DPIO Version */ -#define DPIO_VER_MAJOR 4 -#define DPIO_VER_MINOR 2 +#define DPIO_VER_MAJOR 4 +#define DPIO_VER_MINOR 2 + +#define DPIO_CMD_BASE_VERSION 1 +#define DPIO_CMD_ID_OFFSET 4 + +#define DPIO_CMD(id) (((id) << DPIO_CMD_ID_OFFSET) | DPIO_CMD_BASE_VERSION) /* Command IDs */ -#define DPIO_CMDID_CLOSE 0x8001 -#define DPIO_CMDID_OPEN 0x8031 -#define DPIO_CMDID_CREATE 0x9031 -#define DPIO_CMDID_DESTROY 0x9831 -#define DPIO_CMDID_GET_API_VERSION 0xa031 - -#define DPIO_CMDID_ENABLE 0x0021 -#define DPIO_CMDID_DISABLE 0x0031 -#define DPIO_CMDID_GET_ATTR 0x0041 -#define DPIO_CMDID_RESET 0x0051 -#define DPIO_CMDID_IS_ENABLED 0x0061 - -#define DPIO_CMDID_SET_STASHING_DEST 0x1201 -#define DPIO_CMDID_GET_STASHING_DEST 0x1211 -#define DPIO_CMDID_ADD_STATIC_DEQUEUE_CHANNEL 0x1221 -#define DPIO_CMDID_REMOVE_STATIC_DEQUEUE_CHANNEL 0x1231 - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_CMD_OPEN(cmd, dpio_id) \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, dpio_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_CMD_CREATE(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 16, 2, enum dpio_channel_mode, \ - cfg->channel_mode);\ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->num_priorities);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_RSP_IS_ENABLED(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_RSP_GET_ATTRIBUTES(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, (attr)->id);\ - MC_RSP_OP(cmd, 0, 32, 16, uint16_t, (attr)->qbman_portal_id);\ - MC_RSP_OP(cmd, 0, 48, 8, uint8_t, (attr)->num_priorities);\ - MC_RSP_OP(cmd, 0, 56, 4, enum dpio_channel_mode,\ - (attr)->channel_mode);\ - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, (attr)->qbman_portal_ce_offset);\ - MC_RSP_OP(cmd, 2, 0, 64, uint64_t, (attr)->qbman_portal_ci_offset);\ - MC_RSP_OP(cmd, 3, 0, 32, uint32_t, (attr)->qbman_version);\ - MC_RSP_OP(cmd, 4, 0, 32, uint32_t, (attr)->clk);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_CMD_SET_STASHING_DEST(cmd, sdest) \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, sdest) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_RSP_GET_STASHING_DEST(cmd, sdest) \ - MC_RSP_OP(cmd, 0, 0, 8, uint8_t, sdest) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_CMD_ADD_STATIC_DEQUEUE_CHANNEL(cmd, dpcon_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpcon_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_RSP_ADD_STATIC_DEQUEUE_CHANNEL(cmd, channel_index) \ - MC_RSP_OP(cmd, 0, 0, 8, uint8_t, channel_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_CMD_REMOVE_STATIC_DEQUEUE_CHANNEL(cmd, dpcon_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpcon_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPIO_RSP_GET_API_VERSION(cmd, major, minor) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ -} while (0) +#define DPIO_CMDID_CLOSE DPIO_CMD(0x800) +#define DPIO_CMDID_OPEN DPIO_CMD(0x803) +#define DPIO_CMDID_CREATE DPIO_CMD(0x903) +#define DPIO_CMDID_DESTROY DPIO_CMD(0x983) +#define DPIO_CMDID_GET_API_VERSION DPIO_CMD(0xa03) + +#define DPIO_CMDID_ENABLE DPIO_CMD(0x002) +#define DPIO_CMDID_DISABLE DPIO_CMD(0x003) +#define DPIO_CMDID_GET_ATTR DPIO_CMD(0x004) +#define DPIO_CMDID_RESET DPIO_CMD(0x005) +#define DPIO_CMDID_IS_ENABLED DPIO_CMD(0x006) + +#define DPIO_CMDID_SET_IRQ_ENABLE DPIO_CMD(0x012) +#define DPIO_CMDID_GET_IRQ_ENABLE DPIO_CMD(0x013) +#define DPIO_CMDID_SET_IRQ_MASK DPIO_CMD(0x014) +#define DPIO_CMDID_GET_IRQ_MASK DPIO_CMD(0x015) +#define DPIO_CMDID_GET_IRQ_STATUS DPIO_CMD(0x016) +#define DPIO_CMDID_CLEAR_IRQ_STATUS DPIO_CMD(0x017) + +#define DPIO_CMDID_SET_STASHING_DEST DPIO_CMD(0x120) +#define DPIO_CMDID_GET_STASHING_DEST DPIO_CMD(0x121) +#define DPIO_CMDID_ADD_STATIC_DEQUEUE_CHANNEL DPIO_CMD(0x122) +#define DPIO_CMDID_REMOVE_STATIC_DEQUEUE_CHANNEL DPIO_CMD(0x123) + +/* Macros for accessing command fields smaller than 1byte */ +#define DPIO_MASK(field) \ + GENMASK(DPIO_##field##_SHIFT + DPIO_##field##_SIZE - 1, \ + DPIO_##field##_SHIFT) +#define dpio_set_field(var, field, val) \ + ((var) |= (((val) << DPIO_##field##_SHIFT) & DPIO_MASK(field))) +#define dpio_get_field(var, field) \ + (((var) & DPIO_MASK(field)) >> DPIO_##field##_SHIFT) + +#pragma pack(push, 1) +struct dpio_cmd_open { + uint32_t dpio_id; +}; + +#define DPIO_CHANNEL_MODE_SHIFT 0 +#define DPIO_CHANNEL_MODE_SIZE 2 + +struct dpio_cmd_create { + uint16_t pad1; + /* from LSB: channel_mode:2 */ + uint8_t channel_mode; + uint8_t pad2; + uint8_t num_priorities; +}; + +struct dpio_cmd_destroy { + uint32_t dpio_id; +}; + +#define DPIO_ENABLE_SHIFT 0 +#define DPIO_ENABLE_SIZE 1 + +struct dpio_rsp_is_enabled { + /* only the LSB */ + uint8_t en; +}; + +#define DPIO_ATTR_CHANNEL_MODE_SHIFT 0 +#define DPIO_ATTR_CHANNEL_MODE_SIZE 4 + +struct dpio_rsp_get_attr { + uint32_t id; + uint16_t qbman_portal_id; + uint8_t num_priorities; + /* from LSB: channel_mode:4 */ + uint8_t channel_mode; + uint64_t qbman_portal_ce_offset; + uint64_t qbman_portal_ci_offset; + uint32_t qbman_version; + uint32_t pad; + uint32_t clk; +}; + +struct dpio_stashing_dest { + uint8_t sdest; +}; + +struct dpio_cmd_static_dequeue_channel { + uint32_t dpcon_id; +}; + +struct dpio_rsp_add_static_dequeue_channel { + uint8_t channel_index; +}; + +struct dpio_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; +#pragma pack(pop) #endif /* _FSL_DPIO_CMD_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpmng.h b/drivers/bus/fslmc/mc/fsl_dpmng.h index c2ddde0..97030e4 100644 --- a/drivers/bus/fslmc/mc/fsl_dpmng.h +++ b/drivers/bus/fslmc/mc/fsl_dpmng.h @@ -5,6 +5,7 @@ * BSD LICENSE * * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -39,7 +40,8 @@ #ifndef __FSL_DPMNG_H #define __FSL_DPMNG_H -/* Management Complex General API +/* + * Management Complex General API * Contains general API for the Management Complex firmware */ @@ -49,10 +51,10 @@ struct fsl_mc_io; * Management Complex firmware version information */ #define MC_VER_MAJOR 10 -#define MC_VER_MINOR 1 +#define MC_VER_MINOR 3 /** - * struct mc_versoin + * struct mc_version * @major: Major version number: incremented on API compatibility changes * @minor: Minor version number: incremented on API additions (that are * backward compatible); reset when major version is incremented @@ -65,42 +67,21 @@ struct mc_version { uint32_t revision; }; +int mc_get_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + struct mc_version *mc_ver_info); + /** * struct mc_platform - * @svr: system version (content of platform SVR register) - * @pvr: processor version (content of platform PVR register) + * @svr: System version (content of platform SVR register) + * @pvr: Processor version (content of platform PVR register) */ struct mc_soc_version { uint32_t svr; uint32_t pvr; }; -/** - * mc_get_version() - Retrieves the Management Complex firmware - * version information - * @mc_io: Pointer to opaque I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @mc_ver_info: Returned version information structure - * - * Return: '0' on Success; Error code otherwise. - */ -int mc_get_version(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - struct mc_version *mc_ver_info); - -/** - * mc_get_soc_version() - Retrieves the Management Complex firmware - * version information - * @mc_io: Pointer to opaque I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @mc_platform_info: Returned version information structure. The structure - * contains the values of SVR and PVR registers. Please consult platform - * specific reference manual for detailed information. - * - * Return: '0' on Success; Error code otherwise. - */ int mc_get_soc_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, struct mc_soc_version *mc_platform_info); - #endif /* __FSL_DPMNG_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h b/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h index 3a36b6d..4c0a629 100644 --- a/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h @@ -5,6 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. + * Copyright 2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -36,26 +37,32 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + #ifndef __FSL_DPMNG_CMD_H #define __FSL_DPMNG_CMD_H +/* Command versioning */ +#define DPMNG_CMD_BASE_VERSION 1 +#define DPMNG_CMD_ID_OFFSET 4 + +#define DPMNG_CMD(id) ((id << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION) + /* Command IDs */ -#define DPMNG_CMDID_GET_VERSION 0x8311 -#define DPMNG_CMDID_GET_SOC_VERSION 0x8321 - -/* cmd, param, offset, width, type, arg_name */ -#define DPMNG_RSP_GET_VERSION(cmd, mc_ver_info) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mc_ver_info->revision); \ - MC_RSP_OP(cmd, 0, 32, 32, uint32_t, mc_ver_info->major); \ - MC_RSP_OP(cmd, 1, 0, 32, uint32_t, mc_ver_info->minor); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPMNG_RSP_GET_SOC_VERSION(cmd, mc_soc_version) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mc_soc_version->svr); \ - MC_RSP_OP(cmd, 0, 32, 32, uint32_t, mc_soc_version->pvr); \ -} while (0) +#define DPMNG_CMDID_GET_VERSION DPMNG_CMD(0x831) +#define DPMNG_CMDID_GET_SOC_VERSION DPMNG_CMD(0x832) + +#pragma pack(push, 1) +struct dpmng_rsp_get_version { + uint32_t revision; + uint32_t version_major; + uint32_t version_minor; +}; + +struct dpmng_rsp_get_soc_version { + uint32_t svr; + uint32_t pvr; +}; + +#pragma pack(pop) #endif /* __FSL_DPMNG_CMD_H */ diff --git a/drivers/bus/fslmc/mc/fsl_mc_cmd.h b/drivers/bus/fslmc/mc/fsl_mc_cmd.h index 0ca4345..2cec29e 100644 --- a/drivers/bus/fslmc/mc/fsl_mc_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_mc_cmd.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -40,146 +40,118 @@ #ifndef __FSL_MC_CMD_H #define __FSL_MC_CMD_H -#define MC_CMD_NUM_OF_PARAMS 7 - -#define MAKE_UMASK64(_width) \ - ((uint64_t)((_width) < 64 ? ((uint64_t)1 << (_width)) - 1 : \ - (uint64_t)-1)) +#include +#include -static inline uint64_t mc_enc(int lsoffset, int width, uint64_t val) -{ - return (uint64_t)(((uint64_t)val & MAKE_UMASK64(width)) << lsoffset); -} +#define MC_CMD_NUM_OF_PARAMS 7 -static inline uint64_t mc_dec(uint64_t val, int lsoffset, int width) -{ - return (uint64_t)((val >> lsoffset) & MAKE_UMASK64(width)); -} +#define phys_addr_t uint64_t + +#define u64 uint64_t +#define u32 uint32_t +#define u16 uint16_t +#define u8 uint8_t + +#define cpu_to_le64 rte_cpu_to_le_64 +#define cpu_to_le32 rte_cpu_to_le_32 +#define cpu_to_le16 rte_cpu_to_le_16 + +#define le64_to_cpu rte_le_to_cpu_64 +#define le32_to_cpu rte_le_to_cpu_32 +#define le16_to_cpu rte_le_to_cpu_16 + +#define BITS_PER_LONG 64 +#define GENMASK(h, l) \ + (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) + +struct mc_cmd_header { + union { + struct { + uint8_t src_id; + uint8_t flags_hw; + uint8_t status; + uint8_t flags_sw; + uint16_t token; + uint16_t cmd_id; + }; + uint32_t word[2]; + }; +}; struct mc_command { uint64_t header; uint64_t params[MC_CMD_NUM_OF_PARAMS]; }; -/** - * enum mc_cmd_status - indicates MC status at command response - * @MC_CMD_STATUS_OK: Completed successfully - * @MC_CMD_STATUS_READY: Ready to be processed - * @MC_CMD_STATUS_AUTH_ERR: Authentication error - * @MC_CMD_STATUS_NO_PRIVILEGE: No privilege - * @MC_CMD_STATUS_DMA_ERR: DMA or I/O error - * @MC_CMD_STATUS_CONFIG_ERR: Configuration error - * @MC_CMD_STATUS_TIMEOUT: Operation timed out - * @MC_CMD_STATUS_NO_RESOURCE: No resources - * @MC_CMD_STATUS_NO_MEMORY: No memory available - * @MC_CMD_STATUS_BUSY: Device is busy - * @MC_CMD_STATUS_UNSUPPORTED_OP: Unsupported operation - * @MC_CMD_STATUS_INVALID_STATE: Invalid state - */ -enum mc_cmd_status { - MC_CMD_STATUS_OK = 0x0, - MC_CMD_STATUS_READY = 0x1, - MC_CMD_STATUS_AUTH_ERR = 0x3, - MC_CMD_STATUS_NO_PRIVILEGE = 0x4, - MC_CMD_STATUS_DMA_ERR = 0x5, - MC_CMD_STATUS_CONFIG_ERR = 0x6, - MC_CMD_STATUS_TIMEOUT = 0x7, - MC_CMD_STATUS_NO_RESOURCE = 0x8, - MC_CMD_STATUS_NO_MEMORY = 0x9, - MC_CMD_STATUS_BUSY = 0xA, - MC_CMD_STATUS_UNSUPPORTED_OP = 0xB, - MC_CMD_STATUS_INVALID_STATE = 0xC +struct mc_rsp_create { + uint32_t object_id; }; -/* MC command flags */ +enum mc_cmd_status { + MC_CMD_STATUS_OK = 0x0, /* Completed successfully */ + MC_CMD_STATUS_READY = 0x1, /* Ready to be processed */ + MC_CMD_STATUS_AUTH_ERR = 0x3, /* Authentication error */ + MC_CMD_STATUS_NO_PRIVILEGE = 0x4, /* No privilege */ + MC_CMD_STATUS_DMA_ERR = 0x5, /* DMA or I/O error */ + MC_CMD_STATUS_CONFIG_ERR = 0x6, /* Configuration error */ + MC_CMD_STATUS_TIMEOUT = 0x7, /* Operation timed out */ + MC_CMD_STATUS_NO_RESOURCE = 0x8, /* No resources */ + MC_CMD_STATUS_NO_MEMORY = 0x9, /* No memory available */ + MC_CMD_STATUS_BUSY = 0xA, /* Device is busy */ + MC_CMD_STATUS_UNSUPPORTED_OP = 0xB, /* Unsupported operation */ + MC_CMD_STATUS_INVALID_STATE = 0xC /* Invalid state */ +}; -/** - * High priority flag - */ -#define MC_CMD_FLAG_PRI 0x00008000 -/** - * Command completion flag +/* + * MC command flags */ -#define MC_CMD_FLAG_INTR_DIS 0x01000000 -/** - * Command ID field offset - */ -#define MC_CMD_HDR_CMDID_O 48 -/** - * Command ID field size - */ -#define MC_CMD_HDR_CMDID_S 16 -/** - * Token field offset - */ -#define MC_CMD_HDR_TOKEN_O 32 -/** - * Token field size - */ -#define MC_CMD_HDR_TOKEN_S 16 -/** - * Status field offset - */ -#define MC_CMD_HDR_STATUS_O 16 -/** - * Status field size - */ -#define MC_CMD_HDR_STATUS_S 8 -/** - * Flags field offset - */ -#define MC_CMD_HDR_FLAGS_O 0 -/** - * Flags field size - */ -#define MC_CMD_HDR_FLAGS_S 32 -/** - * Command flags mask - */ +/* High priority flag */ +#define MC_CMD_FLAG_PRI 0x80 +/* Command completion flag */ +#define MC_CMD_FLAG_INTR_DIS 0x01 + #define MC_CMD_HDR_FLAGS_MASK 0xFF00FF00 -#define MC_CMD_HDR_READ_STATUS(_hdr) \ - ((enum mc_cmd_status)mc_dec((_hdr), \ - MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S)) +int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd); -#define MC_CMD_HDR_READ_TOKEN(_hdr) \ - ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S)) +static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id, + uint32_t cmd_flags, + uint16_t token) +{ + uint64_t header = 0; + struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header; -#define MC_PREP_OP(_ext, _param, _offset, _width, _type, _arg) \ - ((_ext)[_param] |= cpu_to_le64(mc_enc((_offset), (_width), _arg))) + hdr->cmd_id = cpu_to_le16(cmd_id); + hdr->token = cpu_to_le16(token); + hdr->status = MC_CMD_STATUS_READY; + hdr->word[0] |= cpu_to_le32(cmd_flags & MC_CMD_HDR_FLAGS_MASK); -#define MC_EXT_OP(_ext, _param, _offset, _width, _type, _arg) \ - (_arg = (_type)mc_dec(cpu_to_le64(_ext[_param]), (_offset), (_width))) + return header; +} -#define MC_CMD_OP(_cmd, _param, _offset, _width, _type, _arg) \ - ((_cmd).params[_param] |= mc_enc((_offset), (_width), _arg)) +static inline uint16_t mc_cmd_hdr_read_token(struct mc_command *cmd) +{ + struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header; + uint16_t token = le16_to_cpu(hdr->token); -#define MC_RSP_OP(_cmd, _param, _offset, _width, _type, _arg) \ - (_arg = (_type)mc_dec(_cmd.params[_param], (_offset), (_width))) + return token; +} -/* cmd, param, offset, width, type, arg_name */ -#define CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, object_id) \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, object_id) +static inline uint32_t mc_cmd_read_object_id(struct mc_command *cmd) +{ + struct mc_rsp_create *rsp_params; -/* cmd, param, offset, width, type, arg_name */ -#define CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id) \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, object_id) + rsp_params = (struct mc_rsp_create *)cmd->params; + return le32_to_cpu(rsp_params->object_id); +} -static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id, - uint32_t cmd_flags, - uint16_t token) +static inline enum mc_cmd_status mc_cmd_read_status(struct mc_command *cmd) { - uint64_t hdr; - - hdr = mc_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id); - hdr |= mc_enc(MC_CMD_HDR_FLAGS_O, MC_CMD_HDR_FLAGS_S, - (cmd_flags & MC_CMD_HDR_FLAGS_MASK)); - hdr |= mc_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token); - hdr |= mc_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S, - MC_CMD_STATUS_READY); + struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header; + uint8_t status = hdr->status; - return hdr; + return (enum mc_cmd_status)status; } /** @@ -191,20 +163,17 @@ static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id, static inline void mc_write_command(struct mc_command __iomem *portal, struct mc_command *cmd) { - int i; - uint32_t word; + struct mc_cmd_header *cmd_header = (struct mc_cmd_header *)&cmd->header; char *header = (char *)&portal->header; + int i; /* copy command parameters into the portal */ for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++) iowrite64(cmd->params[i], &portal->params[i]); /* submit the command by writing the header */ - word = (uint32_t)mc_dec(cmd->header, 32, 32); - iowrite32(word, (((uint32_t *)header) + 1)); - - word = (uint32_t)mc_dec(cmd->header, 0, 32); - iowrite32(word, (uint32_t *)header); + iowrite32(le32_to_cpu(cmd_header->word[1]), (((uint32_t *)header) + 1)); + iowrite32(le32_to_cpu(cmd_header->word[0]), (uint32_t *)header); } /** @@ -225,7 +194,7 @@ static inline enum mc_cmd_status mc_read_response( /* Copy command response header from MC portal: */ resp->header = ioread64(&portal->header); - status = MC_CMD_HDR_READ_STATUS(resp->header); + status = mc_cmd_read_status(resp); if (status != MC_CMD_STATUS_OK) return status; diff --git a/drivers/bus/fslmc/mc/fsl_mc_sys.h b/drivers/bus/fslmc/mc/fsl_mc_sys.h index ebada60..d803205 100644 --- a/drivers/bus/fslmc/mc/fsl_mc_sys.h +++ b/drivers/bus/fslmc/mc/fsl_mc_sys.h @@ -5,6 +5,7 @@ * BSD LICENSE * * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -65,40 +66,31 @@ struct fsl_mc_io { #include #include -#define cpu_to_le64(x) __cpu_to_le64(x) #ifndef dmb #define dmb() {__asm__ __volatile__("" : : : "memory"); } #endif -#define __iormb() dmb() -#define __iowmb() dmb() -#define __arch_getq(a) (*(volatile unsigned long *)(a)) -#define __arch_putq(v, a) (*(volatile unsigned long *)(a) = (v)) -#define __arch_putq32(v, a) (*(volatile unsigned int *)(a) = (v)) -#define readq(c) \ +#define __iormb() dmb() +#define __iowmb() dmb() +#define __arch_getq(a) (*(volatile uint64_t *)(a)) +#define __arch_putq(v, a) (*(volatile uint64_t *)(a) = (v)) +#define __arch_putq32(v, a) (*(volatile uint32_t *)(a) = (v)) +#define readq(c) \ ({ uint64_t __v = __arch_getq(c); __iormb(); __v; }) -#define writeq(v, c) \ +#define writeq(v, c) \ ({ uint64_t __v = v; __iowmb(); __arch_putq(__v, c); __v; }) #define writeq32(v, c) \ ({ uint32_t __v = v; __iowmb(); __arch_putq32(__v, c); __v; }) -#define ioread64(_p) readq(_p) -#define iowrite64(_v, _p) writeq(_v, _p) -#define iowrite32(_v, _p) writeq32(_v, _p) +#define ioread64(_p) readq(_p) +#define iowrite64(_v, _p) writeq(_v, _p) +#define iowrite32(_v, _p) writeq32(_v, _p) #define __iomem -struct fsl_mc_io { - void *regs; -}; - -#ifndef ENOTSUP -#define ENOTSUP 95 -#endif - /*GPP is supposed to use MC commands with low priority*/ #define CMD_PRI_LOW 0 /*!< Low Priority command indication */ -struct mc_command; - -int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd); +struct fsl_mc_io { + void *regs; +}; #endif /* __linux_driver__ */ diff --git a/drivers/bus/fslmc/mc/mc_sys.c b/drivers/bus/fslmc/mc/mc_sys.c index 4573165..f0f9a26 100644 --- a/drivers/bus/fslmc/mc/mc_sys.c +++ b/drivers/bus/fslmc/mc/mc_sys.c @@ -5,6 +5,7 @@ * BSD LICENSE * * Copyright 2013-2015 Freescale Semiconductor Inc. + * Copyright 2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -86,6 +87,7 @@ static int mc_status_to_error(enum mc_cmd_status status) int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd) { enum mc_cmd_status status; + uint64_t response; if (!mc_io || !mc_io->regs) return -EACCES; @@ -97,7 +99,8 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd) /* Spin until status changes */ do { - status = MC_CMD_HDR_READ_STATUS(ioread64(mc_io->regs)); + response = ioread64(mc_io->regs); + status = mc_cmd_read_status((struct mc_command *)&response); /* --- Call wait function here to prevent blocking --- * Change the loop condition accordingly to exit on timeout. From patchwork Fri Sep 8 08:45:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112033 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1245048ybm; Fri, 8 Sep 2017 01:48:29 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4y3fRrb7od7G4Lx5ysAP/vn6dYHLqxjAFdSKlJqTHXUObz5BFqgWKLJA5kxjCwRA8meCoQ X-Received: by 10.223.169.247 with SMTP id b110mr1423157wrd.31.1504860509692; Fri, 08 Sep 2017 01:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860509; cv=none; d=google.com; s=arc-20160816; b=AhWVuL0xX/5g10jP/IDA+nzw2STW6e3ipZrJdCip3nVW2RzjB6Lqw0tu1Qmdg/LmZD abD42rJQXMTPU0ph8+HnVz1n0DcuvDJI3CPcaPOIj8vPpm/Cj978MSTI1E7Sj1inG1lp ueLe+LBUx77pR0cf9wmqtE3xHK8wZNTMUmSzhlGO/yOBNLRz7wDDbejS65dbLF54HrTn M/I8L+I/PI10vvWXOti6sg8KDfUx4OwWbXmWMdNYlokgAcLmomvZ7C9PVcJkKrBjFrYg He25jlVYUQ9ZQf8TsbaVVqkO6eDNTbKZDzEO0p9ALlBj2pDbmzewmyMhsumhZPtVAsNw 0VCQ== 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=TrKGecUaZPIO2mrfFucXof7rtK9Q0wU59LO9FuJ+rJQ=; b=B9Dz8VSM/dEJ4PQUzYzY3kQGD5UYlXuidNjuA128HU2ZTtqQ9SgsTjirnEnujMRWSa tiUSRKpS2r7YpSHcq3H23+HnvqDgIo5ERjeHRGX3wwbmi4DJb1Jz0vNp7mlT8HC05ZUu WyMGpoTJ+RZ9FEXJ5quz2HBwdiOnDzQBGTpUcBEA/bjRzs72KFWpnAQmZYvV2drwDfG3 Ck6gDXryzlvNvh0xsAAgmR3F7VQlBQFnLLncPMMnIpKpLoySNmT8bbsPfqFh6OU42rzZ xf+rtud3Di3EwE8Jx610ImdqDUN7keJ+T8Qh5gnhHO/Bv7iZ8nTLbqDpvZIFuWJSr/1D ip0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id m126si994973wma.160.2017.09.08.01.48.29; Fri, 08 Sep 2017 01:48:29 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 9A2B7199FC; Fri, 8 Sep 2017 10:46:18 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0057.outbound.protection.outlook.com [104.47.38.57]) by dpdk.org (Postfix) with ESMTP id 075E6199C4 for ; Fri, 8 Sep 2017 10:46:14 +0200 (CEST) Received: from BN3PR03CA0084.namprd03.prod.outlook.com (10.167.1.172) 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:11 +0000 Received: from BN1AFFO11FD014.protection.gbl (2a01:111:f400:7c10::129) by BN3PR03CA0084.outlook.office365.com (2a01:111:e400:7a4d::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Fri, 8 Sep 2017 08:46:10 +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 BN1AFFO11FD014.mail.protection.outlook.com (10.58.52.74) 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:10 +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 v888jmog023063; Fri, 8 Sep 2017 01:46:08 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:07 +0530 Message-ID: <1504860327-18451-11-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: 131493339705824537; (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)(51234002)(199003)(189002)(97736004)(5890100001)(106466001)(2351001)(356003)(33646002)(85426001)(2906002)(68736007)(86362001)(50226002)(81166006)(81156014)(8676002)(8936002)(15650500001)(104016004)(5003940100001)(47776003)(8656003)(110136004)(16200700003)(2950100002)(53946003)(48376002)(6916009)(5660300001)(50986999)(50466002)(305945005)(105606002)(76176999)(189998001)(53936002)(4326008)(498600001)(36756003)(54906002)(77096006)(2004002)(569006); 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; BN1AFFO11FD014; 1:4XhmPJKtIxQ6UIn7S+9URqWbXo5XP1e9zw6vOI+uBadIgF3bIrOoEiv+EGZwc8OOGDNy4aau2mOXONgNvvhWGLeSvJ70nBFOlreMBh18s1zdZjEzgK2SYlOguM7fm8ny MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6452ba5-bc2d-43fd-d519-08d4f6960df5 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:13iY/pka9dU53L4HuJ58SGAe1OOg+GYfwtohGHDn652UnsIa9GXTFZ5vRoj9TY/0mxlr8/anrIKT0pIkLBvXWkDKZRjCLXdDc/5lzK9Q3Q+8gO3d9tssaJL043rjTzMfgu3QFu6LlZbbua7ncVPa0qC3BkjXP1MQ0Od3Fz+qrxuSscyTOsZ8N28ql5H3Row4YKRR5g8SM6hrodO8JM5MWnCHqFmhKuloRw6e0116v15A8N2DlZczVu8I+Ca4q0ihIz2SJgccux/8KAFRw5JtspASqiroFfw6qX7vY92fDSprYT7DlMjl1HiXoCBIKHwFvHfrqgX/qekVu2yjhAVm7AKk01zqxVN0ssxcwgjKGHw=; 25:cs7p0R+fwfrxAa+MJ6h375CSsggkKl6klnIfGVdbDKDPF39ZBOROJntLqej3TOWd67HvUyaPJZMZodYLPFFI11xrlyX33d/H/48D008m/ksv//rj5/hmcmGDZxmgYUB5wRIG8qd0xoSMi6rHoxyb6hf2v0Hd69NI95Q9vXCCcEF0GLT4DWsj+2k44gRgofwMJuIZa6vqlGcHEWlVXKTAWOScT3b8Yy7fjrjG9zAKxUpKQ27B4rI3oq7dccDwxq5w4OwSGKJLx/yL06j6ThhJ4DFsCYNOB6J+j/e4dhWnyGme95S0JzY+gtQ5ojRSkYyBAStUt4lkL346oLrgOwpEug== X-MS-TrafficTypeDiagnostic: CY4PR03MB3320: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 31:W6adjZthJIvTEEjmhPT2kbAB1d8fmnb0QDptYaXwVXLtc6xiDzzTjLDSkcwZca3YjV4fYn5fHRUE+4XWlgBGwFFQpNydTwUlAUMjDQpQlMFCBdBoOddWnT8Kg5BEcYyF7SZlUCokGc/9DtXe8bxbPF15aLJgzm9OKK6gqBZ1J2GTBJGXfkKrWMJ+/DLxjkY6epjT5lItQu2kZ2ZDUUiyOPSf1HsK9WkkqpL/BArlS5c=; 4:uE3bkRKXtKDoeOV7S57PPmasEMTvsiUB7VJ+X4sHERMKHuHOycVUiiK1HUc4o3i+lOiks94NZfAGnL1FC0XAXu9VH26wEOb+KjNPVQumCgXksOzr8ObOKmyugVTxOpD4tIIfyMgxQ1r67sPhg4KJDX4b8lE6MfAs+lV0wcV1enwiqauXXUIdp0SY8U3mxgtWp6EffI8vaHRfBDP+FsazICmPQVrMHPVbLvEi0QToiC5c3SrDz3X9hPJSh8UT/rk0MGwjYAwTYxRSRE1E+F0Eh+0+AoG1Uy6dqJ6QUnKZiBWGvHdWaUbOMWFv4BoF+yNY1JX7koBIPr6pQGWGZCdpdS7MZ7rZKlxieHv+wrHTPOFxygWl5ZYJyfyHnHoS+tJs X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(185117386973197)(275809806118684); 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:+nxftkQl2zppl7iN2/voKn0EML9o64zT7c1wueprn?= tS0wS+zB9+Zvn0XPMSldD2OuL+YOnB8RX+K3cm/lZOdG2XN1VLguCLKn+JK9MEoG8TEwEpuitrRqzXsedfnyPSLxKGMEQ2Ggb/07Gn6BVj4QO8pi1jqbfO5//ygftpTDKtBpCVhmZIZLCe0/aHsJ9au3uRCax6JGsjNNfHhPqlMSg4PcHRbi+67iX2CF8X2KBYL2VW/nJ9eAdZNzZSJ+gFNArvFuqJJmM0UeeFyEmhm0YsGaKvd7KH92GA1FXwE349f3P1fnCG/PUdoO8wQ2yOmBJniX0QrzxXs6rEo24CfaTeGCLU4Jm1rNQ1q4NQvSQ/3geFAJJyez+jHtCFJ11///lZm95BM5RCkjB7oG+tUMz9TvcL/Xb6+3qZq8NqJLU7706czVNQMCmV3jMgEh45vrsnTCbhgGhR1+exSqsUkymcVPIh4qA45lIRUn5HjjlIir3EuAcqwffbtDFC7Tu3b/5CSWgNXnq1xKeOH2vsPyqvsRfA/f5lsj0l6pQMUMrN9CHTp4yNUH3FLYsb/zPgdDQskwuMjVVej6P3UpPlmixOtFH3CTn7+Eh4zHQ6DyaruxBkp6aN5uueVQDKmvykol/U6XBdLCOLfJnlLWwDlRKIBbnhmnKzGvtu75DG2MceJTcFklRlioBzYE8WsRiYt9HTrQar4rQzMSCkD1j/REH7TjiyoLPbCSzofJw8QV97ZBtH0SdjBLG5KGbUS/N0YYv0CtwPssUha7iT4IAnKbkysoAi1MO2hPL5CCIzloooRuCU+mA5lBuRNczdOuxLpQMEsbprRDnb+fK8Mmnu2PhBA6icPyHdaedVlwfIW4PJV7lyTexsArgu2MTlNxe5LNQL/SJeF2uxvvov7RJL7ubrxBwWmvExkRN5NyZrzW4aM+HRzj5I93XUHYmRXFdxXfruzINw1BQkC446ybGMoPsX7m7BmczUyKDgJtpO86M0NQPVhRYRXsrVsuyz2DWdH2MHWOtI7cnO+FOwYy/UnKOMQmYSTQfOdSgjzGlaIkOcTZ/dto7NdBE4KjI89kAr3TFFEX0M3FI8uU3gE4sMbZpCFPCJi2i4/MV4wXNd1wre+dA/TtxnokJb4UhJMXtPJzr/vdcgz+ica66nrTyJBDFvBirjx/Dzf7wgGHPK+QCIFDlH5dJUBqSotQN+TIMFLJb1pVPmAM9QJQ0pj7e1QrLYUy5/NWCU3cQdi+zvaPa4= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 6:7uT5+lJKcR78SXvfaFT6mgzMqxLP9BXrZrHISpF9lpvHxlV8a02Opk/mz5Pm3v48opaYyUw7eRNL8ZJaEYh9I+s445i4ikI0sxRVB5ukeESaxQ/yqP1pk6T/3NGj3mM6AqDX9RjZ/gj5uyYyD+bo3m/VnYs/tK0MM6E3YreCvjXGc561/yOns6kacBXaEkSCGxQpqblC6FL3HvKyJZ7rkifBZMUTRSSL0iDQ54JslR/0rQF4iv7HifLBiPlqkRIDNKz/2ZRxuPtv77ji/VR9pWpw5BwVXls5hbYFnkQPREKOxTSkToVS0GDpxRQdExP4lpzxfnv4lNPTnlILZCVS0g==; 5:jRCBcAEw4hqsk3gb4uyll74hk4mQ54Tu5dYumyRJWGJSBUvuBkTcam+6yp6RA3GjEumc7QX8MjQWhzuMsNhe08uV778H72jAGw6bBY2CyRgPBWNgtTftLTj8Uwj6O9ObpJ9tkXlxOH4JOAa4NUNIVw==; 24:Y+DKsDQoQtkNLOJUOy/mn3m/Dohk4JNqxXJGtG4OcTdLut9yawrk4IYRH27OfFn5gHN2npMCVOXMVyHnOGqGY7F6WPozj7qZhwCWYaFaIvg=; 7:Ix2zREn5odoInBl6VxHmS5s5WFJjDq6a3JryjESErHeKSGW39ENSkXRZp8pVEHRYqCVPi1VoQB1WUE3mBQkG7kLGiSfD7WUW1p3GdXp0UdexzYMuGfpIX39s2kaU05upSkvLuOigL+XYWo7KJcS4a57EMPFicFM3uL5vWjGcODXhZophPjqwLaO+Qi53eSuZqdtE5b64EzRp5N1g/DUApJNGShIOrlO/M48ojmdIvZo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:10.2860 (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 10/30] net/dpaa2: update MC to 10.3.x 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" From: Shreyansh Jain Signed-off-by: Shreyansh Jain Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/Makefile | 1 + drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 11 +- drivers/net/dpaa2/dpaa2_ethdev.c | 21 +- drivers/net/dpaa2/dpaa2_ethdev.h | 2 +- drivers/net/dpaa2/mc/dpkg.c | 107 ++++ drivers/net/dpaa2/mc/dpni.c | 1093 ++++++++++++++++++++++++++------ drivers/net/dpaa2/mc/fsl_dpkg.h | 69 +- drivers/net/dpaa2/mc/fsl_dpni.h | 1083 +++++++++---------------------- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 970 +++++++++++++++------------- drivers/net/dpaa2/mc/fsl_net.h | 2 +- 10 files changed, 1939 insertions(+), 1420 deletions(-) create mode 100644 drivers/net/dpaa2/mc/dpkg.c -- 2.7.4 diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 32cd819..2f551d5 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -63,6 +63,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += base/dpaa2_hw_dpni.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c +SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpkg.c LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_mempool_dpaa2 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 4c82aa8..1269dd2 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -79,7 +79,7 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, tc_cfg.dist_size = eth_dev->data->nb_rx_queues; tc_cfg.dist_mode = DPNI_DIST_MODE_HASH; - ret = dpni_prepare_key_cfg(&kg_cfg, p_params); + ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); if (ret) { RTE_LOG(ERR, PMD, "Unable to prepare extract parameters\n"); rte_free(p_params); @@ -118,12 +118,12 @@ int dpaa2_remove_flow_dist( } memset(p_params, 0, DIST_PARAM_IOVA_SIZE); memset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg)); - + kg_cfg.num_extracts = 0; tc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params)); tc_cfg.dist_size = 0; tc_cfg.dist_mode = DPNI_DIST_MODE_NONE; - ret = dpni_prepare_key_cfg(&kg_cfg, p_params); + ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); if (ret) { RTE_LOG(ERR, PMD, "Unable to prepare extract parameters\n"); rte_free(p_params); @@ -133,12 +133,10 @@ int dpaa2_remove_flow_dist( ret = dpni_set_rx_tc_dist(dpni, CMD_PRI_LOW, priv->token, tc_index, &tc_cfg); rte_free(p_params); - if (ret) { + if (ret) RTE_LOG(ERR, PMD, "Setting distribution for Rx failed with err: %d\n", ret); - return ret; - } return ret; } @@ -337,6 +335,7 @@ dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, bpool_cfg.pools[0].backup_pool = 0; bpool_cfg.pools[0].buffer_size = RTE_ALIGN_CEIL(bp_list->buf_pool.size, DPAA2_PACKET_LAYOUT_ALIGN); + bpool_cfg.pools[0].priority_mask = 0; retcode = dpni_set_pools(dpni, CMD_PRI_LOW, priv->token, &bpool_cfg); if (retcode != 0) { diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 360109e..945dcc7 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -941,7 +941,7 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev, /*Get Counters from page_0*/ retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, - page0, &value); + page0, 0, &value); if (retcode) goto err; @@ -950,7 +950,7 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev, /*Get Counters from page_1*/ retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, - page1, &value); + page1, 0, &value); if (retcode) goto err; @@ -959,7 +959,7 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev, /*Get Counters from page_2*/ retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, - page2, &value); + page2, 0, &value); if (retcode) goto err; @@ -1384,22 +1384,19 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } - priv->num_tc = attr.num_tcs; + priv->num_rx_tc = attr.num_rx_tcs; - /* Resetting the "num_rx_vqueues" to equal number of queues in first TC + /* Resetting the "num_rx_queues" to equal number of queues in first TC * as only one TC is supported on Rx Side. Once Multiple TCs will be * in use for Rx processing then this will be changed or removed. */ priv->nb_rx_queues = attr.num_queues; - /* TODO:Using hard coded value for number of TX queues due to dependency - * in MC. - */ - priv->nb_tx_queues = 8; + /* Using number of TX queues as number of TX TCs */ + priv->nb_tx_queues = attr.num_tx_tcs; - PMD_INIT_LOG(DEBUG, "num TC - RX %d", priv->num_tc); - PMD_INIT_LOG(DEBUG, "nb_tx_queues %d", priv->nb_tx_queues); - PMD_INIT_LOG(DEBUG, "nb_rx_queues %d", priv->nb_rx_queues); + PMD_DRV_LOG(DEBUG, "RX-TC= %d, nb_rx_queues= %d, nb_tx_queues=%d", + priv->num_tc, priv->nb_rx_queues, priv->nb_tx_queues); priv->hw = dpni_dev; priv->hw_id = hw_id; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index a2902da..07e1da6 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -87,7 +87,7 @@ struct dpaa2_dev_priv { uint32_t options; uint8_t max_mac_filters; uint8_t max_vlan_filters; - uint8_t num_tc; + uint8_t num_rx_tc; uint8_t flags; /*dpaa2 config flags */ }; diff --git a/drivers/net/dpaa2/mc/dpkg.c b/drivers/net/dpaa2/mc/dpkg.c new file mode 100644 index 0000000..3f98907 --- /dev/null +++ b/drivers/net/dpaa2/mc/dpkg.c @@ -0,0 +1,107 @@ +/*- + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * BSD LICENSE + * + * Copyright 2017 NXP + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * GPL LICENSE SUMMARY + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include + +/** + * dpkg_prepare_key_cfg() - function prepare extract parameters + * @cfg: defining a full Key Generation profile (rule) + * @key_cfg_buf: Zeroed 256 bytes of memory before mapping it to DMA + * + * This function has to be called before the following functions: + * - dpni_set_rx_tc_dist() + * - dpni_set_qos_table() + * - dpkg_prepare_key_cfg() + */ +int +dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf) +{ + int i, j; + struct dpni_ext_set_rx_tc_dist *dpni_ext; + struct dpni_dist_extract *extr; + + if (cfg->num_extracts > DPKG_MAX_NUM_OF_EXTRACTS) + return -EINVAL; + + dpni_ext = (struct dpni_ext_set_rx_tc_dist *)key_cfg_buf; + dpni_ext->num_extracts = cfg->num_extracts; + + for (i = 0; i < cfg->num_extracts; i++) { + extr = &dpni_ext->extracts[i]; + + switch (cfg->extracts[i].type) { + case DPKG_EXTRACT_FROM_HDR: + extr->prot = cfg->extracts[i].extract.from_hdr.prot; + dpkg_set_field(extr->efh_type, EFH_TYPE, + cfg->extracts[i].extract.from_hdr.type); + extr->size = cfg->extracts[i].extract.from_hdr.size; + extr->offset = cfg->extracts[i].extract.from_hdr.offset; + extr->field = cpu_to_le32( + cfg->extracts[i].extract.from_hdr.field); + extr->hdr_index = + cfg->extracts[i].extract.from_hdr.hdr_index; + break; + case DPKG_EXTRACT_FROM_DATA: + extr->size = cfg->extracts[i].extract.from_data.size; + extr->offset = + cfg->extracts[i].extract.from_data.offset; + break; + case DPKG_EXTRACT_FROM_PARSE: + extr->size = cfg->extracts[i].extract.from_parse.size; + extr->offset = + cfg->extracts[i].extract.from_parse.offset; + break; + default: + return -EINVAL; + } + + extr->num_of_byte_masks = cfg->extracts[i].num_of_byte_masks; + dpkg_set_field(extr->extract_type, EXTRACT_TYPE, + cfg->extracts[i].type); + + for (j = 0; j < DPKG_NUM_OF_MASKS; j++) { + extr->masks[j].mask = cfg->extracts[i].masks[j].mask; + extr->masks[j].offset = + cfg->extracts[i].masks[j].offset; + } + } + + return 0; +} diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index c2d3969..f95e669 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -42,100 +42,39 @@ #include #include -int dpni_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, - uint8_t *key_cfg_buf) -{ - int i, j; - int offset = 0; - int param = 1; - uint64_t *params = (uint64_t *)key_cfg_buf; - - if (!key_cfg_buf || !cfg) - return -EINVAL; - - params[0] |= mc_enc(0, 8, cfg->num_extracts); - params[0] = cpu_to_le64(params[0]); - - if (cfg->num_extracts >= DPKG_MAX_NUM_OF_EXTRACTS) - return -EINVAL; - - for (i = 0; i < cfg->num_extracts; i++) { - switch (cfg->extracts[i].type) { - case DPKG_EXTRACT_FROM_HDR: - params[param] |= mc_enc(0, 8, - cfg->extracts[i].extract.from_hdr.prot); - params[param] |= mc_enc(8, 4, - cfg->extracts[i].extract.from_hdr.type); - params[param] |= mc_enc(16, 8, - cfg->extracts[i].extract.from_hdr.size); - params[param] |= mc_enc(24, 8, - cfg->extracts[i].extract. - from_hdr.offset); - params[param] |= mc_enc(32, 32, - cfg->extracts[i].extract. - from_hdr.field); - params[param] = cpu_to_le64(params[param]); - param++; - params[param] |= mc_enc(0, 8, - cfg->extracts[i].extract. - from_hdr.hdr_index); - break; - case DPKG_EXTRACT_FROM_DATA: - params[param] |= mc_enc(16, 8, - cfg->extracts[i].extract. - from_data.size); - params[param] |= mc_enc(24, 8, - cfg->extracts[i].extract. - from_data.offset); - params[param] = cpu_to_le64(params[param]); - param++; - break; - case DPKG_EXTRACT_FROM_PARSE: - params[param] |= mc_enc(16, 8, - cfg->extracts[i].extract. - from_parse.size); - params[param] |= mc_enc(24, 8, - cfg->extracts[i].extract. - from_parse.offset); - params[param] = cpu_to_le64(params[param]); - param++; - break; - default: - return -EINVAL; - } - params[param] |= mc_enc( - 24, 8, cfg->extracts[i].num_of_byte_masks); - params[param] |= mc_enc(32, 4, cfg->extracts[i].type); - params[param] = cpu_to_le64(params[param]); - param++; - for (offset = 0, j = 0; - j < DPKG_NUM_OF_MASKS; - offset += 16, j++) { - params[param] |= mc_enc( - (offset), 8, cfg->extracts[i].masks[j].mask); - params[param] |= mc_enc( - (offset + 8), 8, - cfg->extracts[i].masks[j].offset); - } - params[param] = cpu_to_le64(params[param]); - param++; - } - return 0; -} - +/** + * dpni_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpni_id: DPNI unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpni_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpni_id, uint16_t *token) { struct mc_command cmd = { 0 }; + struct dpni_cmd_open *cmd_params; + int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_OPEN, cmd_flags, 0); - DPNI_CMD_OPEN(cmd, dpni_id); + cmd_params = (struct dpni_cmd_open *)cmd.params; + cmd_params->dpni_id = cpu_to_le32(dpni_id); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -143,11 +82,22 @@ int dpni_open(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + *token = mc_cmd_hdr_read_token(&cmd); return 0; } +/** + * dpni_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -163,12 +113,35 @@ int dpni_close(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } -int dpni_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpni_cfg *cfg, - uint32_t *obj_id) +/** + * dpni_create() - Create the DPNI object + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: Returned object id + * + * Create the DPNI object, allocate required resources and + * perform required initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * The function accepts an authentication token of a parent + * container that this object should be assigned to. The token + * can be '0' so the object will be assigned to the default container. + * The newly created object can be opened with the returned + * object id and using the container's associated tokens and MC portals. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpni_cfg *cfg, + uint32_t *obj_id) { + struct dpni_cmd_create *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -176,7 +149,14 @@ int dpni_create(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPNI_CMDID_CREATE, cmd_flags, dprc_token); - DPNI_CMD_CREATE(cmd, cfg); + cmd_params = (struct dpni_cmd_create *)cmd.params; + cmd_params->options = cpu_to_le32(cfg->options); + cmd_params->num_queues = cfg->num_queues; + cmd_params->num_tcs = cfg->num_tcs; + cmd_params->mac_filter_entries = cfg->mac_filter_entries; + cmd_params->vlan_filter_entries = cfg->vlan_filter_entries; + cmd_params->qos_entries = cfg->qos_entries; + cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -184,16 +164,32 @@ int dpni_create(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + *obj_id = mc_cmd_read_object_id(&cmd); return 0; } -int dpni_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id) +/** + * dpni_destroy() - Destroy the DPNI object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @object_id: The object id; it must be a valid id within the container that + * created this object; + * + * The function accepts the authentication token of the parent container that + * created the object (not the one that currently owns the object). The object + * is searched within parent using the provided 'object_id'. + * All tokens to the object must be closed before calling destroy. + * + * Return: '0' on Success; error code otherwise. + */ +int dpni_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id) { + struct dpni_cmd_destroy *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ @@ -201,28 +197,63 @@ int dpni_destroy(struct fsl_mc_io *mc_io, cmd_flags, dprc_token); /* set object id to destroy */ - CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); + cmd_params = (struct dpni_cmd_destroy *)cmd.params; + cmd_params->dpsw_id = cpu_to_le32(object_id); + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_set_pools() - Set buffer pools configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @cfg: Buffer pools configuration + * + * mandatory for DPNI operation + * warning:Allowed only when DPNI is disabled + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_pools(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, const struct dpni_pools_cfg *cfg) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_pools *cmd_params; + int i; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_POOLS, cmd_flags, token); - DPNI_CMD_SET_POOLS(cmd, cfg); + cmd_params = (struct dpni_cmd_set_pools *)cmd.params; + cmd_params->num_dpbp = cfg->num_dpbp; + for (i = 0; i < DPNI_MAX_DPBP; i++) { + cmd_params->pool[i].dpbp_id = + cpu_to_le16(cfg->pools[i].dpbp_id); + cmd_params->pool[i].priority_mask = + cfg->pools[i].priority_mask; + cmd_params->buffer_size[i] = + cpu_to_le16(cfg->pools[i].buffer_size); + cmd_params->backup_pool_mask |= + DPNI_BACKUP_POOL(cfg->pools[i].backup_pool, i); + } /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_enable() - Enable the DPNI, allow sending and receiving frames. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_enable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -238,6 +269,14 @@ int dpni_enable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpni_disable() - Disable the DPNI, stop sending and receiving frames. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_disable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -253,15 +292,27 @@ int dpni_disable(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpni_is_enabled() - Check if the DPNI is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { struct mc_command cmd = { 0 }; + struct dpni_rsp_is_enabled *rsp_params; int err; + /* prepare command */ - cmd.header = mc_encode_cmd_header(DPNI_CMDID_IS_ENABLED, cmd_flags, + cmd.header = mc_encode_cmd_header(DPNI_CMDID_IS_ENABLED, + cmd_flags, token); /* send command to mc*/ @@ -270,11 +321,20 @@ int dpni_is_enabled(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_IS_ENABLED(cmd, *en); + rsp_params = (struct dpni_rsp_is_enabled *)cmd.params; + *en = dpni_get_field(rsp_params->enabled, ENABLE); return 0; } +/** + * dpni_reset() - Reset the DPNI, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_reset(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -290,12 +350,23 @@ int dpni_reset(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_attributes() - Retrieve DPNI attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @attr: Object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_attributes(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, struct dpni_attr *attr) { struct mc_command cmd = { 0 }; + struct dpni_rsp_get_attr *rsp_params; + int err; /* prepare command */ @@ -309,28 +380,65 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_ATTR(cmd, attr); + rsp_params = (struct dpni_rsp_get_attr *)cmd.params; + attr->options = le32_to_cpu(rsp_params->options); + attr->num_queues = rsp_params->num_queues; + attr->num_rx_tcs = rsp_params->num_rx_tcs; + attr->num_tx_tcs = rsp_params->num_tx_tcs; + attr->mac_filter_entries = rsp_params->mac_filter_entries; + attr->vlan_filter_entries = rsp_params->vlan_filter_entries; + attr->qos_entries = rsp_params->qos_entries; + attr->fs_entries = le16_to_cpu(rsp_params->fs_entries); + attr->qos_key_size = rsp_params->qos_key_size; + attr->fs_key_size = rsp_params->fs_key_size; + attr->wriop_version = le16_to_cpu(rsp_params->wriop_version); return 0; } +/** + * dpni_set_errors_behavior() - Set errors behavior + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @cfg: Errors configuration + * + * This function may be called numerous times with different + * error masks + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, - struct dpni_error_cfg *cfg) + struct dpni_error_cfg *cfg) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_errors_behavior *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_ERRORS_BEHAVIOR, cmd_flags, token); - DPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg); + cmd_params = (struct dpni_cmd_set_errors_behavior *)cmd.params; + cmd_params->errors = cpu_to_le32(cfg->errors); + dpni_set_field(cmd_params->flags, ERROR_ACTION, cfg->error_action); + dpni_set_field(cmd_params->flags, FRAME_ANN, cfg->set_frame_annotation); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_buffer_layout() - Retrieve buffer layout attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue to retrieve configuration for + * @layout: Returns buffer layout attributes + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -338,13 +446,16 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, struct dpni_buffer_layout *layout) { struct mc_command cmd = { 0 }; + struct dpni_cmd_get_buffer_layout *cmd_params; + struct dpni_rsp_get_buffer_layout *rsp_params; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_BUFFER_LAYOUT, cmd_flags, token); - DPNI_CMD_GET_BUFFER_LAYOUT(cmd, qtype); + cmd_params = (struct dpni_cmd_get_buffer_layout *)cmd.params; + cmd_params->qtype = qtype; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -352,29 +463,72 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_BUFFER_LAYOUT(cmd, layout); + rsp_params = (struct dpni_rsp_get_buffer_layout *)cmd.params; + layout->pass_timestamp = dpni_get_field(rsp_params->flags, PASS_TS); + layout->pass_parser_result = dpni_get_field(rsp_params->flags, PASS_PR); + layout->pass_frame_status = dpni_get_field(rsp_params->flags, PASS_FS); + layout->private_data_size = le16_to_cpu(rsp_params->private_data_size); + layout->data_align = le16_to_cpu(rsp_params->data_align); + layout->data_head_room = le16_to_cpu(rsp_params->head_room); + layout->data_tail_room = le16_to_cpu(rsp_params->tail_room); return 0; } +/** + * dpni_set_buffer_layout() - Set buffer layout configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue this configuration applies to + * @layout: Buffer layout configuration + * + * Return: '0' on Success; Error code otherwise. + * + * @warning Allowed only when DPNI is disabled + */ int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, - const struct dpni_buffer_layout *layout) + uint16_t token, + enum dpni_queue_type qtype, + const struct dpni_buffer_layout *layout) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_buffer_layout *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_BUFFER_LAYOUT, cmd_flags, token); - DPNI_CMD_SET_BUFFER_LAYOUT(cmd, qtype, layout); + cmd_params = (struct dpni_cmd_set_buffer_layout *)cmd.params; + cmd_params->qtype = qtype; + cmd_params->options = cpu_to_le16(layout->options); + dpni_set_field(cmd_params->flags, PASS_TS, layout->pass_timestamp); + dpni_set_field(cmd_params->flags, PASS_PR, layout->pass_parser_result); + dpni_set_field(cmd_params->flags, PASS_FS, layout->pass_frame_status); + cmd_params->private_data_size = cpu_to_le16(layout->private_data_size); + cmd_params->data_align = cpu_to_le16(layout->data_align); + cmd_params->head_room = cpu_to_le16(layout->data_head_room); + cmd_params->tail_room = cpu_to_le16(layout->data_tail_room); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_set_offload() - Set DPNI offload configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @type: Type of DPNI offload + * @config: Offload configuration. + * For checksum offloads, non-zero value enables the offload + * + * Return: '0' on Success; Error code otherwise. + * + * @warning Allowed only when DPNI is disabled + */ + int dpni_set_offload(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -382,17 +536,32 @@ int dpni_set_offload(struct fsl_mc_io *mc_io, uint32_t config) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_offload *cmd_params; - /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_OFFLOAD, cmd_flags, token); - DPNI_CMD_SET_OFFLOAD(cmd, type, config); + cmd_params = (struct dpni_cmd_set_offload *)cmd.params; + cmd_params->dpni_offload = type; + cmd_params->config = cpu_to_le32(config); - /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_offload() - Get DPNI offload configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @type: Type of DPNI offload + * @config: Offload configuration. + * For checksum offloads, a value of 1 indicates that the + * offload is enabled. + * + * Return: '0' on Success; Error code otherwise. + * + * @warning Allowed only when DPNI is disabled + */ int dpni_get_offload(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -400,13 +569,16 @@ int dpni_get_offload(struct fsl_mc_io *mc_io, uint32_t *config) { struct mc_command cmd = { 0 }; + struct dpni_cmd_get_offload *cmd_params; + struct dpni_rsp_get_offload *rsp_params; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_OFFLOAD, cmd_flags, token); - DPNI_CMD_GET_OFFLOAD(cmd, type); + cmd_params = (struct dpni_cmd_get_offload *)cmd.params; + cmd_params->dpni_offload = type; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -414,11 +586,24 @@ int dpni_get_offload(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_OFFLOAD(cmd, *config); + rsp_params = (struct dpni_rsp_get_offload *)cmd.params; + *config = le32_to_cpu(rsp_params->config); return 0; } +/** + * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used + * for enqueue operations + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue to receive QDID for + * @qdid: Returned virtual QDID value that should be used as an argument + * in all enqueue operations + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_qdid(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -426,13 +611,51 @@ int dpni_get_qdid(struct fsl_mc_io *mc_io, uint16_t *qdid) { struct mc_command cmd = { 0 }; + struct dpni_cmd_get_qdid *cmd_params; + struct dpni_rsp_get_qdid *rsp_params; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QDID, cmd_flags, token); - DPNI_CMD_GET_QDID(cmd, qtype); + cmd_params = (struct dpni_cmd_get_qdid *)cmd.params; + cmd_params->qtype = qtype; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpni_rsp_get_qdid *)cmd.params; + *qdid = le16_to_cpu(rsp_params->qdid); + + return 0; +} + +/** + * dpni_get_tx_data_offset() - Get the Tx data offset (from start of buffer) + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @data_offset: Tx data offset (from start of buffer) + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *data_offset) +{ + struct mc_command cmd = { 0 }; + struct dpni_rsp_get_tx_data_offset *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_DATA_OFFSET, + cmd_flags, + token); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -440,34 +663,57 @@ int dpni_get_qdid(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_QDID(cmd, *qdid); + rsp_params = (struct dpni_rsp_get_tx_data_offset *)cmd.params; + *data_offset = le16_to_cpu(rsp_params->data_offset); return 0; } +/** + * dpni_set_link_cfg() - set the link configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @cfg: Link configuration + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_link_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, const struct dpni_link_cfg *cfg) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_link_cfg *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_LINK_CFG, cmd_flags, token); - DPNI_CMD_SET_LINK_CFG(cmd, cfg); + cmd_params = (struct dpni_cmd_set_link_cfg *)cmd.params; + cmd_params->rate = cpu_to_le32(cfg->rate); + cmd_params->options = cpu_to_le64(cfg->options); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_link_state() - Return the link state (either up or down) + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @state: Returned link state; + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_link_state(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, struct dpni_link_state *state) { struct mc_command cmd = { 0 }; + struct dpni_rsp_get_link_state *rsp_params; int err; /* prepare command */ @@ -481,34 +727,60 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_LINK_STATE(cmd, state); + rsp_params = (struct dpni_rsp_get_link_state *)cmd.params; + state->up = dpni_get_field(rsp_params->flags, LINK_STATE); + state->rate = le32_to_cpu(rsp_params->rate); + state->options = le64_to_cpu(rsp_params->options); return 0; } +/** + * dpni_set_max_frame_length() - Set the maximum received frame length. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @max_frame_length: Maximum received frame length (in bytes); + * frame is discarded if its length exceeds this value + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_max_frame_length(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint16_t max_frame_length) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_max_frame_length *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_MAX_FRAME_LENGTH, cmd_flags, token); - DPNI_CMD_SET_MAX_FRAME_LENGTH(cmd, max_frame_length); + cmd_params = (struct dpni_cmd_set_max_frame_length *)cmd.params; + cmd_params->max_frame_length = cpu_to_le16(max_frame_length); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_max_frame_length() - Get the maximum received frame length. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @max_frame_length: Maximum received frame length (in bytes); + * frame is discarded if its length exceeds this value + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_max_frame_length(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint16_t *max_frame_length) { struct mc_command cmd = { 0 }; + struct dpni_rsp_get_max_frame_length *rsp_params; int err; /* prepare command */ @@ -522,34 +794,56 @@ int dpni_get_max_frame_length(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_MAX_FRAME_LENGTH(cmd, *max_frame_length); + rsp_params = (struct dpni_rsp_get_max_frame_length *)cmd.params; + *max_frame_length = le16_to_cpu(rsp_params->max_frame_length); return 0; } +/** + * dpni_set_multicast_promisc() - Enable/disable multicast promiscuous mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Set to '1' to enable; '0' to disable + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int en) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_multicast_promisc *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_MCAST_PROMISC, cmd_flags, token); - DPNI_CMD_SET_MULTICAST_PROMISC(cmd, en); + cmd_params = (struct dpni_cmd_set_multicast_promisc *)cmd.params; + dpni_set_field(cmd_params->enable, ENABLE, en); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_multicast_promisc() - Get multicast promiscuous mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Returns '1' if enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { struct mc_command cmd = { 0 }; + struct dpni_rsp_get_multicast_promisc *rsp_params; int err; /* prepare command */ @@ -563,34 +857,56 @@ int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_MULTICAST_PROMISC(cmd, *en); + rsp_params = (struct dpni_rsp_get_multicast_promisc *)cmd.params; + *en = dpni_get_field(rsp_params->enabled, ENABLE); return 0; } +/** + * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Set to '1' to enable; '0' to disable + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int en) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_unicast_promisc *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_UNICAST_PROMISC, cmd_flags, token); - DPNI_CMD_SET_UNICAST_PROMISC(cmd, en); + cmd_params = (struct dpni_cmd_set_unicast_promisc *)cmd.params; + dpni_set_field(cmd_params->enable, ENABLE, en); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_unicast_promisc() - Get unicast promiscuous mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Returns '1' if enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, int *en) { struct mc_command cmd = { 0 }; + struct dpni_rsp_get_unicast_promisc *rsp_params; int err; /* prepare command */ @@ -604,35 +920,59 @@ int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_UNICAST_PROMISC(cmd, *en); + rsp_params = (struct dpni_rsp_get_unicast_promisc *)cmd.params; + *en = dpni_get_field(rsp_params->enabled, ENABLE); return 0; } +/** + * dpni_set_primary_mac_addr() - Set the primary MAC address + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @mac_addr: MAC address to set as primary address + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, const uint8_t mac_addr[6]) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_primary_mac_addr *cmd_params; + int i; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_PRIM_MAC, cmd_flags, token); - DPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr); + cmd_params = (struct dpni_cmd_set_primary_mac_addr *)cmd.params; + for (i = 0; i < 6; i++) + cmd_params->mac_addr[i] = mac_addr[5 - i]; /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_primary_mac_addr() - Get the primary MAC address + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @mac_addr: Returned MAC address + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t mac_addr[6]) { struct mc_command cmd = { 0 }; - int err; + struct dpni_rsp_get_primary_mac_addr *rsp_params; + int i, err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_PRIM_MAC, @@ -645,45 +985,85 @@ int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr); + rsp_params = (struct dpni_rsp_get_primary_mac_addr *)cmd.params; + for (i = 0; i < 6; i++) + mac_addr[5 - i] = rsp_params->mac_addr[i]; return 0; } +/** + * dpni_add_mac_addr() - Add MAC address filter + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @mac_addr: MAC address to add + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_add_mac_addr(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, const uint8_t mac_addr[6]) { struct mc_command cmd = { 0 }; + struct dpni_cmd_add_mac_addr *cmd_params; + int i; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_ADD_MAC_ADDR, cmd_flags, token); - DPNI_CMD_ADD_MAC_ADDR(cmd, mac_addr); + cmd_params = (struct dpni_cmd_add_mac_addr *)cmd.params; + for (i = 0; i < 6; i++) + cmd_params->mac_addr[i] = mac_addr[5 - i]; /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_remove_mac_addr() - Remove MAC address filter + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @mac_addr: MAC address to remove + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_remove_mac_addr(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, const uint8_t mac_addr[6]) { struct mc_command cmd = { 0 }; + struct dpni_cmd_remove_mac_addr *cmd_params; + int i; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_REMOVE_MAC_ADDR, cmd_flags, token); - DPNI_CMD_REMOVE_MAC_ADDR(cmd, mac_addr); + cmd_params = (struct dpni_cmd_remove_mac_addr *)cmd.params; + for (i = 0; i < 6; i++) + cmd_params->mac_addr[i] = mac_addr[5 - i]; /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_clear_mac_filters() - Clear all unicast and/or multicast MAC filters + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @unicast: Set to '1' to clear unicast addresses + * @multicast: Set to '1' to clear multicast addresses + * + * The primary MAC address is not cleared by this operation. + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_clear_mac_filters(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -691,24 +1071,40 @@ int dpni_clear_mac_filters(struct fsl_mc_io *mc_io, int multicast) { struct mc_command cmd = { 0 }; + struct dpni_cmd_clear_mac_filters *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_CLR_MAC_FILTERS, cmd_flags, token); - DPNI_CMD_CLEAR_MAC_FILTERS(cmd, unicast, multicast); + cmd_params = (struct dpni_cmd_clear_mac_filters *)cmd.params; + dpni_set_field(cmd_params->flags, UNICAST_FILTERS, unicast); + dpni_set_field(cmd_params->flags, MULTICAST_FILTERS, multicast); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_port_mac_addr() - Retrieve MAC address associated to the physical + * port the DPNI is attached to + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @mac_addr: MAC address of the physical port, if any, otherwise 0 + * + * The primary MAC address is not cleared by this operation. + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t mac_addr[6]) { struct mc_command cmd = { 0 }; - int err; + struct dpni_rsp_get_port_mac_addr *rsp_params; + int i, err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_PORT_MAC_ADDR, @@ -721,62 +1117,105 @@ int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - DPNI_RSP_GET_PORT_MAC_ADDR(cmd, mac_addr); + rsp_params = (struct dpni_rsp_get_port_mac_addr *)cmd.params; + for (i = 0; i < 6; i++) + mac_addr[5 - i] = rsp_params->mac_addr[i]; return 0; } +/** + * dpni_enable_vlan_filter() - Enable/disable VLAN filtering mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Set to '1' to enable; '0' to disable + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t token, - int en) + uint16_t token, + int en) { + struct dpni_cmd_enable_vlan_filter *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_ENABLE_VLAN_FILTER, cmd_flags, token); - DPNI_CMD_ENABLE_VLAN_FILTER(cmd, en); + cmd_params = (struct dpni_cmd_enable_vlan_filter *)cmd.params; + dpni_set_field(cmd_params->en, ENABLE, en); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_add_vlan_id() - Add VLAN ID filter + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @vlan_id: VLAN ID to add + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_add_vlan_id(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint16_t vlan_id) { + struct dpni_cmd_vlan_id *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_ADD_VLAN_ID, cmd_flags, token); - DPNI_CMD_ADD_VLAN_ID(cmd, vlan_id); + cmd_params = (struct dpni_cmd_vlan_id *)cmd.params; + cmd_params->vlan_id = cpu_to_le16(vlan_id); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_remove_vlan_id() - Remove VLAN ID filter + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @vlan_id: VLAN ID to remove + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_remove_vlan_id(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint16_t vlan_id) { + struct dpni_cmd_vlan_id *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_REMOVE_VLAN_ID, cmd_flags, token); - DPNI_CMD_REMOVE_VLAN_ID(cmd, vlan_id); + cmd_params = (struct dpni_cmd_vlan_id *)cmd.params; + cmd_params->vlan_id = cpu_to_le16(vlan_id); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } +/** + * dpni_clear_vlan_filters() - Clear all VLAN filters + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -792,6 +1231,19 @@ int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpni_set_rx_tc_dist() - Set Rx traffic class distribution configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @tc_id: Traffic class selection (0-7) + * @cfg: Traffic class distribution configuration + * + * warning: if 'dist_mode != DPNI_DIST_MODE_NONE', call dpkg_prepare_key_cfg() + * first to prepare the key_cfg_iova parameter + * + * Return: '0' on Success; error code otherwise. + */ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -799,87 +1251,185 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, const struct dpni_rx_tc_dist_cfg *cfg) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_rx_tc_dist *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_RX_TC_DIST, cmd_flags, token); - DPNI_CMD_SET_RX_TC_DIST(cmd, tc_id, cfg); + cmd_params = (struct dpni_cmd_set_rx_tc_dist *)cmd.params; + cmd_params->dist_size = cpu_to_le16(cfg->dist_size); + cmd_params->tc_id = tc_id; + cmd_params->default_flow_id = cpu_to_le16(cfg->fs_cfg.default_flow_id); + cmd_params->key_cfg_iova = cpu_to_le64(cfg->key_cfg_iova); + dpni_set_field(cmd_params->flags, + DIST_MODE, + cfg->dist_mode); + dpni_set_field(cmd_params->flags, + MISS_ACTION, + cfg->fs_cfg.miss_action); + dpni_set_field(cmd_params->keep_hash_key, + KEEP_HASH_KEY, + cfg->fs_cfg.keep_hash_key); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_confirmation_mode mode) +/** + * dpni_set_tx_confirmation_mode() - Tx confirmation mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @mode: Tx confirmation mode + * + * This function is useful only when 'DPNI_OPT_TX_CONF_DISABLED' is not + * selected at DPNI creation. + * Calling this function with 'mode' set to DPNI_CONF_DISABLE disables all + * transmit confirmation (including the private confirmation queues), regardless + * of previous settings; Note that in this case, Tx error frames are still + * enqueued to the general transmit errors queue. + * Calling this function with 'mode' set to DPNI_CONF_SINGLE switches all + * Tx confirmations to a shared Tx conf queue. 'index' field in dpni_get_queue + * command will be ignored. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_confirmation_mode mode) { + struct dpni_tx_confirmation_mode *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_CONFIRMATION_MODE, cmd_flags, token); - DPNI_CMD_SET_TX_CONFIRMATION_MODE(cmd, mode); + cmd_params = (struct dpni_tx_confirmation_mode *)cmd.params; + cmd_params->confirmation_mode = mode; /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int dpni_set_congestion_notification( - struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, - uint8_t tc_id, +/** + * dpni_set_congestion_notification() - Set traffic class congestion + * notification configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue - Rx, Tx and Tx confirm types are supported + * @tc_id: Traffic class selection (0-7) + * @cfg: congestion notification configuration + * + * Return: '0' on Success; error code otherwise. + */ +int dpni_set_congestion_notification(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_queue_type qtype, + uint8_t tc_id, const struct dpni_congestion_notification_cfg *cfg) { + struct dpni_cmd_set_congestion_notification *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header( - DPNI_CMDID_SET_CONGESTION_NOTIFICATION, - cmd_flags, - token); - DPNI_CMD_SET_CONGESTION_NOTIFICATION(cmd, qtype, tc_id, cfg); + DPNI_CMDID_SET_CONGESTION_NOTIFICATION, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_set_congestion_notification *)cmd.params; + cmd_params->qtype = qtype; + cmd_params->tc = tc_id; + cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); + cmd_params->notification_mode = cpu_to_le16(cfg->notification_mode); + cmd_params->dest_priority = cfg->dest_cfg.priority; + cmd_params->message_iova = cpu_to_le64(cfg->message_iova); + cmd_params->message_ctx = cpu_to_le64(cfg->message_ctx); + cmd_params->threshold_entry = cpu_to_le32(cfg->threshold_entry); + cmd_params->threshold_exit = cpu_to_le32(cfg->threshold_exit); + dpni_set_field(cmd_params->type_units, + DEST_TYPE, + cfg->dest_cfg.dest_type); + dpni_set_field(cmd_params->type_units, + CONG_UNITS, + cfg->units); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, +/** + * dpni_get_congestion_notification() - Get traffic class congestion + * notification configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue - Rx, Tx and Tx confirm types are supported + * @tc_id: Traffic class selection (0-7) + * @cfg: congestion notification configuration + * + * Return: '0' on Success; error code otherwise. + */ +int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, enum dpni_queue_type qtype, - uint8_t tc_id, + uint8_t tc_id, struct dpni_congestion_notification_cfg *cfg) { + struct dpni_rsp_get_congestion_notification *rsp_params; + struct dpni_cmd_get_congestion_notification *cmd_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ cmd.header = mc_encode_cmd_header( - DPNI_CMDID_GET_CONGESTION_NOTIFICATION, - cmd_flags, - token); - DPNI_CMD_GET_CONGESTION_NOTIFICATION(cmd, qtype, tc_id); + DPNI_CMDID_GET_CONGESTION_NOTIFICATION, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_get_congestion_notification *)cmd.params; + cmd_params->qtype = qtype; + cmd_params->tc = tc_id; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; - DPNI_RSP_GET_CONGESTION_NOTIFICATION(cmd, cfg); + rsp_params = (struct dpni_rsp_get_congestion_notification *)cmd.params; + cfg->units = dpni_get_field(rsp_params->type_units, CONG_UNITS); + cfg->threshold_entry = le32_to_cpu(rsp_params->threshold_entry); + cfg->threshold_exit = le32_to_cpu(rsp_params->threshold_exit); + cfg->message_ctx = le64_to_cpu(rsp_params->message_ctx); + cfg->message_iova = le64_to_cpu(rsp_params->message_iova); + cfg->notification_mode = le16_to_cpu(rsp_params->notification_mode); + cfg->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id); + cfg->dest_cfg.priority = rsp_params->dest_priority; + cfg->dest_cfg.dest_type = dpni_get_field(rsp_params->type_units, + DEST_TYPE); return 0; } +/** + * dpni_get_api_version() - Get Data Path Network Interface API version + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of data path network interface API + * @minor_ver: Minor version of data path network interface API + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver) + uint16_t *major_ver, + uint16_t *minor_ver) { + struct dpni_rsp_get_api_version *rsp_params; struct mc_command cmd = { 0 }; int err; @@ -891,87 +1441,177 @@ int dpni_get_api_version(struct fsl_mc_io *mc_io, if (err) return err; - DPNI_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + rsp_params = (struct dpni_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); return 0; } +/** + * dpni_set_queue() - Set queue parameters + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue - all queue types are supported, although + * the command is ignored for Tx + * @tc: Traffic class, in range 0 to NUM_TCS - 1 + * @index: Selects the specific queue out of the set allocated for the + * same TC. Value must be in range 0 to NUM_QUEUES - 1 + * @options: A combination of DPNI_QUEUE_OPT_ values that control what + * configuration options are set on the queue + * @queue: Queue structure + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t token, + uint16_t token, enum dpni_queue_type qtype, - uint8_t tc, - uint8_t index, + uint8_t tc, + uint8_t index, uint8_t options, - const struct dpni_queue *queue) + const struct dpni_queue *queue) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_queue *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_QUEUE, cmd_flags, token); - DPNI_CMD_SET_QUEUE(cmd, qtype, tc, index, options, queue); - - /* send command to mc*/ + cmd_params = (struct dpni_cmd_set_queue *)cmd.params; + cmd_params->qtype = qtype; + cmd_params->tc = tc; + cmd_params->index = index; + cmd_params->options = options; + cmd_params->dest_id = cpu_to_le32(queue->destination.id); + cmd_params->dest_prio = queue->destination.priority; + dpni_set_field(cmd_params->flags, DEST_TYPE, queue->destination.type); + dpni_set_field(cmd_params->flags, STASH_CTRL, queue->flc.stash_control); + dpni_set_field(cmd_params->flags, HOLD_ACTIVE, + queue->destination.hold_active); + cmd_params->flc = cpu_to_le64(queue->flc.value); + cmd_params->user_context = cpu_to_le64(queue->user_context); + + /* send command to mc */ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_queue() - Get queue parameters + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @qtype: Type of queue - all queue types are supported + * @tc: Traffic class, in range 0 to NUM_TCS - 1 + * @index: Selects the specific queue out of the set allocated for the + * same TC. Value must be in range 0 to NUM_QUEUES - 1 + * @queue: Queue configuration structure + * @qid: Queue identification + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t token, + uint16_t token, enum dpni_queue_type qtype, - uint8_t tc, - uint8_t index, + uint8_t tc, + uint8_t index, struct dpni_queue *queue, struct dpni_queue_id *qid) { struct mc_command cmd = { 0 }; + struct dpni_cmd_get_queue *cmd_params; + struct dpni_rsp_get_queue *rsp_params; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QUEUE, cmd_flags, token); - DPNI_CMD_GET_QUEUE(cmd, qtype, tc, index); + cmd_params = (struct dpni_cmd_get_queue *)cmd.params; + cmd_params->qtype = qtype; + cmd_params->tc = tc; + cmd_params->index = index; - /* send command to mc*/ + /* send command to mc */ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPNI_RSP_GET_QUEUE(cmd, queue, qid); + rsp_params = (struct dpni_rsp_get_queue *)cmd.params; + queue->destination.id = le32_to_cpu(rsp_params->dest_id); + queue->destination.priority = rsp_params->dest_prio; + queue->destination.type = dpni_get_field(rsp_params->flags, + DEST_TYPE); + queue->flc.stash_control = dpni_get_field(rsp_params->flags, + STASH_CTRL); + queue->destination.hold_active = dpni_get_field(rsp_params->flags, + HOLD_ACTIVE); + queue->flc.value = le64_to_cpu(rsp_params->flc); + queue->user_context = le64_to_cpu(rsp_params->user_context); + qid->fqid = le32_to_cpu(rsp_params->fqid); + qid->qdbin = le16_to_cpu(rsp_params->qdbin); return 0; } +/** + * dpni_get_statistics() - Get DPNI statistics + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @page: Selects the statistics page to retrieve, see + * DPNI_GET_STATISTICS output. Pages are numbered 0 to 2. + * @param: Custom parameter for some pages used to select + * a certain statistic source, for example the TC. + * @stat: Structure containing the statistics + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_statistics(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t page, + uint8_t param, union dpni_statistics *stat) { struct mc_command cmd = { 0 }; - int err; + struct dpni_cmd_get_statistics *cmd_params; + struct dpni_rsp_get_statistics *rsp_params; + int i, err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_STATISTICS, cmd_flags, token); - DPNI_CMD_GET_STATISTICS(cmd, page); + cmd_params = (struct dpni_cmd_get_statistics *)cmd.params; + cmd_params->page_number = page; + cmd_params->param = param; - /* send command to mc*/ + /* send command to mc */ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPNI_RSP_GET_STATISTICS(cmd, stat); + rsp_params = (struct dpni_rsp_get_statistics *)cmd.params; + for (i = 0; i < DPNI_STATISTICS_CNT; i++) + stat->raw.counter[i] = le64_to_cpu(rsp_params->counter[i]); return 0; } +/** + * dpni_reset_statistics() - Clears DPNI statistics + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_reset_statistics(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token) @@ -987,52 +1627,117 @@ int dpni_reset_statistics(struct fsl_mc_io *mc_io, return mc_send_command(mc_io, &cmd); } +/** + * dpni_set_taildrop() - Set taildrop per queue or TC + * + * Setting a per-TC taildrop (cg_point = DPNI_CP_GROUP) will reset any current + * congestion notification or early drop (WRED) configuration previously applied + * to the same TC. + * + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @cg_point: Congestion point, DPNI_CP_QUEUE is only supported in + * combination with DPNI_QUEUE_RX. + * @q_type: Queue type, can be DPNI_QUEUE_RX or DPNI_QUEUE_TX. + * @tc: Traffic class to apply this taildrop to + * @q_index: Index of the queue if the DPNI supports multiple queues for + * traffic distribution. + * Ignored if CONGESTION_POINT is not DPNI_CP_QUEUE. + * @taildrop: Taildrop structure + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_set_taildrop(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, enum dpni_congestion_point cg_point, - enum dpni_queue_type q_type, + enum dpni_queue_type qtype, uint8_t tc, - uint8_t q_index, + uint8_t index, struct dpni_taildrop *taildrop) { struct mc_command cmd = { 0 }; + struct dpni_cmd_set_taildrop *cmd_params; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TAILDROP, cmd_flags, token); - DPNI_CMD_SET_TAILDROP(cmd, cg_point, q_type, tc, q_index, taildrop); - - /* send command to mc*/ + cmd_params = (struct dpni_cmd_set_taildrop *)cmd.params; + cmd_params->congestion_point = cg_point; + cmd_params->qtype = qtype; + cmd_params->tc = tc; + cmd_params->index = index; + cmd_params->units = taildrop->units; + cmd_params->threshold = cpu_to_le32(taildrop->threshold); + dpni_set_field(cmd_params->enable_oal_lo, ENABLE, taildrop->enable); + dpni_set_field(cmd_params->enable_oal_lo, OAL_LO, taildrop->oal); + dpni_set_field(cmd_params->oal_hi, + OAL_HI, + taildrop->oal >> DPNI_OAL_LO_SIZE); + + /* send command to mc */ return mc_send_command(mc_io, &cmd); } +/** + * dpni_get_taildrop() - Get taildrop information + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @cg_point: Congestion point + * @q_type: Queue type on which the taildrop is configured. + * Only Rx queues are supported for now + * @tc: Traffic class to apply this taildrop to + * @q_index: Index of the queue if the DPNI supports multiple queues for + * traffic distribution. Ignored if CONGESTION_POINT is not 0. + * @taildrop: Taildrop structure + * + * Return: '0' on Success; Error code otherwise. + */ int dpni_get_taildrop(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t token, - enum dpni_congestion_point cg_point, - enum dpni_queue_type q_type, - uint8_t tc, - uint8_t q_index, - struct dpni_taildrop *taildrop) + uint16_t token, + enum dpni_congestion_point cg_point, + enum dpni_queue_type qtype, + uint8_t tc, + uint8_t index, + struct dpni_taildrop *taildrop) { struct mc_command cmd = { 0 }; + struct dpni_cmd_get_taildrop *cmd_params; + struct dpni_rsp_get_taildrop *rsp_params; + uint8_t oal_lo, oal_hi; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TAILDROP, cmd_flags, token); - DPNI_CMD_GET_TAILDROP(cmd, cg_point, q_type, tc, q_index); + cmd_params = (struct dpni_cmd_get_taildrop *)cmd.params; + cmd_params->congestion_point = cg_point; + cmd_params->qtype = qtype; + cmd_params->tc = tc; + cmd_params->index = index; - /* send command to mc*/ + /* send command to mc */ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPNI_RSP_GET_TAILDROP(cmd, taildrop); + rsp_params = (struct dpni_rsp_get_taildrop *)cmd.params; + taildrop->enable = dpni_get_field(rsp_params->enable_oal_lo, ENABLE); + taildrop->units = rsp_params->units; + taildrop->threshold = le32_to_cpu(rsp_params->threshold); + oal_lo = dpni_get_field(rsp_params->enable_oal_lo, OAL_LO); + oal_hi = dpni_get_field(rsp_params->oal_hi, OAL_HI); + taildrop->oal = oal_hi << DPNI_OAL_LO_SIZE | oal_lo; + + /* Fill the first 4 bits, 'oal' is a 2's complement value of 12 bits */ + if (taildrop->oal >= 0x0800) + taildrop->oal |= 0xF000; return 0; } diff --git a/drivers/net/dpaa2/mc/fsl_dpkg.h b/drivers/net/dpaa2/mc/fsl_dpkg.h index 2391e40..7f46baf 100644 --- a/drivers/net/dpaa2/mc/fsl_dpkg.h +++ b/drivers/net/dpaa2/mc/fsl_dpkg.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2015 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -93,6 +93,15 @@ struct dpkg_mask { uint8_t offset; }; +/* Macros for accessing command fields smaller than 1byte */ +#define DPKG_MASK(field) \ + GENMASK(DPKG_##field##_SHIFT + DPKG_##field##_SIZE - 1, \ + DPKG_##field##_SHIFT) +#define dpkg_set_field(var, field, val) \ + ((var) |= (((val) << DPKG_##field##_SHIFT) & DPKG_MASK(field))) +#define dpkg_get_field(var, field) \ + (((var) & DPKG_MASK(field)) >> DPKG_##field##_SHIFT) + /** * struct dpkg_extract - A structure for defining a single extraction * @type: Determines how the union below is interpreted: @@ -136,12 +145,12 @@ struct dpkg_extract { */ struct { - enum net_prot prot; + enum net_prot prot; enum dpkg_extract_from_hdr_type type; - uint32_t field; - uint8_t size; - uint8_t offset; - uint8_t hdr_index; + uint32_t field; + uint8_t size; + uint8_t offset; + uint8_t hdr_index; } from_hdr; /** * struct from_data @@ -166,8 +175,8 @@ struct dpkg_extract { } from_parse; } extract; - uint8_t num_of_byte_masks; - struct dpkg_mask masks[DPKG_NUM_OF_MASKS]; + uint8_t num_of_byte_masks; + struct dpkg_mask masks[DPKG_NUM_OF_MASKS]; }; /** @@ -181,4 +190,48 @@ struct dpkg_profile_cfg { struct dpkg_extract extracts[DPKG_MAX_NUM_OF_EXTRACTS]; }; +/* dpni_set_rx_tc_dist extension (structure of the DMA-able memory at + * key_cfg_iova) + */ +struct dpni_mask_cfg { + uint8_t mask; + uint8_t offset; +}; + +#define DPKG_EFH_TYPE_SHIFT 0 +#define DPKG_EFH_TYPE_SIZE 4 +#define DPKG_EXTRACT_TYPE_SHIFT 0 +#define DPKG_EXTRACT_TYPE_SIZE 4 + +struct dpni_dist_extract { + /* word 0 */ + uint8_t prot; + /* EFH type stored in the 4 least significant bits */ + uint8_t efh_type; + uint8_t size; + uint8_t offset; + uint32_t field; + /* word 1 */ + uint8_t hdr_index; + uint8_t constant; + uint8_t num_of_repeats; + uint8_t num_of_byte_masks; + /* Extraction type is stored in the 4 LSBs */ + uint8_t extract_type; + uint8_t pad[3]; + /* word 2 */ + struct dpni_mask_cfg masks[4]; +}; + +struct dpni_ext_set_rx_tc_dist { + /* extension word 0 */ + uint8_t num_extracts; + uint8_t pad[7]; + /* words 1..25 */ + struct dpni_dist_extract extracts[10]; +}; + +int dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, + uint8_t *key_cfg_buf); + #endif /* __FSL_DPKG_H_ */ diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h index 64db70d..092d3b3 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni.h +++ b/drivers/net/dpaa2/mc/fsl_dpni.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -110,47 +110,19 @@ struct fsl_mc_io; */ #define DPNI_OPT_NO_FS 0x000020 -/** - * dpni_open() - Open a control session for the specified object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @dpni_id: DPNI unique ID - * @token: Returned token; use in subsequent API calls - * - * This function can be used to open a control session for an - * already created object; an object may have been declared in - * the DPL or by calling the dpni_create() function. - * This function returns a unique authentication token, - * associated with the specific object ID and the specific MC - * portal; this token must be used in all subsequent commands for - * this specific object. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpni_id, - uint16_t *token); +int dpni_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpni_id, + uint16_t *token); -/** - * dpni_close() - Close the control session of the object - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * - * After this function is called, no further operations are - * allowed on the object without opening a new control session. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpni_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpni_cfg - Structure representing DPNI configuration - * @mac_addr: Primary MAC address - * @adv: Advanced parameters; default is all zeros; + * @mac_addr: Primary MAC address + * @adv: Advanced parameters; default is all zeros; * use this structure to change default settings */ struct dpni_cfg { @@ -217,141 +189,62 @@ struct dpni_cfg { uint8_t qos_entries; }; -/** - * dpni_create() - Create the DPNI object - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @cfg: Configuration structure - * @obj_id: returned object id - * - * Create the DPNI object, allocate required resources and - * perform required initialization. - * - * The object can be created either by declaring it in the - * DPL file, or by calling this function. - * - * The function accepts an authentication token of a parent - * container that this object should be assigned to. The token - * can be '0' so the object will be assigned to the default container. - * The newly created object can be opened with the returned - * object id and using the container's associated tokens and MC portals. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpni_cfg *cfg, - uint32_t *obj_id); +int dpni_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpni_cfg *cfg, + uint32_t *obj_id); -/** - * dpni_destroy() - Destroy the DPNI object and release all its resources. - * @mc_io: Pointer to MC portal's I/O object - * @dprc_token: Parent container token; '0' for default container - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @object_id: The object id; it must be a valid id within the container that - * created this object; - * - * The function accepts the authentication token of the parent container that - * created the object (not the one that currently owns the object). The object - * is searched within parent using the provided 'object_id'. - * All tokens to the object must be closed before calling destroy. - * - * Return: '0' on Success; error code otherwise. - */ -int dpni_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id); +int dpni_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id); /** * struct dpni_pools_cfg - Structure representing buffer pools configuration - * @num_dpbp: Number of DPBPs - * @pools: Array of buffer pools parameters; The number of valid entries - * must match 'num_dpbp' value + * @num_dpbp: Number of DPBPs + * @pools: Array of buffer pools parameters; The number of valid entries + * must match 'num_dpbp' value */ struct dpni_pools_cfg { - uint8_t num_dpbp; + uint8_t num_dpbp; /** * struct pools - Buffer pools parameters * @dpbp_id: DPBP object ID + * @priority: priority mask that indicates TC's used with this buffer. + * I set to 0x00 MC will assume value 0xff. * @buffer_size: Buffer size * @backup_pool: Backup pool */ struct { int dpbp_id; + uint8_t priority_mask; uint16_t buffer_size; int backup_pool; } pools[DPNI_MAX_DPBP]; }; -/** - * dpni_set_pools() - Set buffer pools configuration - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @cfg: Buffer pools configuration - * - * mandatory for DPNI operation - * warning:Allowed only when DPNI is disabled - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_pools(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - const struct dpni_pools_cfg *cfg); +int dpni_set_pools(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const struct dpni_pools_cfg *cfg); -/** - * dpni_enable() - Enable the DPNI, allow sending and receiving frames. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpni_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpni_disable() - Disable the DPNI, stop sending and receiving frames. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpni_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpni_is_enabled() - Check if the DPNI is enabled. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @en: Returns '1' if object is enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_is_enabled(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); +int dpni_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); -/** - * dpni_reset() - Reset the DPNI, returns the object to initial state. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpni_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpni_attr - Structure representing DPNI attributes @@ -363,7 +256,8 @@ int dpni_reset(struct fsl_mc_io *mc_io, * DPNI_OPT_HAS_KEY_MASKING * DPNI_OPT_NO_FS * @num_queues: Number of Tx and Rx queues used for traffic distribution. - * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. + * @num_rx_tcs: Number of RX traffic classes (TCs), reserved for the DPNI. + * @num_tx_tcs: Number of TX traffic classes (TCs), reserved for the DPNI. * @mac_filter_entries: Number of entries in the MAC address filtering * table. * @vlan_filter_entries: Number of entries in the VLAN address filtering @@ -390,7 +284,8 @@ int dpni_reset(struct fsl_mc_io *mc_io, struct dpni_attr { uint32_t options; uint8_t num_queues; - uint8_t num_tcs; + uint8_t num_rx_tcs; + uint8_t num_tx_tcs; uint8_t mac_filter_entries; uint8_t vlan_filter_entries; uint8_t qos_entries; @@ -400,19 +295,10 @@ struct dpni_attr { uint16_t wriop_version; }; -/** - * dpni_get_attributes() - Retrieve DPNI attributes. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @attr: Object's attributes - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpni_attr *attr); +int dpni_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpni_attr *attr); /** * DPNI errors @@ -457,33 +343,22 @@ enum dpni_error_action { /** * struct dpni_error_cfg - Structure representing DPNI errors treatment - * @errors: Errors mask; use 'DPNI_ERROR__ - * @error_action: The desired action for the errors mask - * @set_frame_annotation: Set to '1' to mark the errors in frame annotation - * status (FAS); relevant only for the non-discard action + * @errors: Errors mask; use 'DPNI_ERROR__ + * @error_action: The desired action for the errors mask + * @set_frame_annotation: Set to '1' to mark the errors in frame + * annotation status (FAS); relevant only + * for the non-discard action */ struct dpni_error_cfg { - uint32_t errors; - enum dpni_error_action error_action; - int set_frame_annotation; + uint32_t errors; + enum dpni_error_action error_action; + int set_frame_annotation; }; -/** - * dpni_set_errors_behavior() - Set errors behavior - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @cfg: Errors configuration - * - * this function may be called numerous times with different - * error masks - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpni_error_cfg *cfg); +int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpni_error_cfg *cfg); /** * DPNI buffer layout modification options @@ -520,25 +395,26 @@ int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, /** * struct dpni_buffer_layout - Structure representing DPNI buffer layout - * @options: Flags representing the suggested modifications to the buffer - * layout; Use any combination of 'DPNI_BUF_LAYOUT_OPT_' flags - * @pass_timestamp: Pass timestamp value - * @pass_parser_result: Pass parser results - * @pass_frame_status: Pass frame status - * @private_data_size: Size kept for private data (in bytes) - * @data_align: Data alignment - * @data_head_room: Data head room - * @data_tail_room: Data tail room + * @options: Flags representing the suggested modifications to the + * buffer layout; + * Use any combination of 'DPNI_BUF_LAYOUT_OPT_' flags + * @pass_timestamp: Pass timestamp value + * @pass_parser_result: Pass parser results + * @pass_frame_status: Pass frame status + * @private_data_size: Size kept for private data (in bytes) + * @data_align: Data alignment + * @data_head_room: Data head room + * @data_tail_room: Data tail room */ struct dpni_buffer_layout { - uint32_t options; - int pass_timestamp; - int pass_parser_result; - int pass_frame_status; - uint16_t private_data_size; - uint16_t data_align; - uint16_t data_head_room; - uint16_t data_tail_room; + uint32_t options; + int pass_timestamp; + int pass_parser_result; + int pass_frame_status; + uint16_t private_data_size; + uint16_t data_align; + uint16_t data_head_room; + uint16_t data_tail_room; }; /** @@ -547,45 +423,24 @@ struct dpni_buffer_layout { * @DPNI_QUEUE_TX: Tx queue * @DPNI_QUEUE_TX_CONFIRM: Tx confirmation queue * @DPNI_QUEUE_RX_ERR: Rx error queue - */enum dpni_queue_type { + */ +enum dpni_queue_type { DPNI_QUEUE_RX, DPNI_QUEUE_TX, DPNI_QUEUE_TX_CONFIRM, DPNI_QUEUE_RX_ERR, }; -/** - * dpni_get_buffer_layout() - Retrieve buffer layout attributes. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue to get the layout from - * @layout: Returns buffer layout attributes - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, - struct dpni_buffer_layout *layout); +int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_queue_type qtype, + struct dpni_buffer_layout *layout); -/** - * dpni_set_buffer_layout() - Set buffer layout configuration. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue to set layout on - * @layout: Buffer layout configuration - * - * Return: '0' on Success; Error code otherwise. - * - * @warning Allowed only when DPNI is disabled - */ -int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, +int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_queue_type qtype, const struct dpni_buffer_layout *layout); /** @@ -594,72 +449,39 @@ int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, * @DPNI_OFF_RX_L4_CSUM: Rx L4 checksum validation * @DPNI_OFF_TX_L3_CSUM: Tx L3 checksum generation * @DPNI_OFF_TX_L4_CSUM: Tx L4 checksum generation + * @DPNI_OPT_FLCTYPE_HASH: flow context will be generated by WRIOP for AIOP or + * for CPU */ enum dpni_offload { DPNI_OFF_RX_L3_CSUM, DPNI_OFF_RX_L4_CSUM, DPNI_OFF_TX_L3_CSUM, DPNI_OFF_TX_L4_CSUM, + DPNI_FLCTYPE_HASH, }; -/** - * dpni_set_offload() - Set DPNI offload configuration. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @type: Type of DPNI offload - * @config: Offload configuration. - * For checksum offloads, non-zero value enables - * the offload. - * - * Return: '0' on Success; Error code otherwise. - * - * @warning Allowed only when DPNI is disabled - */ int dpni_set_offload(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, enum dpni_offload type, uint32_t config); -/** - * dpni_get_offload() - Get DPNI offload configuration. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @type: Type of DPNI offload - * @config: Offload configuration. - * For checksum offloads, a value of 1 indicates that the - * offload is enabled. - * - * Return: '0' on Success; Error code otherwise. - * - * @warning Allowed only when DPNI is disabled - */ int dpni_get_offload(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, enum dpni_offload type, uint32_t *config); -/** - * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used - * for enqueue operations - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue to get QDID for. For applications lookig to - * transmit traffic this should be set to DPNI_QUEUE_TX - * @qdid: Returned virtual QDID value that should be used as an argument - * in all enqueue operations - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_qdid(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, - uint16_t *qdid); +int dpni_get_qdid(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_queue_type qtype, + uint16_t *qdid); + +int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *data_offset); #define DPNI_STATISTICS_CNT 7 @@ -715,6 +537,23 @@ union dpni_statistics { uint64_t egress_confirmed_frames; } page_2; /** + * struct page_3 - Page_3 statistics structure with values for the + * selected TC + * @ceetm_dequeue_bytes: Cumulative count of the number of bytes + * dequeued + * @ceetm_dequeue_frames: Cumulative count of the number of frames + * dequeued + * @ceetm_reject_bytes: Cumulative count of the number of bytes in all + * frames whose enqueue was rejected + * @ceetm_reject_frames: Cumulative count of all frame enqueues rejected + */ + struct { + uint64_t ceetm_dequeue_bytes; + uint64_t ceetm_dequeue_frames; + uint64_t ceetm_reject_bytes; + uint64_t ceetm_reject_frames; + } page_3; + /** * struct raw - raw statistics structure, used to index counters */ struct { @@ -738,6 +577,10 @@ union dpni_statistics { * Enable a-symmetric pause frames */ #define DPNI_LINK_OPT_ASYM_PAUSE 0x0000000000000008ULL +/** + * Enable priority flow control pause frames + */ +#define DPNI_LINK_OPT_PFC_PAUSE 0x0000000000000010ULL /** * struct - Structure representing DPNI link configuration @@ -749,278 +592,117 @@ struct dpni_link_cfg { uint64_t options; }; -/** - * dpni_set_link_cfg() - set the link configuration. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @cfg: Link configuration - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_link_cfg(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - const struct dpni_link_cfg *cfg); +int dpni_set_link_cfg(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const struct dpni_link_cfg *cfg); /** * struct dpni_link_state - Structure representing DPNI link state - * @rate: Rate - * @options: Mask of available options; use 'DPNI_LINK_OPT_' values - * @up: Link state; '0' for down, '1' for up + * @rate: Rate + * @options: Mask of available options; use 'DPNI_LINK_OPT_' values + * @up: Link state; '0' for down, '1' for up */ struct dpni_link_state { - uint32_t rate; - uint64_t options; - int up; + uint32_t rate; + uint64_t options; + int up; }; -/** - * dpni_get_link_state() - Return the link state (either up or down) - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @state: Returned link state; - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_link_state(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpni_link_state *state); - -/** - * dpni_set_max_frame_length() - Set the maximum received frame length. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @max_frame_length: Maximum received frame length (in - * bytes); frame is discarded if its - * length exceeds this value - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_max_frame_length(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint16_t max_frame_length); - -/** - * dpni_get_max_frame_length() - Get the maximum received frame length. - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @max_frame_length: Maximum received frame length (in - * bytes); frame is discarded if its - * length exceeds this value - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_max_frame_length(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint16_t *max_frame_length); - -/** - * dpni_set_multicast_promisc() - Enable/disable multicast promiscuous mode - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @en: Set to '1' to enable; '0' to disable - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int en); - -/** - * dpni_get_multicast_promisc() - Get multicast promiscuous mode - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @en: Returns '1' if enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); - -/** - * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @en: Set to '1' to enable; '0' to disable - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int en); - -/** - * dpni_get_unicast_promisc() - Get unicast promiscuous mode - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @en: Returns '1' if enabled; '0' otherwise - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int *en); - -/** - * dpni_set_primary_mac_addr() - Set the primary MAC address - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @mac_addr: MAC address to set as primary address - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - const uint8_t mac_addr[6]); - -/** - * dpni_get_primary_mac_addr() - Get the primary MAC address - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @mac_addr: Returned MAC address - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t mac_addr[6]); - -/** - * dpni_add_mac_addr() - Add MAC address filter - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @mac_addr: MAC address to add - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_add_mac_addr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - const uint8_t mac_addr[6]); - -/** - * dpni_remove_mac_addr() - Remove MAC address filter - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @mac_addr: MAC address to remove - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_remove_mac_addr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - const uint8_t mac_addr[6]); - -/** - * dpni_clear_mac_filters() - Clear all unicast and/or multicast MAC filters - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @unicast: Set to '1' to clear unicast addresses - * @multicast: Set to '1' to clear multicast addresses - * - * The primary MAC address is not cleared by this operation. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_clear_mac_filters(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int unicast, - int multicast); - -/** - * dpni_get_port_mac_addr() - Retrieve MAC address associated to the physical - * port the DPNI is attached to - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @mac_addr: MAC address of the physical port, if any, otherwise 0 - * - * The primary MAC address is not modified by this operation. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t mac_addr[6]); - -/** - * dpni_enable_vlan_filter() - Enable/disable VLAN filtering mode - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @en: Set to '1' to enable; '0' to disable - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - int en); +int dpni_get_link_state(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpni_link_state *state); + +int dpni_set_max_frame_length(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t max_frame_length); + +int dpni_get_max_frame_length(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *max_frame_length); + +int dpni_set_mtu(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t mtu); + +int dpni_get_mtu(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *mtu); + +int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int en); + +int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); + +int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int en); + +int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); + +int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const uint8_t mac_addr[6]); + +int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t mac_addr[6]); + +int dpni_add_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const uint8_t mac_addr[6]); -/** - * dpni_add_vlan_id() - Add VLAN ID filter - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @vlan_id: VLAN ID to add - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_add_vlan_id(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint16_t vlan_id); +int dpni_remove_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const uint8_t mac_addr[6]); + +int dpni_clear_mac_filters(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int unicast, + int multicast); + +int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t mac_addr[6]); + +int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int en); + +int dpni_add_vlan_id(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t vlan_id); -/** - * dpni_remove_vlan_id() - Remove VLAN ID filter - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @vlan_id: VLAN ID to remove - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_remove_vlan_id(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint16_t vlan_id); +int dpni_remove_vlan_id(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t vlan_id); -/** - * dpni_clear_vlan_filters() - Clear all VLAN filters - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * enum dpni_dist_mode - DPNI distribution mode @@ -1050,27 +732,16 @@ enum dpni_fs_miss_action { /** * struct dpni_fs_tbl_cfg - Flow Steering table configuration - * @miss_action: Miss action selection - * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID' + * @miss_action: Miss action selection + * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID' */ struct dpni_fs_tbl_cfg { - enum dpni_fs_miss_action miss_action; - uint16_t default_flow_id; + enum dpni_fs_miss_action miss_action; + uint16_t default_flow_id; + char keep_hash_key; }; /** - * dpni_prepare_key_cfg() - function prepare extract parameters - * @cfg: defining a full Key Generation profile (rule) - * @key_cfg_buf: Zeroed 256 bytes of memory before mapping it to DMA - * - * This function has to be called before the following functions: - * - dpni_set_rx_tc_dist() - * - dpni_set_qos_table() - */ -int dpni_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, - uint8_t *key_cfg_buf); - -/** * struct dpni_rx_tc_dist_cfg - Rx traffic class distribution configuration * @dist_size: Set the distribution size; * supported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96, @@ -1078,36 +749,24 @@ int dpni_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, * @dist_mode: Distribution mode * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with * the extractions to be used for the distribution key by calling - * dpni_prepare_key_cfg() relevant only when + * dpkg_prepare_key_cfg() relevant only when * 'dist_mode != DPNI_DIST_MODE_NONE', otherwise it can be '0' * @fs_cfg: Flow Steering table configuration; only relevant if * 'dist_mode = DPNI_DIST_MODE_FS' */ struct dpni_rx_tc_dist_cfg { - uint16_t dist_size; - enum dpni_dist_mode dist_mode; - uint64_t key_cfg_iova; - struct dpni_fs_tbl_cfg fs_cfg; + uint16_t dist_size; + enum dpni_dist_mode dist_mode; + uint64_t key_cfg_iova; + struct dpni_fs_tbl_cfg fs_cfg; }; -/** - * dpni_set_rx_tc_dist() - Set Rx traffic class distribution configuration - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @tc_id: Traffic class selection (0-7) - * @cfg: Traffic class distribution configuration - * - * warning: if 'dist_mode != DPNI_DIST_MODE_NONE', call dpni_prepare_key_cfg() - * first to prepare the key_cfg_iova parameter - * - * Return: '0' on Success; error code otherwise. - */ -int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t tc_id, - const struct dpni_rx_tc_dist_cfg *cfg); +int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc_id, + const struct dpni_rx_tc_dist_cfg *cfg); + /** * enum dpni_congestion_unit - DPNI congestion units * @DPNI_CONGESTION_UNIT_BYTES: bytes units @@ -1147,9 +806,9 @@ enum dpni_dest { * channel; not relevant for 'DPNI_DEST_NONE' option */ struct dpni_dest_cfg { - enum dpni_dest dest_type; - int dest_id; - uint8_t priority; + enum dpni_dest dest_type; + int dest_id; + uint8_t priority; }; /* DPNI congestion options */ @@ -1186,6 +845,11 @@ struct dpni_dest_cfg { * sw-portal's DQRR, the DQRI interrupt is asserted immediately (if enabled) */ #define DPNI_CONG_OPT_INTR_COALESCING_DISABLED 0x00000020 +/** + * This congestion will trigger flow control or priority flow control. This + * will have effect only if flow control is enabled with dpni_set_link_cfg() + */ +#define DPNI_CONG_OPT_FLOW_CONTROL 0x00000040 /** * struct dpni_congestion_notification_cfg - congestion notification @@ -1203,54 +867,35 @@ struct dpni_dest_cfg { */ struct dpni_congestion_notification_cfg { - enum dpni_congestion_unit units; - uint32_t threshold_entry; - uint32_t threshold_exit; - uint64_t message_ctx; - uint64_t message_iova; - struct dpni_dest_cfg dest_cfg; - uint16_t notification_mode; + enum dpni_congestion_unit units; + uint32_t threshold_entry; + uint32_t threshold_exit; + uint64_t message_ctx; + uint64_t message_iova; + struct dpni_dest_cfg dest_cfg; + uint16_t notification_mode; }; -/** - * dpni_set_congestion_notification() - Set traffic class congestion - * notification configuration - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue - Rx, Tx and Tx confirm types are supported - * @tc_id: Traffic class selection (0-7) - * @cfg: congestion notification configuration - * - * Return: '0' on Success; error code otherwise. - */ -int dpni_set_congestion_notification( - struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, - uint8_t tc_id, +int dpni_set_congestion_notification(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_queue_type qtype, + uint8_t tc_id, const struct dpni_congestion_notification_cfg *cfg); -/** - * dpni_get_congestion_notification() - Get traffic class congestion - * notification configuration - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue - Rx, Tx and Tx confirm types are supported - * @tc_id: Traffic class selection (0-7) - * @cfg: congestion notification configuration - * - * Return: '0' on Success; error code otherwise. - */ -int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_queue_type qtype, - uint8_t tc_id, +int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_queue_type qtype, + uint8_t tc_id, struct dpni_congestion_notification_cfg *cfg); +/* DPNI FLC stash options */ + +/** + * stashes the whole annotation area (up to 192 bytes) + */ +#define DPNI_FLC_STASH_FRAME_ANNOTATION 0x00000001 /** * struct dpni_queue - Queue structure @@ -1291,9 +936,25 @@ struct dpni_queue { uint64_t user_context; /** * struct flc - FD FLow Context structure - * @value: FLC value to set - * @stash_control: Boolean, indicates whether the 6 lowest - * significant bits are used for stash control. + * @value: Default FLC value for traffic dequeued from + * this queue. Please check description of FD + * structure for more information. + * Note that FLC values set using dpni_add_fs_entry, + * if any, take precedence over values per queue. + * @stash_control: Boolean, indicates whether the 6 lowest + * - significant bits are used for stash control. + * significant bits are used for stash control. If set, the 6 + * least significant bits in value are interpreted as follows: + * - bits 0-1: indicates the number of 64 byte units of context + * that are stashed. FLC value is interpreted as a memory address + * in this case, excluding the 6 LS bits. + * - bits 2-3: indicates the number of 64 byte units of frame + * annotation to be stashed. Annotation is placed at FD[ADDR]. + * - bits 4-5: indicates the number of 64 byte units of frame + * data to be stashed. Frame data is placed at FD[ADDR] + + * FD[OFFSET]. + * For more details check the Frame Descriptor section in the + * hardware documentation. */ struct { uint64_t value; @@ -1331,41 +992,16 @@ enum dpni_confirmation_mode { DPNI_CONF_DISABLE, }; -/** - * dpni_set_tx_confirmation_mode() - Tx confirmation mode - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @mode: Tx confirmation mode - * - * This function is useful only when 'DPNI_OPT_TX_CONF_DISABLED' is not - * selected at DPNI creation. - * Calling this function with 'mode' set to DPNI_CONF_DISABLE disables all - * transmit confirmation (including the private confirmation queues), regardless - * of previous settings; Note that in this case, Tx error frames are still - * enqueued to the general transmit errors queue. - * Calling this function with 'mode' set to DPNI_CONF_SINGLE switches all - * Tx confirmations to a shared Tx conf queue. The ID of the queue when - * calling dpni_set/get_queue is -1. - * Tx confirmation mode can only be changed while the DPNI is disabled. - * Executing this command while the DPNI is enabled will return an error. - * - * Return: '0' on Success; Error code otherwise. - */ -int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - enum dpni_confirmation_mode mode); +int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_confirmation_mode mode); + +int dpni_get_tx_confirmation_mode(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + enum dpni_confirmation_mode *mode); -/** - * dpni_get_api_version() - Get Data Path Network Interface API version - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @major_ver: Major version of data path network interface API - * @minor_ver: Minor version of data path network interface API - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, @@ -1396,23 +1032,6 @@ int dpni_get_api_version(struct fsl_mc_io *mc_io, */ #define DPNI_QUEUE_OPT_HOLD_ACTIVE 0x00000008 -/** - * dpni_set_queue() - Set queue parameters - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue - all queue types are supported, although - * the command is ignored for Tx - * @tc: Traffic class, in range 0 to NUM_TCS - 1 - * @index: Selects the specific queue out of the set - * allocated for the same TC.Value must be in - * range 0 to NUM_QUEUES - 1 - * @options: A combination of DPNI_QUEUE_OPT_ values that control - * what configuration options are set on the queue - * @queue: Queue configuration structure - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_set_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -1422,31 +1041,6 @@ int dpni_set_queue(struct fsl_mc_io *mc_io, uint8_t options, const struct dpni_queue *queue); -/** - * dpni_get_queue() - Get queue parameters - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @qtype: Type of queue - all queue types are supported - * @tc: Traffic class, in range 0 to NUM_TCS - 1 - * @index: Selects the specific queue out of the set allocated - * for the same TC. Value must be in range 0 to - * NUM_QUEUES - 1 - * @queue: Queue configuration structure - * @qid: Queue identification - * - * This function returns current queue configuration which can be changed by - * calling dpni_set_queue, and queue identification information. - * Returned qid.fqid and/or qid.qdbin values can be used to: - * - enqueue traffic for Tx queues, - * - perform volatile dequeue for Rx and, if applicable, Tx confirmation - * clean-up, - * - retrieve queue state. - * - * All these operations are supported through the DPIO run-time API. - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_get_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -1456,32 +1050,13 @@ int dpni_get_queue(struct fsl_mc_io *mc_io, struct dpni_queue *queue, struct dpni_queue_id *qid); -/** - * dpni_get_statistics() - Get DPNI statistics - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @page: Selects the statistics page to retrieve, see - * DPNI_GET_STATISTICS output. - * Pages are numbered 0 to 2. - * @stat: Structure containing the statistics - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_get_statistics(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, uint8_t page, + uint8_t param, union dpni_statistics *stat); -/** - * dpni_reset_statistics() - Clears DPNI statistics - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_reset_statistics(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token); @@ -1505,40 +1080,25 @@ enum dpni_congestion_point { * struct dpni_taildrop - Structure representing the taildrop * @enable: Indicates whether the taildrop is active or not. * @units: Indicates the unit of THRESHOLD. Queue taildrop only - * supports byte units, this field is ignored and - * assumed = 0 if CONGESTION_POINT is 0. + * supports byte units, this field is ignored and + * assumed = 0 if CONGESTION_POINT is 0. * @threshold: Threshold value, in units identified by UNITS field. Value 0 - * cannot be used as a valid taildrop threshold, - * THRESHOLD must be > 0 if the taildrop is - * enabled. + * cannot be used as a valid taildrop threshold, + * THRESHOLD must be > 0 if the taildrop is + * enabled. + * @oal : Overhead Accounting Length, a 12-bit, 2's complement value + * with range (-2048 to +2047) representing a fixed per-frame + * overhead to be added to the actual length of a frame when + * performing WRED and tail drop calculations and threshold + * comparisons. */ struct dpni_taildrop { char enable; enum dpni_congestion_unit units; uint32_t threshold; + int16_t oal; }; -/** - * dpni_set_taildrop() - Set taildrop per queue or TC - * - * Setting a per-TC taildrop (cg_point = DPNI_CP_GROUP) will reset any current - * congestion notification or early drop (WRED) configuration previously applied - * to the same TC. - * - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @cg_point: Congestion point. DPNI_CP_QUEUE is only supported in - * combination with DPNI_QUEUE_RX. - * @q_type: Queue type, can be DPNI_QUEUE_RX or DPNI_QUEUE_TX. - * @tc: Traffic class to apply this taildrop to - * @q_index: Index of the queue if the DPNI supports multiple queues for - * traffic distribution. - * Ignored if CONGESTION_POINT is not DPNI_CP_QUEUE. - * @taildrop: Taildrop structure - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_set_taildrop(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, @@ -1548,21 +1108,6 @@ int dpni_set_taildrop(struct fsl_mc_io *mc_io, uint8_t q_index, struct dpni_taildrop *taildrop); -/** - * dpni_get_taildrop() - Get taildrop information - * @mc_io: Pointer to MC portal's I/O object - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' - * @token: Token of DPNI object - * @cg_point: Congestion point - * @q_type: - * @tc: Traffic class to apply this taildrop to - * @q_index: Index of the queue if the DPNI supports multiple queues for - * traffic distribution. Ignored if CONGESTION_POINT - * is not 0. - * @taildrop: Taildrop structure - * - * Return: '0' on Success; Error code otherwise. - */ int dpni_get_taildrop(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h index 2ac397c..81226aa 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -42,435 +42,547 @@ /* DPNI Version */ #define DPNI_VER_MAJOR 7 -#define DPNI_VER_MINOR 0 +#define DPNI_VER_MINOR 3 + +#define DPNI_CMD_BASE_VERSION 1 +#define DPNI_CMD_VERSION_2 2 +#define DPNI_CMD_ID_OFFSET 4 + +#define DPNI_CMD(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION) +#define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2) /* Command IDs */ -#define DPNI_CMDID_OPEN ((0x801 << 4) | (0x1)) -#define DPNI_CMDID_CLOSE ((0x800 << 4) | (0x1)) -#define DPNI_CMDID_CREATE ((0x901 << 4) | (0x1)) -#define DPNI_CMDID_DESTROY ((0x981 << 4) | (0x1)) -#define DPNI_CMDID_GET_API_VERSION ((0xa01 << 4) | (0x1)) - -#define DPNI_CMDID_ENABLE ((0x002 << 4) | (0x1)) -#define DPNI_CMDID_DISABLE ((0x003 << 4) | (0x1)) -#define DPNI_CMDID_GET_ATTR ((0x004 << 4) | (0x1)) -#define DPNI_CMDID_RESET ((0x005 << 4) | (0x1)) -#define DPNI_CMDID_IS_ENABLED ((0x006 << 4) | (0x1)) - -#define DPNI_CMDID_SET_POOLS ((0x200 << 4) | (0x1)) -#define DPNI_CMDID_SET_ERRORS_BEHAVIOR ((0x20B << 4) | (0x1)) - -#define DPNI_CMDID_GET_QDID ((0x210 << 4) | (0x1)) -#define DPNI_CMDID_GET_LINK_STATE ((0x215 << 4) | (0x1)) -#define DPNI_CMDID_SET_MAX_FRAME_LENGTH ((0x216 << 4) | (0x1)) -#define DPNI_CMDID_GET_MAX_FRAME_LENGTH ((0x217 << 4) | (0x1)) -#define DPNI_CMDID_SET_LINK_CFG ((0x21a << 4) | (0x1)) - -#define DPNI_CMDID_SET_MCAST_PROMISC ((0x220 << 4) | (0x1)) -#define DPNI_CMDID_GET_MCAST_PROMISC ((0x221 << 4) | (0x1)) -#define DPNI_CMDID_SET_UNICAST_PROMISC ((0x222 << 4) | (0x1)) -#define DPNI_CMDID_GET_UNICAST_PROMISC ((0x223 << 4) | (0x1)) -#define DPNI_CMDID_SET_PRIM_MAC ((0x224 << 4) | (0x1)) -#define DPNI_CMDID_GET_PRIM_MAC ((0x225 << 4) | (0x1)) -#define DPNI_CMDID_ADD_MAC_ADDR ((0x226 << 4) | (0x1)) -#define DPNI_CMDID_REMOVE_MAC_ADDR ((0x227 << 4) | (0x1)) -#define DPNI_CMDID_CLR_MAC_FILTERS ((0x228 << 4) | (0x1)) - -#define DPNI_CMDID_ENABLE_VLAN_FILTER ((0x230 << 4) | (0x1)) -#define DPNI_CMDID_ADD_VLAN_ID ((0x231 << 4) | (0x1)) -#define DPNI_CMDID_REMOVE_VLAN_ID ((0x232 << 4) | (0x1)) -#define DPNI_CMDID_CLR_VLAN_FILTERS ((0x233 << 4) | (0x1)) - -#define DPNI_CMDID_SET_RX_TC_DIST ((0x235 << 4) | (0x1)) - -#define DPNI_CMDID_GET_STATISTICS ((0x25D << 4) | (0x1)) -#define DPNI_CMDID_RESET_STATISTICS ((0x25E << 4) | (0x1)) -#define DPNI_CMDID_GET_QUEUE ((0x25F << 4) | (0x1)) -#define DPNI_CMDID_SET_QUEUE ((0x260 << 4) | (0x1)) -#define DPNI_CMDID_GET_TAILDROP ((0x261 << 4) | (0x1)) -#define DPNI_CMDID_SET_TAILDROP ((0x262 << 4) | (0x1)) - -#define DPNI_CMDID_GET_PORT_MAC_ADDR ((0x263 << 4) | (0x1)) - -#define DPNI_CMDID_GET_BUFFER_LAYOUT ((0x264 << 4) | (0x1)) -#define DPNI_CMDID_SET_BUFFER_LAYOUT ((0x265 << 4) | (0x1)) - -#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION ((0x267 << 4) | (0x1)) -#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION ((0x268 << 4) | (0x1)) -#define DPNI_CMDID_GET_OFFLOAD ((0x26B << 4) | (0x1)) -#define DPNI_CMDID_SET_OFFLOAD ((0x26C << 4) | (0x1)) -#define DPNI_CMDID_SET_TX_CONFIRMATION_MODE ((0x266 << 4) | (0x1)) -#define DPNI_CMDID_GET_TX_CONFIRMATION_MODE ((0x26D << 4) | (0x1)) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_OPEN(cmd, dpni_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpni_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_CREATE(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, (cfg)->options); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, (cfg)->num_queues); \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, (cfg)->num_tcs); \ - MC_CMD_OP(cmd, 0, 48, 8, uint8_t, (cfg)->mac_filter_entries); \ - MC_CMD_OP(cmd, 1, 0, 8, uint8_t, (cfg)->vlan_filter_entries); \ - MC_CMD_OP(cmd, 1, 16, 8, uint8_t, (cfg)->qos_entries); \ - MC_CMD_OP(cmd, 1, 32, 16, uint16_t, (cfg)->fs_entries); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_POOLS(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->num_dpbp); \ - MC_CMD_OP(cmd, 0, 8, 1, int, cfg->pools[0].backup_pool); \ - MC_CMD_OP(cmd, 0, 9, 1, int, cfg->pools[1].backup_pool); \ - MC_CMD_OP(cmd, 0, 10, 1, int, cfg->pools[2].backup_pool); \ - MC_CMD_OP(cmd, 0, 11, 1, int, cfg->pools[3].backup_pool); \ - MC_CMD_OP(cmd, 0, 12, 1, int, cfg->pools[4].backup_pool); \ - MC_CMD_OP(cmd, 0, 13, 1, int, cfg->pools[5].backup_pool); \ - MC_CMD_OP(cmd, 0, 14, 1, int, cfg->pools[6].backup_pool); \ - MC_CMD_OP(cmd, 0, 15, 1, int, cfg->pools[7].backup_pool); \ - MC_CMD_OP(cmd, 0, 32, 32, int, cfg->pools[0].dpbp_id); \ - MC_CMD_OP(cmd, 4, 32, 16, uint16_t, cfg->pools[0].buffer_size);\ - MC_CMD_OP(cmd, 1, 0, 32, int, cfg->pools[1].dpbp_id); \ - MC_CMD_OP(cmd, 4, 48, 16, uint16_t, cfg->pools[1].buffer_size);\ - MC_CMD_OP(cmd, 1, 32, 32, int, cfg->pools[2].dpbp_id); \ - MC_CMD_OP(cmd, 5, 0, 16, uint16_t, cfg->pools[2].buffer_size);\ - MC_CMD_OP(cmd, 2, 0, 32, int, cfg->pools[3].dpbp_id); \ - MC_CMD_OP(cmd, 5, 16, 16, uint16_t, cfg->pools[3].buffer_size);\ - MC_CMD_OP(cmd, 2, 32, 32, int, cfg->pools[4].dpbp_id); \ - MC_CMD_OP(cmd, 5, 32, 16, uint16_t, cfg->pools[4].buffer_size);\ - MC_CMD_OP(cmd, 3, 0, 32, int, cfg->pools[5].dpbp_id); \ - MC_CMD_OP(cmd, 5, 48, 16, uint16_t, cfg->pools[5].buffer_size);\ - MC_CMD_OP(cmd, 3, 32, 32, int, cfg->pools[6].dpbp_id); \ - MC_CMD_OP(cmd, 6, 0, 16, uint16_t, cfg->pools[6].buffer_size);\ - MC_CMD_OP(cmd, 4, 0, 32, int, cfg->pools[7].dpbp_id); \ - MC_CMD_OP(cmd, 6, 16, 16, uint16_t, cfg->pools[7].buffer_size);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_IS_ENABLED(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* DPNI_CMD_GET_ATTR is not used, no input parameters */ - -#define DPNI_RSP_GET_ATTR(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, (attr)->options); \ - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, (attr)->num_queues); \ - MC_RSP_OP(cmd, 0, 40, 8, uint8_t, (attr)->num_tcs); \ - MC_RSP_OP(cmd, 0, 48, 8, uint8_t, (attr)->mac_filter_entries); \ - MC_RSP_OP(cmd, 1, 0, 8, uint8_t, (attr)->vlan_filter_entries); \ - MC_RSP_OP(cmd, 1, 16, 8, uint8_t, (attr)->qos_entries); \ - MC_RSP_OP(cmd, 1, 32, 16, uint16_t, (attr)->fs_entries); \ - MC_RSP_OP(cmd, 2, 0, 8, uint8_t, (attr)->qos_key_size); \ - MC_RSP_OP(cmd, 2, 8, 8, uint8_t, (attr)->fs_key_size); \ - MC_RSP_OP(cmd, 2, 16, 16, uint16_t, (attr)->wriop_version); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, cfg->errors); \ - MC_CMD_OP(cmd, 0, 32, 4, enum dpni_error_action, cfg->error_action); \ - MC_CMD_OP(cmd, 0, 36, 1, int, cfg->set_frame_annotation); \ -} while (0) - -#define DPNI_CMD_GET_BUFFER_LAYOUT(cmd, qtype) \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype) - -#define DPNI_RSP_GET_BUFFER_LAYOUT(cmd, layout) \ -do { \ - MC_RSP_OP(cmd, 0, 48, 1, char, (layout)->pass_timestamp); \ - MC_RSP_OP(cmd, 0, 49, 1, char, (layout)->pass_parser_result); \ - MC_RSP_OP(cmd, 0, 50, 1, char, (layout)->pass_frame_status); \ - MC_RSP_OP(cmd, 1, 0, 16, uint16_t, (layout)->private_data_size); \ - MC_RSP_OP(cmd, 1, 16, 16, uint16_t, (layout)->data_align); \ - MC_RSP_OP(cmd, 1, 32, 16, uint16_t, (layout)->data_head_room); \ - MC_RSP_OP(cmd, 1, 48, 16, uint16_t, (layout)->data_tail_room); \ -} while (0) - -#define DPNI_CMD_SET_BUFFER_LAYOUT(cmd, qtype, layout) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype); \ - MC_CMD_OP(cmd, 0, 32, 16, uint16_t, (layout)->options); \ - MC_CMD_OP(cmd, 0, 48, 1, char, (layout)->pass_timestamp); \ - MC_CMD_OP(cmd, 0, 49, 1, char, (layout)->pass_parser_result); \ - MC_CMD_OP(cmd, 0, 50, 1, char, (layout)->pass_frame_status); \ - MC_CMD_OP(cmd, 1, 0, 16, uint16_t, (layout)->private_data_size); \ - MC_CMD_OP(cmd, 1, 16, 16, uint16_t, (layout)->data_align); \ - MC_CMD_OP(cmd, 1, 32, 16, uint16_t, (layout)->data_head_room); \ - MC_CMD_OP(cmd, 1, 48, 16, uint16_t, (layout)->data_tail_room); \ -} while (0) - -#define DPNI_CMD_SET_OFFLOAD(cmd, type, config) \ -do { \ - MC_CMD_OP(cmd, 0, 24, 8, enum dpni_offload, type); \ - MC_CMD_OP(cmd, 0, 32, 32, uint32_t, config); \ -} while (0) - -#define DPNI_CMD_GET_OFFLOAD(cmd, type) \ - MC_CMD_OP(cmd, 0, 24, 8, enum dpni_offload, type) - -#define DPNI_RSP_GET_OFFLOAD(cmd, config) \ - MC_RSP_OP(cmd, 0, 32, 32, uint32_t, config) - -#define DPNI_CMD_GET_QDID(cmd, qtype) \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_QDID(cmd, qdid) \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, qdid) - - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_GET_STATISTICS(cmd, page) \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, page) - -#define DPNI_RSP_GET_STATISTICS(cmd, stat) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 64, uint64_t, (stat)->raw.counter[0]); \ - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, (stat)->raw.counter[1]); \ - MC_RSP_OP(cmd, 2, 0, 64, uint64_t, (stat)->raw.counter[2]); \ - MC_RSP_OP(cmd, 3, 0, 64, uint64_t, (stat)->raw.counter[3]); \ - MC_RSP_OP(cmd, 4, 0, 64, uint64_t, (stat)->raw.counter[4]); \ - MC_RSP_OP(cmd, 5, 0, 64, uint64_t, (stat)->raw.counter[5]); \ - MC_RSP_OP(cmd, 6, 0, 64, uint64_t, (stat)->raw.counter[6]); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_LINK_CFG(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 1, 0, 32, uint32_t, cfg->rate);\ - MC_CMD_OP(cmd, 2, 0, 64, uint64_t, cfg->options);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_LINK_STATE(cmd, state) \ -do { \ - MC_RSP_OP(cmd, 0, 32, 1, int, state->up);\ - MC_RSP_OP(cmd, 1, 0, 32, uint32_t, state->rate);\ - MC_RSP_OP(cmd, 2, 0, 64, uint64_t, state->options);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_MAX_FRAME_LENGTH(cmd, max_frame_length) \ - MC_CMD_OP(cmd, 0, 0, 16, uint16_t, max_frame_length) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_MAX_FRAME_LENGTH(cmd, max_frame_length) \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, max_frame_length) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_MULTICAST_PROMISC(cmd, en) \ - MC_CMD_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_MULTICAST_PROMISC(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_UNICAST_PROMISC(cmd, en) \ - MC_CMD_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_UNICAST_PROMISC(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr) \ -do { \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \ - MC_CMD_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \ - MC_CMD_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr) \ -do { \ - MC_RSP_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \ - MC_RSP_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \ - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \ - MC_RSP_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \ - MC_RSP_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \ - MC_RSP_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \ -} while (0) - -#define DPNI_RSP_GET_PORT_MAC_ADDR(cmd, mac_addr) \ -do { \ - MC_RSP_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \ - MC_RSP_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \ - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \ - MC_RSP_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \ - MC_RSP_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \ - MC_RSP_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_ADD_MAC_ADDR(cmd, mac_addr) \ -do { \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \ - MC_CMD_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \ - MC_CMD_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_REMOVE_MAC_ADDR(cmd, mac_addr) \ -do { \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, mac_addr[5]); \ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, mac_addr[4]); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, mac_addr[3]); \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, mac_addr[2]); \ - MC_CMD_OP(cmd, 0, 48, 8, uint8_t, mac_addr[1]); \ - MC_CMD_OP(cmd, 0, 56, 8, uint8_t, mac_addr[0]); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_CLEAR_MAC_FILTERS(cmd, unicast, multicast) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 1, int, unicast); \ - MC_CMD_OP(cmd, 0, 1, 1, int, multicast); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_ENABLE_VLAN_FILTER(cmd, en) \ - MC_CMD_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_ADD_VLAN_ID(cmd, vlan_id) \ - MC_CMD_OP(cmd, 0, 32, 16, uint16_t, vlan_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_REMOVE_VLAN_ID(cmd, vlan_id) \ - MC_CMD_OP(cmd, 0, 32, 16, uint16_t, vlan_id) - - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_CMD_SET_RX_TC_DIST(cmd, tc_id, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 16, uint16_t, cfg->dist_size); \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, tc_id); \ - MC_CMD_OP(cmd, 0, 24, 4, enum dpni_dist_mode, cfg->dist_mode); \ - MC_CMD_OP(cmd, 0, 28, 4, enum dpni_fs_miss_action, \ - cfg->fs_cfg.miss_action); \ - MC_CMD_OP(cmd, 0, 48, 16, uint16_t, cfg->fs_cfg.default_flow_id); \ - MC_CMD_OP(cmd, 6, 0, 64, uint64_t, cfg->key_cfg_iova); \ -} while (0) - -#define DPNI_CMD_GET_QUEUE(cmd, qtype, tc, index) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype); \ - MC_CMD_OP(cmd, 0, 8, 8, uint8_t, tc); \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, index); \ -} while (0) - -#define DPNI_RSP_GET_QUEUE(cmd, queue, queue_id) \ -do { \ - MC_RSP_OP(cmd, 1, 0, 32, uint32_t, (queue)->destination.id); \ - MC_RSP_OP(cmd, 1, 48, 8, uint8_t, (queue)->destination.priority); \ - MC_RSP_OP(cmd, 1, 56, 4, enum dpni_dest, (queue)->destination.type); \ - MC_RSP_OP(cmd, 1, 62, 1, char, (queue)->flc.stash_control); \ - MC_RSP_OP(cmd, 1, 63, 1, char, (queue)->destination.hold_active); \ - MC_RSP_OP(cmd, 2, 0, 64, uint64_t, (queue)->flc.value); \ - MC_RSP_OP(cmd, 3, 0, 64, uint64_t, (queue)->user_context); \ - MC_RSP_OP(cmd, 4, 0, 32, uint32_t, (queue_id)->fqid); \ - MC_RSP_OP(cmd, 4, 32, 16, uint16_t, (queue_id)->qdbin); \ -} while (0) - -#define DPNI_CMD_SET_QUEUE(cmd, qtype, tc, index, options, queue) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype); \ - MC_CMD_OP(cmd, 0, 8, 8, uint8_t, tc); \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, index); \ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, options); \ - MC_CMD_OP(cmd, 1, 0, 32, uint32_t, (queue)->destination.id); \ - MC_CMD_OP(cmd, 1, 48, 8, uint8_t, (queue)->destination.priority); \ - MC_CMD_OP(cmd, 1, 56, 4, enum dpni_dest, (queue)->destination.type); \ - MC_CMD_OP(cmd, 1, 62, 1, char, (queue)->flc.stash_control); \ - MC_CMD_OP(cmd, 1, 63, 1, char, (queue)->destination.hold_active); \ - MC_CMD_OP(cmd, 2, 0, 64, uint64_t, (queue)->flc.value); \ - MC_CMD_OP(cmd, 3, 0, 64, uint64_t, (queue)->user_context); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPNI_RSP_GET_API_VERSION(cmd, major, minor) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ -} while (0) - -#define DPNI_CMD_GET_TAILDROP(cmd, cp, q_type, tc, q_index) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_congestion_point, cp); \ - MC_CMD_OP(cmd, 0, 8, 8, enum dpni_queue_type, q_type); \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, tc); \ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, q_index); \ -} while (0) - -#define DPNI_RSP_GET_TAILDROP(cmd, taildrop) \ -do { \ - MC_RSP_OP(cmd, 1, 0, 1, char, (taildrop)->enable); \ - MC_RSP_OP(cmd, 1, 16, 8, enum dpni_congestion_unit, \ - (taildrop)->units); \ - MC_RSP_OP(cmd, 1, 32, 32, uint32_t, (taildrop)->threshold); \ -} while (0) - -#define DPNI_CMD_SET_TAILDROP(cmd, cp, q_type, tc, q_index, taildrop) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_congestion_point, cp); \ - MC_CMD_OP(cmd, 0, 8, 8, enum dpni_queue_type, q_type); \ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, tc); \ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, q_index); \ - MC_CMD_OP(cmd, 1, 0, 1, char, (taildrop)->enable); \ - MC_CMD_OP(cmd, 1, 16, 8, enum dpni_congestion_unit, \ - (taildrop)->units); \ - MC_CMD_OP(cmd, 1, 32, 32, uint32_t, (taildrop)->threshold); \ -} while (0) - -#define DPNI_CMD_SET_TX_CONFIRMATION_MODE(cmd, mode) \ - MC_CMD_OP(cmd, 0, 32, 8, enum dpni_confirmation_mode, mode) - -#define DPNI_RSP_GET_TX_CONFIRMATION_MODE(cmd, mode) \ - MC_RSP_OP(cmd, 0, 32, 8, enum dpni_confirmation_mode, mode) - -#define DPNI_CMD_SET_CONGESTION_NOTIFICATION(cmd, qtype, tc, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype); \ - MC_CMD_OP(cmd, 0, 8, 8, uint8_t, tc); \ - MC_CMD_OP(cmd, 1, 0, 32, uint32_t, (cfg)->dest_cfg.dest_id); \ - MC_CMD_OP(cmd, 1, 32, 16, uint16_t, (cfg)->notification_mode); \ - MC_CMD_OP(cmd, 1, 48, 8, uint8_t, (cfg)->dest_cfg.priority); \ - MC_CMD_OP(cmd, 1, 56, 4, enum dpni_dest, (cfg)->dest_cfg.dest_type); \ - MC_CMD_OP(cmd, 1, 60, 2, enum dpni_congestion_unit, (cfg)->units); \ - MC_CMD_OP(cmd, 2, 0, 64, uint64_t, (cfg)->message_iova); \ - MC_CMD_OP(cmd, 3, 0, 64, uint64_t, (cfg)->message_ctx); \ - MC_CMD_OP(cmd, 4, 0, 32, uint32_t, (cfg)->threshold_entry); \ - MC_CMD_OP(cmd, 4, 32, 32, uint32_t, (cfg)->threshold_exit); \ -} while (0) - -#define DPNI_CMD_GET_CONGESTION_NOTIFICATION(cmd, qtype, tc) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, enum dpni_queue_type, qtype); \ - MC_CMD_OP(cmd, 0, 8, 8, uint8_t, tc); \ -} while (0) - -#define DPNI_RSP_GET_CONGESTION_NOTIFICATION(cmd, cfg) \ -do { \ - MC_RSP_OP(cmd, 1, 0, 32, uint32_t, (cfg)->dest_cfg.dest_id); \ - MC_RSP_OP(cmd, 1, 0, 16, uint16_t, (cfg)->notification_mode); \ - MC_RSP_OP(cmd, 1, 48, 8, uint8_t, (cfg)->dest_cfg.priority); \ - MC_RSP_OP(cmd, 1, 56, 4, enum dpni_dest, (cfg)->dest_cfg.dest_type); \ - MC_RSP_OP(cmd, 1, 60, 2, enum dpni_congestion_unit, (cfg)->units); \ - MC_RSP_OP(cmd, 2, 0, 64, uint64_t, (cfg)->message_iova); \ - MC_RSP_OP(cmd, 3, 0, 64, uint64_t, (cfg)->message_ctx); \ - MC_RSP_OP(cmd, 4, 0, 32, uint32_t, (cfg)->threshold_entry); \ - MC_RSP_OP(cmd, 4, 32, 32, uint32_t, (cfg)->threshold_exit); \ -} while (0) +#define DPNI_CMDID_OPEN DPNI_CMD(0x801) +#define DPNI_CMDID_CLOSE DPNI_CMD(0x800) +#define DPNI_CMDID_CREATE DPNI_CMD(0x901) +#define DPNI_CMDID_DESTROY DPNI_CMD(0x981) +#define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01) + +#define DPNI_CMDID_ENABLE DPNI_CMD(0x002) +#define DPNI_CMDID_DISABLE DPNI_CMD(0x003) +#define DPNI_CMDID_GET_ATTR DPNI_CMD_V2(0x004) +#define DPNI_CMDID_RESET DPNI_CMD(0x005) +#define DPNI_CMDID_IS_ENABLED DPNI_CMD(0x006) + +#define DPNI_CMDID_SET_POOLS DPNI_CMD_V2(0x200) +#define DPNI_CMDID_SET_ERRORS_BEHAVIOR DPNI_CMD(0x20B) + +#define DPNI_CMDID_GET_QDID DPNI_CMD(0x210) +#define DPNI_CMDID_GET_SP_INFO DPNI_CMD(0x211) +#define DPNI_CMDID_GET_TX_DATA_OFFSET DPNI_CMD(0x212) +#define DPNI_CMDID_GET_LINK_STATE DPNI_CMD(0x215) +#define DPNI_CMDID_SET_MAX_FRAME_LENGTH DPNI_CMD(0x216) +#define DPNI_CMDID_GET_MAX_FRAME_LENGTH DPNI_CMD(0x217) +#define DPNI_CMDID_SET_LINK_CFG DPNI_CMD(0x21A) +#define DPNI_CMDID_SET_TX_SHAPING DPNI_CMD_V2(0x21B) + +#define DPNI_CMDID_SET_MCAST_PROMISC DPNI_CMD(0x220) +#define DPNI_CMDID_GET_MCAST_PROMISC DPNI_CMD(0x221) +#define DPNI_CMDID_SET_UNICAST_PROMISC DPNI_CMD(0x222) +#define DPNI_CMDID_GET_UNICAST_PROMISC DPNI_CMD(0x223) +#define DPNI_CMDID_SET_PRIM_MAC DPNI_CMD(0x224) +#define DPNI_CMDID_GET_PRIM_MAC DPNI_CMD(0x225) +#define DPNI_CMDID_ADD_MAC_ADDR DPNI_CMD(0x226) +#define DPNI_CMDID_REMOVE_MAC_ADDR DPNI_CMD(0x227) +#define DPNI_CMDID_CLR_MAC_FILTERS DPNI_CMD(0x228) + +#define DPNI_CMDID_ENABLE_VLAN_FILTER DPNI_CMD(0x230) +#define DPNI_CMDID_ADD_VLAN_ID DPNI_CMD(0x231) +#define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232) +#define DPNI_CMDID_CLR_VLAN_FILTERS DPNI_CMD(0x233) + +#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V2(0x235) + +#define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V2(0x25D) +#define DPNI_CMDID_RESET_STATISTICS DPNI_CMD(0x25E) +#define DPNI_CMDID_GET_QUEUE DPNI_CMD(0x25F) +#define DPNI_CMDID_SET_QUEUE DPNI_CMD(0x260) +#define DPNI_CMDID_GET_TAILDROP DPNI_CMD_V2(0x261) +#define DPNI_CMDID_SET_TAILDROP DPNI_CMD_V2(0x262) + +#define DPNI_CMDID_GET_PORT_MAC_ADDR DPNI_CMD(0x263) + +#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD(0x264) +#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD(0x265) + +#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD(0x267) +#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD(0x268) +#define DPNI_CMDID_SET_EARLY_DROP DPNI_CMD_V2(0x269) +#define DPNI_CMDID_GET_EARLY_DROP DPNI_CMD_V2(0x26A) +#define DPNI_CMDID_GET_OFFLOAD DPNI_CMD(0x26B) +#define DPNI_CMDID_SET_OFFLOAD DPNI_CMD(0x26C) +#define DPNI_CMDID_SET_TX_CONFIRMATION_MODE DPNI_CMD(0x266) +#define DPNI_CMDID_GET_TX_CONFIRMATION_MODE DPNI_CMD(0x26D) + +/* Macros for accessing command fields smaller than 1byte */ +#define DPNI_MASK(field) \ + GENMASK(DPNI_##field##_SHIFT + DPNI_##field##_SIZE - 1, \ + DPNI_##field##_SHIFT) +#define dpni_set_field(var, field, val) \ + ((var) |= (((val) << DPNI_##field##_SHIFT) & DPNI_MASK(field))) +#define dpni_get_field(var, field) \ + (((var) & DPNI_MASK(field)) >> DPNI_##field##_SHIFT) + +#pragma pack(push, 1) +struct dpni_cmd_open { + uint32_t dpni_id; +}; + +struct dpni_cmd_create { + uint32_t options; + uint8_t num_queues; + uint8_t num_tcs; + uint8_t mac_filter_entries; + uint8_t pad1; + uint8_t vlan_filter_entries; + uint8_t pad2; + uint8_t qos_entries; + uint8_t pad3; + uint16_t fs_entries; +}; + +struct dpni_cmd_destroy { + uint32_t dpsw_id; +}; + +#define DPNI_BACKUP_POOL(val, order) (((val) & 0x1) << (order)) + +struct dpni_cmd_pool { + uint16_t dpbp_id; + uint8_t priority_mask; + uint8_t pad; +}; + +struct dpni_cmd_set_pools { + uint8_t num_dpbp; + uint8_t backup_pool_mask; + uint16_t pad; + struct dpni_cmd_pool pool[8]; + uint16_t buffer_size[8]; +}; + +/* The enable indication is always the least significant bit */ +#define DPNI_ENABLE_SHIFT 0 +#define DPNI_ENABLE_SIZE 1 + +struct dpni_rsp_is_enabled { + uint8_t enabled; +}; + +struct dpni_rsp_get_attr { + /* response word 0 */ + uint32_t options; + uint8_t num_queues; + uint8_t num_rx_tcs; + uint8_t mac_filter_entries; + uint8_t num_tx_tcs; + /* response word 1 */ + uint8_t vlan_filter_entries; + uint8_t pad1; + uint8_t qos_entries; + uint8_t pad2; + uint16_t fs_entries; + uint16_t pad3; + /* response word 2 */ + uint8_t qos_key_size; + uint8_t fs_key_size; + uint16_t wriop_version; +}; + +#define DPNI_ERROR_ACTION_SHIFT 0 +#define DPNI_ERROR_ACTION_SIZE 4 +#define DPNI_FRAME_ANN_SHIFT 4 +#define DPNI_FRAME_ANN_SIZE 1 + +struct dpni_cmd_set_errors_behavior { + uint32_t errors; + /* from least significant bit: error_action:4, set_frame_annotation:1 */ + uint8_t flags; +}; + +/* There are 3 separate commands for configuring Rx, Tx and Tx confirmation + * buffer layouts, but they all share the same parameters. + * If one of the functions changes, below structure needs to be split. + */ +#define DPNI_PASS_TS_SHIFT 0 +#define DPNI_PASS_TS_SIZE 1 +#define DPNI_PASS_PR_SHIFT 1 +#define DPNI_PASS_PR_SIZE 1 +#define DPNI_PASS_FS_SHIFT 2 +#define DPNI_PASS_FS_SIZE 1 + +struct dpni_cmd_get_buffer_layout { + uint8_t qtype; +}; + +struct dpni_rsp_get_buffer_layout { + /* response word 0 */ + uint8_t pad0[6]; + /* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */ + uint8_t flags; + uint8_t pad1; + /* response word 1 */ + uint16_t private_data_size; + uint16_t data_align; + uint16_t head_room; + uint16_t tail_room; +}; + +struct dpni_cmd_set_buffer_layout { + /* cmd word 0 */ + uint8_t qtype; + uint8_t pad0[3]; + uint16_t options; + /* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */ + uint8_t flags; + uint8_t pad1; + /* cmd word 1 */ + uint16_t private_data_size; + uint16_t data_align; + uint16_t head_room; + uint16_t tail_room; +}; + +struct dpni_cmd_set_offload { + uint8_t pad[3]; + uint8_t dpni_offload; + uint32_t config; +}; + +struct dpni_cmd_get_offload { + uint8_t pad[3]; + uint8_t dpni_offload; +}; + +struct dpni_rsp_get_offload { + uint32_t pad; + uint32_t config; +}; + +struct dpni_cmd_get_qdid { + uint8_t qtype; +}; + +struct dpni_rsp_get_qdid { + uint16_t qdid; +}; + +struct dpni_rsp_get_sp_info { + uint16_t spids[2]; +}; + +struct dpni_rsp_get_tx_data_offset { + uint16_t data_offset; +}; + +struct dpni_cmd_get_statistics { + uint8_t page_number; + uint8_t param; +}; + +struct dpni_rsp_get_statistics { + uint64_t counter[7]; +}; + +struct dpni_cmd_set_link_cfg { + uint64_t pad0; + uint32_t rate; + uint32_t pad1; + uint64_t options; +}; + +#define DPNI_LINK_STATE_SHIFT 0 +#define DPNI_LINK_STATE_SIZE 1 + +struct dpni_rsp_get_link_state { + uint32_t pad0; + /* from LSB: up:1 */ + uint8_t flags; + uint8_t pad1[3]; + uint32_t rate; + uint32_t pad2; + uint64_t options; +}; + +struct dpni_cmd_set_max_frame_length { + uint16_t max_frame_length; +}; + +struct dpni_rsp_get_max_frame_length { + uint16_t max_frame_length; +}; + +struct dpni_cmd_set_multicast_promisc { + uint8_t enable; +}; + +struct dpni_rsp_get_multicast_promisc { + uint8_t enabled; +}; + +struct dpni_cmd_set_unicast_promisc { + uint8_t enable; +}; + +struct dpni_rsp_get_unicast_promisc { + uint8_t enabled; +}; + +struct dpni_cmd_set_primary_mac_addr { + uint16_t pad; + uint8_t mac_addr[6]; +}; + +struct dpni_rsp_get_primary_mac_addr { + uint16_t pad; + uint8_t mac_addr[6]; +}; + +struct dpni_rsp_get_port_mac_addr { + uint16_t pad; + uint8_t mac_addr[6]; +}; + +struct dpni_cmd_add_mac_addr { + uint16_t pad; + uint8_t mac_addr[6]; +}; + +struct dpni_cmd_remove_mac_addr { + uint16_t pad; + uint8_t mac_addr[6]; +}; + +#define DPNI_UNICAST_FILTERS_SHIFT 0 +#define DPNI_UNICAST_FILTERS_SIZE 1 +#define DPNI_MULTICAST_FILTERS_SHIFT 1 +#define DPNI_MULTICAST_FILTERS_SIZE 1 + +struct dpni_cmd_clear_mac_filters { + /* from LSB: unicast:1, multicast:1 */ + uint8_t flags; +}; + +struct dpni_cmd_enable_vlan_filter { + /* only the LSB */ + uint8_t en; +}; + +struct dpni_cmd_vlan_id { + uint32_t pad; + uint16_t vlan_id; +}; + +#define DPNI_SEPARATE_GRP_SHIFT 0 +#define DPNI_SEPARATE_GRP_SIZE 1 +#define DPNI_MODE_1_SHIFT 0 +#define DPNI_MODE_1_SIZE 4 +#define DPNI_MODE_2_SHIFT 4 +#define DPNI_MODE_2_SIZE 4 + +struct dpni_cmd_set_tx_priorities { + uint16_t flags; + uint8_t prio_group_A; + uint8_t prio_group_B; + uint32_t pad0; + uint8_t modes[4]; + uint32_t pad1; + uint64_t pad2; + uint16_t delta_bandwidth[8]; +}; + +#define DPNI_DIST_MODE_SHIFT 0 +#define DPNI_DIST_MODE_SIZE 4 +#define DPNI_MISS_ACTION_SHIFT 4 +#define DPNI_MISS_ACTION_SIZE 4 +#define DPNI_KEEP_HASH_KEY_SHIFT 7 +#define DPNI_KEEP_HASH_KEY_SIZE 1 + +struct dpni_cmd_set_rx_tc_dist { + uint16_t dist_size; + uint8_t tc_id; + /* from LSB: dist_mode:4, miss_action:4 */ + uint8_t flags; + uint8_t pad0; + /* only the LSB */ + uint8_t keep_hash_key; + uint16_t default_flow_id; + uint64_t pad1[5]; + uint64_t key_cfg_iova; +}; + +struct dpni_cmd_get_queue { + uint8_t qtype; + uint8_t tc; + uint8_t index; +}; + +#define DPNI_DEST_TYPE_SHIFT 0 +#define DPNI_DEST_TYPE_SIZE 4 +#define DPNI_STASH_CTRL_SHIFT 6 +#define DPNI_STASH_CTRL_SIZE 1 +#define DPNI_HOLD_ACTIVE_SHIFT 7 +#define DPNI_HOLD_ACTIVE_SIZE 1 + +struct dpni_rsp_get_queue { + /* response word 0 */ + uint64_t pad0; + /* response word 1 */ + uint32_t dest_id; + uint16_t pad1; + uint8_t dest_prio; + /* From LSB: dest_type:4, pad:2, flc_stash_ctrl:1, hold_active:1 */ + uint8_t flags; + /* response word 2 */ + uint64_t flc; + /* response word 3 */ + uint64_t user_context; + /* response word 4 */ + uint32_t fqid; + uint16_t qdbin; +}; + +struct dpni_cmd_set_queue { + /* cmd word 0 */ + uint8_t qtype; + uint8_t tc; + uint8_t index; + uint8_t options; + uint32_t pad0; + /* cmd word 1 */ + uint32_t dest_id; + uint16_t pad1; + uint8_t dest_prio; + uint8_t flags; + /* cmd word 2 */ + uint64_t flc; + /* cmd word 3 */ + uint64_t user_context; +}; + +#define DPNI_DROP_ENABLE_SHIFT 0 +#define DPNI_DROP_ENABLE_SIZE 1 +#define DPNI_DROP_UNITS_SHIFT 2 +#define DPNI_DROP_UNITS_SIZE 2 + +struct dpni_early_drop { + /* from LSB: enable:1 units:2 */ + uint8_t flags; + uint8_t pad0[3]; + uint32_t pad1; + uint8_t green_drop_probability; + uint8_t pad2[7]; + uint64_t green_max_threshold; + uint64_t green_min_threshold; + uint64_t pad3; + uint8_t yellow_drop_probability; + uint8_t pad4[7]; + uint64_t yellow_max_threshold; + uint64_t yellow_min_threshold; + uint64_t pad5; + uint8_t red_drop_probability; + uint8_t pad6[7]; + uint64_t red_max_threshold; + uint64_t red_min_threshold; +}; + +struct dpni_cmd_early_drop { + uint8_t qtype; + uint8_t tc; + uint8_t pad[6]; + uint64_t early_drop_iova; +}; + +struct dpni_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; + +struct dpni_cmd_get_taildrop { + uint8_t congestion_point; + uint8_t qtype; + uint8_t tc; + uint8_t index; +}; + +struct dpni_rsp_get_taildrop { + /* cmd word 0 */ + uint64_t pad0; + /* cmd word 1 */ + /* from LSB: enable:1 oal_lo:7 */ + uint8_t enable_oal_lo; + /* from LSB: oal_hi:5 */ + uint8_t oal_hi; + uint8_t units; + uint8_t pad2; + uint32_t threshold; +}; + +#define DPNI_OAL_LO_SHIFT 1 +#define DPNI_OAL_LO_SIZE 7 +#define DPNI_OAL_HI_SHIFT 0 +#define DPNI_OAL_HI_SIZE 5 + +struct dpni_cmd_set_taildrop { + /* cmd word 0 */ + uint8_t congestion_point; + uint8_t qtype; + uint8_t tc; + uint8_t index; + uint32_t pad0; + /* cmd word 1 */ + /* from LSB: enable:1 oal_lo:7 */ + uint8_t enable_oal_lo; + /* from LSB: oal_hi:5 */ + uint8_t oal_hi; + uint8_t units; + uint8_t pad2; + uint32_t threshold; +}; + +struct dpni_tx_confirmation_mode { + uint32_t pad; + uint8_t confirmation_mode; +}; + +#define DPNI_DEST_TYPE_SHIFT 0 +#define DPNI_DEST_TYPE_SIZE 4 +#define DPNI_CONG_UNITS_SHIFT 4 +#define DPNI_CONG_UNITS_SIZE 2 + +struct dpni_cmd_set_congestion_notification { + uint8_t qtype; + uint8_t tc; + uint8_t pad[6]; + uint32_t dest_id; + uint16_t notification_mode; + uint8_t dest_priority; + /* from LSB: dest_type: 4 units:2 */ + uint8_t type_units; + uint64_t message_iova; + uint64_t message_ctx; + uint32_t threshold_entry; + uint32_t threshold_exit; +}; + +struct dpni_cmd_get_congestion_notification { + uint8_t qtype; + uint8_t tc; +}; + +struct dpni_rsp_get_congestion_notification { + uint64_t pad; + uint32_t dest_id; + uint16_t notification_mode; + uint8_t dest_priority; + /* from LSB: dest_type: 4 units:2 */ + uint8_t type_units; + uint64_t message_iova; + uint64_t message_ctx; + uint32_t threshold_entry; + uint32_t threshold_exit; +}; + +#pragma pack(pop) #endif /* _FSL_DPNI_CMD_H */ diff --git a/drivers/net/dpaa2/mc/fsl_net.h b/drivers/net/dpaa2/mc/fsl_net.h index ef7e4da..dbec306 100644 --- a/drivers/net/dpaa2/mc/fsl_net.h +++ b/drivers/net/dpaa2/mc/fsl_net.h @@ -213,7 +213,7 @@ #define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN (NH_FLD_SCTP_CHUNK_DATA_TYPE << 5) #define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID (NH_FLD_SCTP_CHUNK_DATA_TYPE << 6) #define NH_FLD_SCTP_CHUNK_DATA_UNORDERED (NH_FLD_SCTP_CHUNK_DATA_TYPE << 7) -#define NH_FLD_SCTP_CHUNK_DATA_BEGINNING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) +#define NH_FLD_SCTP_CHUNK_DATA_BEGGINNING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) #define NH_FLD_SCTP_CHUNK_DATA_END (NH_FLD_SCTP_CHUNK_DATA_TYPE << 9) #define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS \ ((NH_FLD_SCTP_CHUNK_DATA_TYPE << 10) - 1) From patchwork Fri Sep 8 08:45:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112032 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1244789ybm; Fri, 8 Sep 2017 01:48:16 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5JXZ6zkMSm0OXzh8ksO+ddRDXT/digmKp5cQr5aAnlTXQnxIE5Ryo3FQ2OXMH0bC91null X-Received: by 10.223.166.99 with SMTP id k90mr1334012wrc.183.1504860496291; Fri, 08 Sep 2017 01:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860496; cv=none; d=google.com; s=arc-20160816; b=M9tmAf4fTJG2Nfl2phoP7NklKO7oqErknPF3jfCYpWWgzPohfV3eBkooCWBjIHXDTD MxWuN1NdyKk8uFy+uV2EFWcvMph8mzmQcx2GUCo+7DKTWAbTz8nuGBKbALl74rSCUvQh /yujRMSPw3ukGJsne6OjU64CrGwH36YlQ84u/e85Y9TnzGNw62TVWBUEY8CEYnPRrL69 sspv5psOFfY1GmjPWuxOZKikUvhLShgJqdmP7lLRByoC7OUlve1q4EPWy1P9Fmj+I7tY 0lSxndw0t5QGW5v6aEyNOCbBOqvgZK7PlFamNMS65/QnthGB0m2FazgpXzIDUYLVU9PD gChQ== 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=76ItS+z6q1AXM1+3VdSAJ2IN2jYBfPzH7kTzybuU5jc=; b=rPBURB3HRmCyC/QIPvmugsCGJI73ODYuoXUrWxBpRPDhW2923iYG3hbvqGH6rcnfoG WjOKVilEZAjdX508aNoBf3SZefzIAv3Mlve/lDSCtoorP3rZsLJKfwswt2L9K7Yxqcsl zRP7fn4FFPo32Igh6GhS9xochKTD0pLxVnsZM2blw0yL2zxC/rDNFR8Piw3dwDb0JM5y YmFQ7KjPMl65SzcsHOdrw04H1nQoGTNwX8lLGAGUT+IwdF3UIMZDZcTP/YFT5HbyijS4 JwbcbHl+JYpkDYECFNK/9v5q5RFAh9rEmazrYvq72fqA6HojcYiKNX1XRBGi/rotNQrh FHCg== 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 l9si1063112wra.97.2017.09.08.01.48.16; Fri, 08 Sep 2017 01:48:16 -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 500AF199D3; Fri, 8 Sep 2017 10:46:17 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0062.outbound.protection.outlook.com [104.47.41.62]) by dpdk.org (Postfix) with ESMTP id 20497199EE for ; Fri, 8 Sep 2017 10:46:15 +0200 (CEST) Received: from BN3PR03CA0109.namprd03.prod.outlook.com (10.174.66.27) by CY4PR03MB3317.namprd03.prod.outlook.com (10.171.246.150) 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:13 +0000 Received: from BY2FFO11FD007.protection.gbl (2a01:111:f400:7c0c::121) by BN3PR03CA0109.outlook.office365.com (2603:10b6:400:4::27) 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:12 +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 BY2FFO11FD007.mail.protection.outlook.com (10.1.14.128) 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:12 +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 v888jmoh023063; Fri, 8 Sep 2017 01:46:10 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:08 +0530 Message-ID: <1504860327-18451-12-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: 131493339724827245; (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)(51234002)(189002)(45074003)(199003)(8936002)(81156014)(81166006)(50226002)(105606002)(106466001)(2351001)(8656003)(8676002)(110136004)(85426001)(77096006)(4326008)(33646002)(5660300001)(97736004)(5003940100001)(305945005)(356003)(2950100002)(6916009)(47776003)(50466002)(48376002)(50986999)(76176999)(189998001)(86362001)(575784001)(36756003)(68736007)(2906002)(15650500001)(53946003)(16200700003)(104016004)(498600001)(53936002)(54906002)(579004)(559001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3317; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD007; 1:lCtyCwX3Qjvcolu5PibLCeWa3j9eJxbO4ehpHKaN2FCQtw9TsMwTc6NtguYAiA9d4GrHPd2YErj9JPZSJ3Cg4JMwNkfXhDAqzbNn9Vh7HBHY2+Rwg/gAgkx3j10D4PMK MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3c852f33-dd69-40e6-bf65-08d4f6960f04 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB3317; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3317; 3:KHxIpGnz21EPKtkg/iUf1Bsao4FTdWZoWEc48IYazXYsxhWiYCIzn+nwic0qJjxETguAhrwinGDDHWAy7YhknYBxcN3ql93Rfo63FbQvMn2ILXHHqTyw1VpH0eLnRr/DuDZMLMMSzuKHUrhCT0oDzcXvzaIgrawPvQh1PnxqEe96zzC3SqDxV3+wUM443um5TbyzumayAitpSOyOyRApPsXFXInwAc9Zvhg78vFlbyb3qvTnGXG+XtnPRa+igv8QhwWAoAcyc6Xqh/rh7GiXeR+sAWlaLx18gAcq4Heb2jLIAUBJ17JzBiWODkpCnAackQBwE4Wfgw55/Bsxy8h+tGqUOOg5NDdssjt6Ux/7HXc=; 25:kN7JYqP0pNqGU6+Ry7H5UL4BWuEYb/Mxrj366kGAUpd0oylYERDFWjXWJP3YnqQk3ayjqxYdzfgh2/4HLFY//r6RT+zOrep7aZb7cbX+td6JgFbZJeK6jw7q7AX7jod3y04jRfMHtiZz20BizdKQl7dFX82PQBGfLbMtXafbb4hgCj0C9yqqVFiB2h7u77PdgHyFQyk7Vq7wqaPmBzSg21lynUOJRFrVh+cmDhnHxb28aq0j5dViQoCrgJJEu9ynyBRSt/Rs9lNKkgQKudZcmD4GdkzekBxjUEj2qDiXkb/IIBOnHRQxZVtiNYheM7M2qTjnGOBCsjh+tW9R6zvCkA== X-MS-TrafficTypeDiagnostic: CY4PR03MB3317: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3317; 31:ghU1XDlhoLoEEqt+jPGTBtnR281UQFzHnnPyEdgKSFPlLOgUnr1zFEo3IGUegP30ePu6LaKavYYlyrfqkVNkx/W6JOljygjxuxhitgrZgVXIh6OAAHt2qmvPJZCjSKRg3sIEJVMbvixETjE3FcqF3cjWsgz8JKwjCJ9dgEZtIyhHbTNA92WPniKQ2XwoBMkJQj6wIPg8LnEaJKmEDzFy7pTSv07mqRP9UEVW9apjDj4=; 4:6bA94fj/oP1uMxR1I1plDgOsfh8k/2q2oqzt4wxgwzjfGBKGVyZDjn97kxRL2m3sSd3Unawu3HHlGdb57zA60TFXCisF8EnVONmz3fxxkV9/ibnDFO1zYEV+4vvNDKvSnTWSsW5IyG8PUsML/2Wyfyx6oZHjh1wzN8D3oKgADiSUxZEAcdzmzpn8WD/d7V6mjDh/SIiV4AbaKeoIqobeAEdE947f/Ph0+kVD9fX6rDhpDbqUjluuZZk2lke1S2KRqFgGpxOIZ1gA2tKvF6hwUgEhNhw7tsDeP47VwNS+PgWe5PDGfEwNne9DyUVJ8PFvSDDDyIcKjvFzupSSU1xPdA== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123561025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3317; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3317; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3317; 23:bEL6ffpLz2/lF1JQKR9cgXFACmqzZ8r+v7ZjiAkJC?= W/j+WkDkmmW6OKV9ap268muRP6dsHBlEgmEovrtZAkO0Rotj3tGPq8sktB/bsxK/i/RaR/WgZo96Lx4dnLVW27H4d82EvOD6iSZU9vitHrYREd0zaVFAVFYTR+uoLmwkcIY1LK+ICENWT8pyyFK6coz/MaXtKDZbq3bJvvq4qByErLQZjaqHmrgFzQdIk02QAM1hez/q6Va150/XhsX0Vwt8dMaQX1hQGNE+/CRZP4/KKibiAX5xfCXQnV1dTkKQDF+vlUttfAStayZq75FmRV/oNx+h0wxsnUNr3sBqN23XCCmAkeNpB3avzglNfEFQx0RquZpqwkP7x1ScQwU3CdhRXs2BuxDhhhDezGoTXKa2rAy4vVg8K9Tsq6dXzjVJN0Kw3aKaqrVbJYcfdwdfPdvKYk9Hqk7RD0PDz1bPf3+nhxMUV3EuA7P+U3SutgOYhmcwu2hPh63r4jKM3bvoa151RNWqSkS/dwVmbMq9VPLApldQ/O8yhXLUpnM25gdcGr+ZTHDxeumNXKsp0qoYi2i7AUrNmumnFD6cfRZtGdlstw6cVsmj+vYDT9ZsrgqVTMejnKBexIwO4S/0+rfMrUlYGHheOauAedotj1xayYzviXXmup0PMbdoWXWiCYYkaoZTiQjylhvzwGpu+Uzk6jrBuT/583QNIIYkR4ImhXGTz/tcYIeQHsHvzzaDZHMQTkQx/l8bmfVHBEVUQBJnUFEUU1Z5Ri6y3Hlkty2L0DehM7rCEDWvhfGxSk6K9/k+r3b02bxzik/WZ2gD2wXA+OgqEX5PjiAjMdjBz3YAH31CwDoVowgefvCGrZdCcqGfWOn7gt52ElkD+DO5l8gJB2FTnY+9FqoGwNwherUyoMcUGazdSRjI2K22EdD9q877r4xhNaDU0qQcqbLJgTBGT07wUlIV1hMasM/Vnug7dfhszLfs3OsjICCWmqeN5DYacg4tOo1QAHhD5YUHsllNI4HgvxkyiSFgf5P41DYuBvCcmdzQjUADMT0SCP+nqPlWH/R0kHFH1mssoLhZnbMDn04pHll5aA1+m8TnQ3g5gw280ir4odl4jd1L+XywT8yeLgueC+2Hus+aLWMI5a16dRkzIeb5H5BIOzJwuVTdsVI7MoC1Gt/b/wU1Qwf0Q7n+oZWlSGWgHN+ZpjUVNWTiG1yDGEipxV0pRJjxanhcosKdhk3gKNyzxs59YfuvWLXfJrz0dpfwKdi2TbcEcha9uJ6/drLfE/UKDhewuHpDSEzjg== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3317; 6:m9tRiksEmgOEXxiMY+I4ecYYZCHgA7FiaY22rt9NxtRSRSUcEGr38q/VYs9lmSidX3X2/+HWOoacFLeGLiwTHcYTh3djmToAwmeX7AY3XD6smY3zZL82gmr30NFgqM2ts9fmqlzXRZ6WZA3RFuoEdPJ4PUJ1ucnQSii8MZa6IRUQz24wISav1hhOMjYMbe10LW/oXYSm1hXm3FRS3qldRMab1IqPMxepKrMXlWX0i40EotuBmhbKvn3WYyYv7kWshYf4OyYnsWllcgFj9/jxUu4+V85RCLC90m/xV99QaVBohBb5rbsBXjY0NnNqXBEj4jVCTaNHGXQI1SPl4eTydg==; 5:bR6TqRKnoNjcMws4GKhbxubqOvaKqlD+8ztP+m9hLqXydKOyliUVoIjcsUk0YqiVl7EeokDkbF6k/7bLKMrXMtTdlXlx9fi7Buyfxj15sTXvavw19fW1H8XvG/HkQLBE0UbYmpNA26sNzkZgXCvotw==; 24:CfaOHW/vZ71L4P4WSxT4Fpe8nTNb5E0NQ/O7wY2veH2iISIN9mQRXUmIPOwZdVnae4CM9PVm9+S3FaeNZNGvjFCRmGBytP7I2YqZmzJb8b8=; 7:j1B6AxKfDumdL58BCdIfgDUVY1LVOG82FfgvXuQoDlTdLa2xlfqGdPECAU5GgDRbhPFRbj5hXa4WARysDrNFRMJM2kWn/huH/61R66mjRgWqqZAugCTM9zxuqYJxgeI3Jc1mjg6yPZGXpFuk3K3QYWWHb6DMTNHLgxjE+u7bUNh8Yc+c03UM1ko9PYBkU7w/wrg8HfsHRHBg84CPIin9ohuV6sWbaSXfX+yUHLIDqp8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:12.1707 (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: CY4PR03MB3317 Subject: [dpdk-dev] [PATCH v2 11/30] crypto/dpaa2_sec: update MC to 10.3.x 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" From: Shreyansh Jain Signed-off-by: Shreyansh Jain --- drivers/crypto/dpaa2_sec/mc/dpseci.c | 676 +++++++++++++---------- drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h | 782 ++++++++------------------- drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h | 387 ++++++------- 3 files changed, 808 insertions(+), 1037 deletions(-) -- 2.7.4 diff --git a/drivers/crypto/dpaa2_sec/mc/dpseci.c b/drivers/crypto/dpaa2_sec/mc/dpseci.c index 4a10962..2a216af 100644 --- a/drivers/crypto/dpaa2_sec/mc/dpseci.c +++ b/drivers/crypto/dpaa2_sec/mc/dpseci.c @@ -37,18 +37,34 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - #include #include #include #include -int -dpseci_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpseci_id, - uint16_t *token) +/** + * dpseci_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpseci_id: DPSECI unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpseci_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpseci_id, + uint16_t *token) { + struct dpseci_cmd_open *cmd_params; struct mc_command cmd = { 0 }; int err; @@ -56,23 +72,34 @@ dpseci_open(struct fsl_mc_io *mc_io, cmd.header = mc_encode_cmd_header(DPSECI_CMDID_OPEN, cmd_flags, 0); - DPSECI_CMD_OPEN(cmd, dpseci_id); + cmd_params = (struct dpseci_cmd_open *)cmd.params; + cmd_params->dpseci_id = cpu_to_le32(dpseci_id); - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + *token = mc_cmd_hdr_read_token(&cmd); return 0; } -int -dpseci_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token) +/** + * dpseci_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) { struct mc_command cmd = { 0 }; @@ -81,478 +108,569 @@ dpseci_close(struct fsl_mc_io *mc_io, cmd_flags, token); - /* send command to mc */ + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int -dpseci_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpseci_cfg *cfg, - uint32_t *obj_id) +/** + * dpseci_create() - Create the DPSECI object + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: Returned object id + * + * Create the DPSECI object, allocate required resources and + * perform required initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * The function accepts an authentication token of a parent + * container that this object should be assigned to. The token + * can be '0' so the object will be assigned to the default container. + * The newly created object can be opened with the returned + * object id and using the container's associated tokens and MC portals. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpseci_cfg *cfg, + uint32_t *obj_id) { + struct dpseci_cmd_create *cmd_params; struct mc_command cmd = { 0 }; - int err; + int err, i; /* prepare command */ cmd.header = mc_encode_cmd_header(DPSECI_CMDID_CREATE, cmd_flags, dprc_token); - DPSECI_CMD_CREATE(cmd, cfg); - - /* send command to mc */ + cmd_params = (struct dpseci_cmd_create *)cmd.params; + for (i = 0; i < DPSECI_PRIO_NUM; i++) + cmd_params->priorities[i] = cfg->priorities[i]; + cmd_params->num_tx_queues = cfg->num_tx_queues; + cmd_params->num_rx_queues = cfg->num_rx_queues; + cmd_params->options = cfg->options; + + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + *obj_id = mc_cmd_read_object_id(&cmd); return 0; } -int -dpseci_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id) +/** + * dpseci_destroy() - Destroy the DPSECI object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @object_id: The object id; it must be a valid id within the container that + * created this object; + * + * The function accepts the authentication token of the parent container that + * created the object (not the one that currently owns the object). The object + * is searched within parent using the provided 'object_id'. + * All tokens to the object must be closed before calling destroy. + * + * Return: '0' on Success; error code otherwise. + */ +int dpseci_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id) { + struct dpseci_cmd_destroy *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPSECI_CMDID_DESTROY, cmd_flags, dprc_token); - /* set object id to destroy */ - CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); - /* send command to mc */ - return mc_send_command(mc_io, &cmd); -} - -int -dpseci_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token) -{ - struct mc_command cmd = { 0 }; + cmd_params = (struct dpseci_cmd_destroy *)cmd.params; + cmd_params->dpseci_id = cpu_to_le32(object_id); - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_ENABLE, - cmd_flags, - token); - - /* send command to mc */ + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int -dpseci_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token) -{ - struct mc_command cmd = { 0 }; - - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_DISABLE, - cmd_flags, - token); - - /* send command to mc */ - return mc_send_command(mc_io, &cmd); -} - -int -dpseci_is_enabled(struct fsl_mc_io *mc_io, +/** + * dpseci_enable() - Enable the DPSECI, allow sending and receiving frames. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_enable(struct fsl_mc_io *mc_io, uint32_t cmd_flags, - uint16_t token, - int *en) -{ - struct mc_command cmd = { 0 }; - int err; - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_IS_ENABLED, - cmd_flags, - token); - - /* send command to mc */ - err = mc_send_command(mc_io, &cmd); - if (err) - return err; - - /* retrieve response parameters */ - DPSECI_RSP_IS_ENABLED(cmd, *en); - - return 0; -} - -int -dpseci_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token) + uint16_t token) { struct mc_command cmd = { 0 }; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_RESET, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_ENABLE, cmd_flags, token); - /* send command to mc */ + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int -dpseci_get_irq(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - int *type, - struct dpseci_irq_cfg *irq_cfg) -{ - struct mc_command cmd = { 0 }; - int err; - - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_IRQ, - cmd_flags, - token); - DPSECI_CMD_GET_IRQ(cmd, irq_index); - - /* send command to mc */ - err = mc_send_command(mc_io, &cmd); - if (err) - return err; - - /* retrieve response parameters */ - DPSECI_RSP_GET_IRQ(cmd, *type, irq_cfg); - - return 0; -} - -int -dpseci_set_irq(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - struct dpseci_irq_cfg *irq_cfg) +/** + * dpseci_disable() - Disable the DPSECI, stop sending and receiving frames. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) { struct mc_command cmd = { 0 }; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_IRQ, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_DISABLE, cmd_flags, token); - DPSECI_CMD_SET_IRQ(cmd, irq_index, irq_cfg); - /* send command to mc */ + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int -dpseci_get_irq_enable(struct fsl_mc_io *mc_io, +/** + * dpseci_is_enabled() - Check if the DPSECI is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, - uint8_t irq_index, - uint8_t *en) + int *en) { + struct dpseci_rsp_is_enabled *rsp_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_IRQ_ENABLE, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_IS_ENABLED, cmd_flags, token); - DPSECI_CMD_GET_IRQ_ENABLE(cmd, irq_index); - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPSECI_RSP_GET_IRQ_ENABLE(cmd, *en); + rsp_params = (struct dpseci_rsp_is_enabled *)cmd.params; + *en = dpseci_get_field(rsp_params->en, ENABLE); return 0; } -int -dpseci_set_irq_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint8_t en) +/** + * dpseci_reset() - Reset the DPSECI, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) { struct mc_command cmd = { 0 }; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_IRQ_ENABLE, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_RESET, cmd_flags, token); - DPSECI_CMD_SET_IRQ_ENABLE(cmd, irq_index, en); - /* send command to mc */ + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int -dpseci_get_irq_mask(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t *mask) +/** + * dpseci_get_attributes() - Retrieve DPSECI attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @attr: Returned object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_attr *attr) { + struct dpseci_rsp_get_attr *rsp_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_IRQ_MASK, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_ATTR, cmd_flags, token); - DPSECI_CMD_GET_IRQ_MASK(cmd, irq_index); - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPSECI_RSP_GET_IRQ_MASK(cmd, *mask); + rsp_params = (struct dpseci_rsp_get_attr *)cmd.params; + attr->id = le32_to_cpu(rsp_params->id); + attr->options = rsp_params->options; + attr->num_tx_queues = rsp_params->num_tx_queues; + attr->num_rx_queues = rsp_params->num_rx_queues; return 0; } -int -dpseci_set_irq_mask(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t mask) +/** + * dpseci_set_rx_queue() - Set Rx queue configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @queue: Select the queue relative to number of + * priorities configured at DPSECI creation; use + * DPSECI_ALL_QUEUES to configure all Rx queues identically. + * @cfg: Rx queue configuration + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_set_rx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t queue, + const struct dpseci_rx_queue_cfg *cfg) { + struct dpseci_cmd_set_rx_queue *cmd_params; struct mc_command cmd = { 0 }; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_IRQ_MASK, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_RX_QUEUE, cmd_flags, token); - DPSECI_CMD_SET_IRQ_MASK(cmd, irq_index, mask); - - /* send command to mc */ + cmd_params = (struct dpseci_cmd_set_rx_queue *)cmd.params; + cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); + cmd_params->dest_priority = cfg->dest_cfg.priority; + cmd_params->queue = queue; + cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx); + cmd_params->options = cpu_to_le32(cfg->options); + dpseci_set_field(cmd_params->dest_type, + DEST_TYPE, + cfg->dest_cfg.dest_type); + dpseci_set_field(cmd_params->order_preservation_en, + ORDER_PRESERVATION, + cfg->order_preservation_en); + + /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int -dpseci_get_irq_status(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t *status) +/** + * dpseci_get_rx_queue() - Retrieve Rx queue attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @queue: Select the queue relative to number of + * priorities configured at DPSECI creation + * @attr: Returned Rx queue attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_rx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t queue, + struct dpseci_rx_queue_attr *attr) { + struct dpseci_rsp_get_rx_queue *rsp_params; + struct dpseci_cmd_get_queue *cmd_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_IRQ_STATUS, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_RX_QUEUE, cmd_flags, token); - DPSECI_CMD_GET_IRQ_STATUS(cmd, irq_index, *status); + cmd_params = (struct dpseci_cmd_get_queue *)cmd.params; + cmd_params->queue = queue; - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPSECI_RSP_GET_IRQ_STATUS(cmd, *status); + rsp_params = (struct dpseci_rsp_get_rx_queue *)cmd.params; + attr->user_ctx = le64_to_cpu(rsp_params->user_ctx); + attr->fqid = le32_to_cpu(rsp_params->fqid); + attr->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id); + attr->dest_cfg.priority = rsp_params->dest_priority; + attr->dest_cfg.dest_type = + dpseci_get_field(rsp_params->dest_type, + DEST_TYPE); + attr->order_preservation_en = + dpseci_get_field(rsp_params->order_preservation_en, + ORDER_PRESERVATION); return 0; } -int -dpseci_clear_irq_status(struct fsl_mc_io *mc_io, +/** + * dpseci_get_tx_queue() - Retrieve Tx queue attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @queue: Select the queue relative to number of + * priorities configured at DPSECI creation + * @attr: Returned Tx queue attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_tx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, - uint8_t irq_index, - uint32_t status) -{ - struct mc_command cmd = { 0 }; - - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_CLEAR_IRQ_STATUS, - cmd_flags, - token); - DPSECI_CMD_CLEAR_IRQ_STATUS(cmd, irq_index, status); - - /* send command to mc */ - return mc_send_command(mc_io, &cmd); -} - -int -dpseci_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpseci_attr *attr) + uint8_t queue, + struct dpseci_tx_queue_attr *attr) { + struct dpseci_rsp_get_tx_queue *rsp_params; + struct dpseci_cmd_get_queue *cmd_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_ATTR, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_TX_QUEUE, cmd_flags, token); + cmd_params = (struct dpseci_cmd_get_queue *)cmd.params; + cmd_params->queue = queue; - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPSECI_RSP_GET_ATTR(cmd, attr); + rsp_params = (struct dpseci_rsp_get_tx_queue *)cmd.params; + attr->fqid = le32_to_cpu(rsp_params->fqid); + attr->priority = rsp_params->priority; return 0; } -int -dpseci_set_rx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t queue, - const struct dpseci_rx_queue_cfg *cfg) -{ - struct mc_command cmd = { 0 }; - - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_RX_QUEUE, - cmd_flags, - token); - DPSECI_CMD_SET_RX_QUEUE(cmd, queue, cfg); - - /* send command to mc */ - return mc_send_command(mc_io, &cmd); -} - -int -dpseci_get_rx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t queue, - struct dpseci_rx_queue_attr *attr) +/** + * dpseci_get_sec_attr() - Retrieve SEC accelerator attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @attr: Returned SEC attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_sec_attr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_sec_attr *attr) { + struct dpseci_rsp_get_sec_attr *rsp_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_RX_QUEUE, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_SEC_ATTR, cmd_flags, token); - DPSECI_CMD_GET_RX_QUEUE(cmd, queue); - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPSECI_RSP_GET_RX_QUEUE(cmd, attr); + rsp_params = (struct dpseci_rsp_get_sec_attr *)cmd.params; + attr->ip_id = le16_to_cpu(rsp_params->ip_id); + attr->major_rev = rsp_params->major_rev; + attr->minor_rev = rsp_params->minor_rev; + attr->era = rsp_params->era; + attr->deco_num = rsp_params->deco_num; + attr->zuc_auth_acc_num = rsp_params->zuc_auth_acc_num; + attr->zuc_enc_acc_num = rsp_params->zuc_enc_acc_num; + attr->snow_f8_acc_num = rsp_params->snow_f8_acc_num; + attr->snow_f9_acc_num = rsp_params->snow_f9_acc_num; + attr->crc_acc_num = rsp_params->crc_acc_num; + attr->pk_acc_num = rsp_params->pk_acc_num; + attr->kasumi_acc_num = rsp_params->kasumi_acc_num; + attr->rng_acc_num = rsp_params->rng_acc_num; + attr->md_acc_num = rsp_params->md_acc_num; + attr->arc4_acc_num = rsp_params->arc4_acc_num; + attr->des_acc_num = rsp_params->des_acc_num; + attr->aes_acc_num = rsp_params->aes_acc_num; return 0; } -int -dpseci_get_tx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t queue, - struct dpseci_tx_queue_attr *attr) +/** + * dpseci_get_sec_counters() - Retrieve SEC accelerator counters. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @counters: Returned SEC counters + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_sec_counters(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_sec_counters *counters) { + struct dpseci_rsp_get_sec_counters *rsp_params; struct mc_command cmd = { 0 }; int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_TX_QUEUE, + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_SEC_COUNTERS, cmd_flags, token); - DPSECI_CMD_GET_TX_QUEUE(cmd, queue); - /* send command to mc */ + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; /* retrieve response parameters */ - DPSECI_RSP_GET_TX_QUEUE(cmd, attr); + rsp_params = (struct dpseci_rsp_get_sec_counters *)cmd.params; + counters->dequeued_requests = + le64_to_cpu(rsp_params->dequeued_requests); + counters->ob_enc_requests = le64_to_cpu(rsp_params->ob_enc_requests); + counters->ib_dec_requests = le64_to_cpu(rsp_params->ib_dec_requests); + counters->ob_enc_bytes = le64_to_cpu(rsp_params->ob_enc_bytes); + counters->ob_prot_bytes = le64_to_cpu(rsp_params->ob_prot_bytes); + counters->ib_dec_bytes = le64_to_cpu(rsp_params->ib_dec_bytes); + counters->ib_valid_bytes = le64_to_cpu(rsp_params->ib_valid_bytes); return 0; } -int -dpseci_get_sec_attr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpseci_sec_attr *attr) +/** + * dpseci_get_api_version() - Get Data Path SEC Interface API version + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of data path sec API + * @minor_ver: Minor version of data path sec API + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver) { + struct dpseci_rsp_get_api_version *rsp_params; struct mc_command cmd = { 0 }; int err; - /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_SEC_ATTR, - cmd_flags, - token); + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_API_VERSION, + cmd_flags, + 0); - /* send command to mc */ err = mc_send_command(mc_io, &cmd); if (err) return err; - /* retrieve response parameters */ - DPSECI_RSP_GET_SEC_ATTR(cmd, attr); + rsp_params = (struct dpseci_rsp_get_api_version *)cmd.params; + *major_ver = le16_to_cpu(rsp_params->major); + *minor_ver = le16_to_cpu(rsp_params->minor); return 0; } -int -dpseci_get_sec_counters(struct fsl_mc_io *mc_io, +int dpseci_set_congestion_notification( + struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, - struct dpseci_sec_counters *counters) + const struct dpseci_congestion_notification_cfg *cfg) { + struct dpseci_cmd_set_congestion_notification *cmd_params; struct mc_command cmd = { 0 }; - int err; /* prepare command */ - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_SEC_COUNTERS, - cmd_flags, - token); - - /* send command to mc */ - err = mc_send_command(mc_io, &cmd); - if (err) - return err; - - /* retrieve response parameters */ - DPSECI_RSP_GET_SEC_COUNTERS(cmd, counters); - - return 0; + cmd.header = mc_encode_cmd_header( + DPSECI_CMDID_SET_CONGESTION_NOTIFICATION, + cmd_flags, + token); + + cmd_params = + (struct dpseci_cmd_set_congestion_notification *)cmd.params; + cmd_params->dest_id = cfg->dest_cfg.dest_id; + cmd_params->dest_priority = cfg->dest_cfg.priority; + cmd_params->message_ctx = cfg->message_ctx; + cmd_params->message_iova = cfg->message_iova; + cmd_params->notification_mode = cfg->notification_mode; + cmd_params->threshold_entry = cfg->threshold_entry; + cmd_params->threshold_exit = cfg->threshold_exit; + dpseci_set_field(cmd_params->type_units, + DEST_TYPE, + cfg->dest_cfg.dest_type); + dpseci_set_field(cmd_params->type_units, + CG_UNITS, + cfg->units); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); } -int -dpseci_get_api_version(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver) +int dpseci_get_congestion_notification( + struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_congestion_notification_cfg *cfg) { + struct dpseci_cmd_set_congestion_notification *rsp_params; struct mc_command cmd = { 0 }; int err; - cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_API_VERSION, - cmd_flags, - 0); + /* prepare command */ + cmd.header = mc_encode_cmd_header( + DPSECI_CMDID_GET_CONGESTION_NOTIFICATION, + cmd_flags, + token); + /* send command to mc*/ err = mc_send_command(mc_io, &cmd); if (err) return err; - DPSECI_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + rsp_params = + (struct dpseci_cmd_set_congestion_notification *)cmd.params; + + cfg->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id); + cfg->dest_cfg.priority = rsp_params->dest_priority; + cfg->notification_mode = le16_to_cpu(rsp_params->notification_mode); + cfg->message_ctx = le64_to_cpu(rsp_params->message_ctx); + cfg->message_iova = le64_to_cpu(rsp_params->message_iova); + cfg->threshold_entry = le32_to_cpu(rsp_params->threshold_entry); + cfg->threshold_exit = le32_to_cpu(rsp_params->threshold_exit); + cfg->units = dpseci_get_field(rsp_params->type_units, CG_UNITS); + cfg->dest_cfg.dest_type = dpseci_get_field(rsp_params->type_units, + DEST_TYPE); return 0; } diff --git a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h index 6cc14a6..4acb595 100644 --- a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h +++ b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -37,7 +37,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - #ifndef __FSL_DPSECI_H #define __FSL_DPSECI_H @@ -61,394 +60,89 @@ struct fsl_mc_io; */ #define DPSECI_ALL_QUEUES (uint8_t)(-1) -/** - * dpseci_open() - Open a control session for the specified object - * This function can be used to open a control session for an - * already created object; an object may have been declared in - * the DPL or by calling the dpseci_create() function. - * This function returns a unique authentication token, - * associated with the specific object ID and the specific MC - * portal; this token must be used in all subsequent commands for - * this specific object. - * - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param dpseci_id DPSECI unique ID - * @param token Returned token; use in subsequent API calls - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_open(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - int dpseci_id, - uint16_t *token); +int dpseci_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpseci_id, + uint16_t *token); + +int dpseci_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** - * dpseci_close() - Close the control session of the object - * After this function is called, no further operations are - * allowed on the object without opening a new control session. - * - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. + * Enable the Congestion Group support */ -int -dpseci_close(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +#define DPSECI_OPT_HAS_CG 0x000020 /** * struct dpseci_cfg - Structure representing DPSECI configuration + * @options: Any combination of the following options: + * DPSECI_OPT_HAS_CG + * DPSECI_OPT_HAS_OPR + * DPSECI_OPT_OPR_SHARED + * @num_tx_queues: num of queues towards the SEC + * @num_rx_queues: num of queues back from the SEC + * @priorities: Priorities for the SEC hardware processing; + * each place in the array is the priority of the tx queue + * towards the SEC, + * valid priorities are configured with values 1-8; */ struct dpseci_cfg { - uint8_t num_tx_queues; /* num of queues towards the SEC */ - uint8_t num_rx_queues; /* num of queues back from the SEC */ + uint32_t options; + uint8_t num_tx_queues; + uint8_t num_rx_queues; uint8_t priorities[DPSECI_PRIO_NUM]; - /**< Priorities for the SEC hardware processing; - * each place in the array is the priority of the tx queue - * towards the SEC, - * valid priorities are configured with values 1-8; - */ }; -/** - * dpseci_create() - Create the DPSECI object - * Create the DPSECI object, allocate required resources and - * perform required initialization. - * - * The object can be created either by declaring it in the - * DPL file, or by calling this function. - * - * The function accepts an authentication token of a parent - * container that this object should be assigned to. The token - * can be '0' so the object will be assigned to the default container. - * The newly created object can be opened with the returned - * object id and using the container's associated tokens and MC portals. - * - * @param mc_io Pointer to MC portal's I/O object - * @param dprc_token Parent container token; '0' for default container - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param cfg Configuration structure - * @param obj_id returned object id - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_create(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - const struct dpseci_cfg *cfg, - uint32_t *obj_id); - -/** - * dpseci_destroy() - Destroy the DPSECI object and release all its resources. - * The function accepts the authentication token of the parent container that - * created the object (not the one that currently owns the object). The object - * is searched within parent using the provided 'object_id'. - * All tokens to the object must be closed before calling destroy. - * - * @param mc_io Pointer to MC portal's I/O object - * @param dprc_token Parent container token; '0' for default container - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param object_id The object id; it must be a valid id within the - * container that created this object; - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_destroy(struct fsl_mc_io *mc_io, - uint16_t dprc_token, - uint32_t cmd_flags, - uint32_t object_id); - -/** - * dpseci_enable() - Enable the DPSECI, allow sending and receiving frames. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); - -/** - * dpseci_disable() - Disable the DPSECI, stop sending and receiving frames. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_disable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); - -/** - * dpseci_is_enabled() - Check if the DPSECI is enabled. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param en Returns '1' if object is enabled; '0' otherwise - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_is_enabled(struct fsl_mc_io *mc_io, +int dpseci_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, uint32_t cmd_flags, - uint16_t token, - int *en); + const struct dpseci_cfg *cfg, + uint32_t *obj_id); -/** - * dpseci_reset() - Reset the DPSECI, returns the object to initial state. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_reset(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token); +int dpseci_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id); -/** - * struct dpseci_irq_cfg - IRQ configuration - */ -struct dpseci_irq_cfg { - uint64_t addr; - /* Address that must be written to signal a message-based interrupt */ - uint32_t val; - /* Value to write into irq_addr address */ - int irq_num; - /* A user defined number associated with this IRQ */ -}; +int dpseci_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpseci_set_irq() - Set IRQ information for the DPSECI to trigger an interrupt - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index Identifies the interrupt index to configure - * @param irq_cfg IRQ configuration - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_set_irq(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - struct dpseci_irq_cfg *irq_cfg); +int dpseci_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); -/** - * dpseci_get_irq() - Get IRQ information from the DPSECI - * - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param type Interrupt type: 0 represents message interrupt - * type (both irq_addr and irq_val are valid) - * @param irq_cfg IRQ attributes - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_irq(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - int *type, - struct dpseci_irq_cfg *irq_cfg); - -/** - * dpseci_set_irq_enable() - Set overall interrupt state. - * Allows GPP software to control when interrupts are generated. - * Each interrupt can have up to 32 causes. The enable/disable control's the - * overall interrupt state. if the interrupt is disabled no causes will cause - * an interrupt - * - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param en Interrupt state - enable = 1, disable = 0 - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_set_irq_enable(struct fsl_mc_io *mc_io, +int dpseci_is_enabled(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, - uint8_t irq_index, - uint8_t en); + int *en); -/** - * dpseci_get_irq_enable() - Get overall interrupt state - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param en Returned Interrupt state - enable = 1, - * disable = 0 - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_irq_enable(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint8_t *en); - -/** - * dpseci_set_irq_mask() - Set interrupt mask. - * Every interrupt can have up to 32 causes and the interrupt model supports - * masking/unmasking each cause independently - * - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param mask event mask to trigger interrupt; - * each bit: - * 0 = ignore event - * 1 = consider event for asserting IRQ - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_set_irq_mask(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t mask); - -/** - * dpseci_get_irq_mask() - Get interrupt mask. - * Every interrupt can have up to 32 causes and the interrupt model supports - * masking/unmasking each cause independently - * - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param mask Returned event mask to trigger interrupt - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_irq_mask(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t *mask); - -/** - * dpseci_get_irq_status() - Get the current status of any pending interrupts - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param status Returned interrupts status - one bit per cause: - * 0 = no interrupt pending - * 1 = interrupt pending - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_irq_status(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t *status); - -/** - * dpseci_clear_irq_status() - Clear a pending interrupt's status - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param irq_index The interrupt index to configure - * @param status bits to clear (W1C) - one bit per cause: - * 0 = don't change - * 1 = clear status bit - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_clear_irq_status(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t irq_index, - uint32_t status); +int dpseci_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpseci_attr - Structure representing DPSECI attributes - * @param id: DPSECI object ID - * @param num_tx_queues: number of queues towards the SEC - * @param num_rx_queues: number of queues back from the SEC + * @id: DPSECI object ID + * @num_tx_queues: number of queues towards the SEC + * @num_rx_queues: number of queues back from the SEC + * @options: Any combination of the following options: + * DPSECI_OPT_HAS_CG + * DPSECI_OPT_HAS_OPR + * DPSECI_OPT_OPR_SHARED */ struct dpseci_attr { - int id; /* DPSECI object ID */ - uint8_t num_tx_queues; /* number of queues towards the SEC */ - uint8_t num_rx_queues; /* number of queues back from the SEC */ + int id; + uint8_t num_tx_queues; + uint8_t num_rx_queues; + uint32_t options; }; -/** - * dpseci_get_attributes() - Retrieve DPSECI attributes. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param attr Returned object's attributes - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_attributes(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpseci_attr *attr); +int dpseci_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_attr *attr); /** * enum dpseci_dest - DPSECI destination types @@ -471,16 +165,16 @@ enum dpseci_dest { /** * struct dpseci_dest_cfg - Structure representing DPSECI destination parameters + * @dest_type: Destination type + * @dest_id: Either DPIO ID or DPCON ID, depending on the destination type + * @priority: Priority selection within the DPIO or DPCON channel; valid values + * are 0-1 or 0-7, depending on the number of priorities in that + * channel; not relevant for 'DPSECI_DEST_NONE' option */ struct dpseci_dest_cfg { - enum dpseci_dest dest_type; /* Destination type */ + enum dpseci_dest dest_type; int dest_id; - /* Either DPIO ID or DPCON ID, depending on the destination type */ uint8_t priority; - /* Priority selection within the DPIO or DPCON channel; valid values - * are 0-1 or 0-7, depending on the number of priorities in that - * channel; not relevant for 'DPSECI_DEST_NONE' option - */ }; /** @@ -504,243 +198,235 @@ struct dpseci_dest_cfg { /** * struct dpseci_rx_queue_cfg - DPSECI RX queue configuration + * @options: Flags representing the suggested modifications to the queue; + * Use any combination of 'DPSECI_QUEUE_OPT_' flags + * @order_preservation_en: order preservation configuration for the rx queue + * valid only if 'DPSECI_QUEUE_OPT_ORDER_PRESERVATION' is contained in 'options' + * @user_ctx: User context value provided in the frame descriptor of each + * dequeued frame; + * valid only if 'DPSECI_QUEUE_OPT_USER_CTX' is contained in 'options' + * @dest_cfg: Queue destination parameters; + * valid only if 'DPSECI_QUEUE_OPT_DEST' is contained in 'options' */ struct dpseci_rx_queue_cfg { uint32_t options; - /* Flags representing the suggested modifications to the queue; - * Use any combination of 'DPSECI_QUEUE_OPT_' flags - */ int order_preservation_en; - /* order preservation configuration for the rx queue - * valid only if 'DPSECI_QUEUE_OPT_ORDER_PRESERVATION' is contained in - * 'options' - */ uint64_t user_ctx; - /* User context value provided in the frame descriptor of each - * dequeued frame; - * valid only if 'DPSECI_QUEUE_OPT_USER_CTX' is contained in 'options' - */ struct dpseci_dest_cfg dest_cfg; - /* Queue destination parameters; - * valid only if 'DPSECI_QUEUE_OPT_DEST' is contained in 'options' - */ }; -/** - * dpseci_set_rx_queue() - Set Rx queue configuration - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param queue Select the queue relative to number of - * priorities configured at DPSECI creation; use - * DPSECI_ALL_QUEUES to configure all Rx queues - * identically. - * @param cfg Rx queue configuration - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_set_rx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t queue, - const struct dpseci_rx_queue_cfg *cfg); +int dpseci_set_rx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t queue, + const struct dpseci_rx_queue_cfg *cfg); /** * struct dpseci_rx_queue_attr - Structure representing attributes of Rx queues + * @user_ctx: User context value provided in the frame descriptor of each + * dequeued frame + * @order_preservation_en: Status of the order preservation configuration + * on the queue + * @dest_cfg: Queue destination configuration + * @fqid: Virtual FQID value to be used for dequeue operations */ struct dpseci_rx_queue_attr { uint64_t user_ctx; - /* User context value provided in the frame descriptor of - * each dequeued frame - */ int order_preservation_en; - /* Status of the order preservation configuration on the queue */ - struct dpseci_dest_cfg dest_cfg; - /* Queue destination configuration */ + struct dpseci_dest_cfg dest_cfg; uint32_t fqid; - /* Virtual FQID value to be used for dequeue operations */ }; -/** - * dpseci_get_rx_queue() - Retrieve Rx queue attributes. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param queue Select the queue relative to number of - * priorities configured at DPSECI creation - * @param attr Returned Rx queue attributes - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_rx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t queue, - struct dpseci_rx_queue_attr *attr); +int dpseci_get_rx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t queue, + struct dpseci_rx_queue_attr *attr); /** * struct dpseci_tx_queue_attr - Structure representing attributes of Tx queues + * @fqid: Virtual FQID to be used for sending frames to SEC hardware + * @priority: SEC hardware processing priority for the queue */ struct dpseci_tx_queue_attr { uint32_t fqid; - /* Virtual FQID to be used for sending frames to SEC hardware */ uint8_t priority; - /* SEC hardware processing priority for the queue */ }; -/** - * dpseci_get_tx_queue() - Retrieve Tx queue attributes. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param queue Select the queue relative to number of - * priorities configured at DPSECI creation - * @param attr Returned Tx queue attributes - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_tx_queue(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - uint8_t queue, - struct dpseci_tx_queue_attr *attr); +int dpseci_get_tx_queue(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t queue, + struct dpseci_tx_queue_attr *attr); /** * struct dpseci_sec_attr - Structure representing attributes of the SEC - * hardware accelerator - */ + * hardware accelerator + * @ip_id: ID for SEC. + * @major_rev: Major revision number for SEC. + * @minor_rev: Minor revision number for SEC. + * @era: SEC Era. + * @deco_num: The number of copies of the DECO that are implemented + * in this version of SEC. + * @zuc_auth_acc_num: The number of copies of ZUCA that are implemented + * in this version of SEC. + * @zuc_enc_acc_num: The number of copies of ZUCE that are implemented + * in this version of SEC. + * @snow_f8_acc_num: The number of copies of the SNOW-f8 module that are + * implemented in this version of SEC. + * @snow_f9_acc_num: The number of copies of the SNOW-f9 module that are + * implemented in this version of SEC. + * @crc_acc_num: The number of copies of the CRC module that are + * implemented in this version of SEC. + * @pk_acc_num: The number of copies of the Public Key module that are + * implemented in this version of SEC. + * @kasumi_acc_num: The number of copies of the Kasumi module that are + * implemented in this version of SEC. + * @rng_acc_num: The number of copies of the Random Number Generator that + * are implemented in this version of SEC. + * @md_acc_num: The number of copies of the MDHA (Hashing module) that + * are implemented in this version of SEC. + * @arc4_acc_num: The number of copies of the ARC4 module that are + * implemented in this version of SEC. + * @des_acc_num: The number of copies of the DES module that are + * implemented in this version of SEC. + * @aes_acc_num: The number of copies of the AES module that are + * implemented in this version of SEC. + **/ struct dpseci_sec_attr { - uint16_t ip_id; /* ID for SEC */ - uint8_t major_rev; /* Major revision number for SEC */ - uint8_t minor_rev; /* Minor revision number for SEC */ - uint8_t era; /* SEC Era */ + uint16_t ip_id; + uint8_t major_rev; + uint8_t minor_rev; + uint8_t era; uint8_t deco_num; - /* The number of copies of the DECO that are implemented in - * this version of SEC - */ uint8_t zuc_auth_acc_num; - /* The number of copies of ZUCA that are implemented in this - * version of SEC - */ uint8_t zuc_enc_acc_num; - /* The number of copies of ZUCE that are implemented in this - * version of SEC - */ uint8_t snow_f8_acc_num; - /* The number of copies of the SNOW-f8 module that are - * implemented in this version of SEC - */ uint8_t snow_f9_acc_num; - /* The number of copies of the SNOW-f9 module that are - * implemented in this version of SEC - */ uint8_t crc_acc_num; - /* The number of copies of the CRC module that are implemented - * in this version of SEC - */ uint8_t pk_acc_num; - /* The number of copies of the Public Key module that are - * implemented in this version of SEC - */ uint8_t kasumi_acc_num; - /* The number of copies of the Kasumi module that are - * implemented in this version of SEC - */ uint8_t rng_acc_num; - /* The number of copies of the Random Number Generator that are - * implemented in this version of SEC - */ uint8_t md_acc_num; - /* The number of copies of the MDHA (Hashing module) that are - * implemented in this version of SEC - */ uint8_t arc4_acc_num; - /* The number of copies of the ARC4 module that are implemented - * in this version of SEC - */ uint8_t des_acc_num; - /* The number of copies of the DES module that are implemented - * in this version of SEC - */ uint8_t aes_acc_num; - /* The number of copies of the AES module that are implemented - * in this version of SEC - */ }; -/** - * dpseci_get_sec_attr() - Retrieve SEC accelerator attributes. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param attr Returned SEC attributes - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. - */ -int -dpseci_get_sec_attr(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpseci_sec_attr *attr); +int dpseci_get_sec_attr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_sec_attr *attr); /** * struct dpseci_sec_counters - Structure representing global SEC counters and * not per dpseci counters + * @dequeued_requests: Number of Requests Dequeued + * @ob_enc_requests: Number of Outbound Encrypt Requests + * @ib_dec_requests: Number of Inbound Decrypt Requests + * @ob_enc_bytes: Number of Outbound Bytes Encrypted + * @ob_prot_bytes: Number of Outbound Bytes Protected + * @ib_dec_bytes: Number of Inbound Bytes Decrypted + * @ib_valid_bytes: Number of Inbound Bytes Validated */ struct dpseci_sec_counters { - uint64_t dequeued_requests; /* Number of Requests Dequeued */ - uint64_t ob_enc_requests; /* Number of Outbound Encrypt Requests */ - uint64_t ib_dec_requests; /* Number of Inbound Decrypt Requests */ - uint64_t ob_enc_bytes; /* Number of Outbound Bytes Encrypted */ - uint64_t ob_prot_bytes; /* Number of Outbound Bytes Protected */ - uint64_t ib_dec_bytes; /* Number of Inbound Bytes Decrypted */ - uint64_t ib_valid_bytes; /* Number of Inbound Bytes Validated */ + uint64_t dequeued_requests; + uint64_t ob_enc_requests; + uint64_t ib_dec_requests; + uint64_t ob_enc_bytes; + uint64_t ob_prot_bytes; + uint64_t ib_dec_bytes; + uint64_t ib_valid_bytes; }; +int dpseci_get_sec_counters(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_sec_counters *counters); + +int dpseci_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver); /** - * dpseci_get_sec_counters() - Retrieve SEC accelerator counters. - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param token Token of DPSECI object - * @param counters Returned SEC counters - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. + * enum dpseci_congestion_unit - DPSECI congestion units + * @DPSECI_CONGESTION_UNIT_BYTES: bytes units + * @DPSECI_CONGESTION_UNIT_FRAMES: frames units */ -int -dpseci_get_sec_counters(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t token, - struct dpseci_sec_counters *counters); +enum dpseci_congestion_unit { + DPSECI_CONGESTION_UNIT_BYTES = 0, + DPSECI_CONGESTION_UNIT_FRAMES +}; /** - * dpseci_get_api_version() - Get Data Path SEC Interface API version - * @param mc_io Pointer to MC portal's I/O object - * @param cmd_flags Command flags; one or more of 'MC_CMD_FLAG_' - * @param major_ver Major version of data path sec API - * @param minor_ver Minor version of data path sec API - * - * @return: - * - Return '0' on Success. - * - Return Error code otherwise. + * CSCN message is written to message_iova once entering a + * congestion state (see 'threshold_entry') + */ +#define DPSECI_CGN_MODE_WRITE_MEM_ON_ENTER 0x00000001 +/** + * CSCN message is written to message_iova once exiting a + * congestion state (see 'threshold_exit') + */ +#define DPSECI_CGN_MODE_WRITE_MEM_ON_EXIT 0x00000002 +/** + * CSCN write will attempt to allocate into a cache (coherent write); + * valid only if 'DPSECI_CGN_MODE_WRITE_MEM_' is selected */ -int -dpseci_get_api_version(struct fsl_mc_io *mc_io, - uint32_t cmd_flags, - uint16_t *major_ver, - uint16_t *minor_ver); +#define DPSECI_CGN_MODE_COHERENT_WRITE 0x00000004 +/** + * if 'dpseci_dest_cfg.dest_type != DPSECI_DEST_NONE' CSCN message is sent to + * DPIO/DPCON's WQ channel once entering a congestion state + * (see 'threshold_entry') + */ +#define DPSECI_CGN_MODE_NOTIFY_DEST_ON_ENTER 0x00000008 +/** + * if 'dpseci_dest_cfg.dest_type != DPSECI_DEST_NONE' CSCN message is sent to + * DPIO/DPCON's WQ channel once exiting a congestion state + * (see 'threshold_exit') + */ +#define DPSECI_CGN_MODE_NOTIFY_DEST_ON_EXIT 0x00000010 +/** + * if 'dpseci_dest_cfg.dest_type != DPSECI_DEST_NONE' when the CSCN is written + * to the sw-portal's DQRR, the DQRI interrupt is asserted immediately + * (if enabled) + */ +#define DPSECI_CGN_MODE_INTR_COALESCING_DISABLED 0x00000020 + +/** + * struct dpseci_congestion_notification_cfg - congestion notification + * configuration + * @units: units type + * @threshold_entry: above this threshold we enter a congestion state. + * set it to '0' to disable it + * @threshold_exit: below this threshold we exit the congestion state. + * @message_ctx: The context that will be part of the CSCN message + * @message_iova: I/O virtual address (must be in DMA-able memory), + * must be 16B aligned; + * @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel + * @notification_mode: Mask of available options; use 'DPSECI_CGN_MODE_' + * values + */ +struct dpseci_congestion_notification_cfg { + enum dpseci_congestion_unit units; + uint32_t threshold_entry; + uint32_t threshold_exit; + uint64_t message_ctx; + uint64_t message_iova; + struct dpseci_dest_cfg dest_cfg; + uint16_t notification_mode; +}; + +int dpseci_set_congestion_notification( + struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const struct dpseci_congestion_notification_cfg *cfg); + +int dpseci_get_congestion_notification( + struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpseci_congestion_notification_cfg *cfg); #endif /* __FSL_DPSECI_H */ diff --git a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h index 3f9f474..a100a0e 100644 --- a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h +++ b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h @@ -5,7 +5,7 @@ * BSD LICENSE * * Copyright 2013-2016 Freescale Semiconductor Inc. - * Copyright 2016 NXP. + * Copyright 2016-2017 NXP. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -37,220 +37,187 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - #ifndef _FSL_DPSECI_CMD_H #define _FSL_DPSECI_CMD_H /* DPSECI Version */ -#define DPSECI_VER_MAJOR 5 -#define DPSECI_VER_MINOR 0 - -/* Command IDs */ -#define DPSECI_CMDID_CLOSE ((0x800 << 4) | (0x1)) -#define DPSECI_CMDID_OPEN ((0x809 << 4) | (0x1)) -#define DPSECI_CMDID_CREATE ((0x909 << 4) | (0x1)) -#define DPSECI_CMDID_DESTROY ((0x989 << 4) | (0x1)) -#define DPSECI_CMDID_GET_API_VERSION ((0xa09 << 4) | (0x1)) - -#define DPSECI_CMDID_ENABLE ((0x002 << 4) | (0x1)) -#define DPSECI_CMDID_DISABLE ((0x003 << 4) | (0x1)) -#define DPSECI_CMDID_GET_ATTR ((0x004 << 4) | (0x1)) -#define DPSECI_CMDID_RESET ((0x005 << 4) | (0x1)) -#define DPSECI_CMDID_IS_ENABLED ((0x006 << 4) | (0x1)) - -#define DPSECI_CMDID_SET_IRQ ((0x010 << 4) | (0x1)) -#define DPSECI_CMDID_GET_IRQ ((0x011 << 4) | (0x1)) -#define DPSECI_CMDID_SET_IRQ_ENABLE ((0x012 << 4) | (0x1)) -#define DPSECI_CMDID_GET_IRQ_ENABLE ((0x013 << 4) | (0x1)) -#define DPSECI_CMDID_SET_IRQ_MASK ((0x014 << 4) | (0x1)) -#define DPSECI_CMDID_GET_IRQ_MASK ((0x015 << 4) | (0x1)) -#define DPSECI_CMDID_GET_IRQ_STATUS ((0x016 << 4) | (0x1)) -#define DPSECI_CMDID_CLEAR_IRQ_STATUS ((0x017 << 4) | (0x1)) - -#define DPSECI_CMDID_SET_RX_QUEUE ((0x194 << 4) | (0x1)) -#define DPSECI_CMDID_GET_RX_QUEUE ((0x196 << 4) | (0x1)) -#define DPSECI_CMDID_GET_TX_QUEUE ((0x197 << 4) | (0x1)) -#define DPSECI_CMDID_GET_SEC_ATTR ((0x198 << 4) | (0x1)) -#define DPSECI_CMDID_GET_SEC_COUNTERS ((0x199 << 4) | (0x1)) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_OPEN(cmd, dpseci_id) \ - MC_CMD_OP(cmd, 0, 0, 32, int, dpseci_id) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_CREATE(cmd, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->priorities[0]);\ - MC_CMD_OP(cmd, 0, 8, 8, uint8_t, cfg->priorities[1]);\ - MC_CMD_OP(cmd, 0, 16, 8, uint8_t, cfg->priorities[2]);\ - MC_CMD_OP(cmd, 0, 24, 8, uint8_t, cfg->priorities[3]);\ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->priorities[4]);\ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, cfg->priorities[5]);\ - MC_CMD_OP(cmd, 0, 48, 8, uint8_t, cfg->priorities[6]);\ - MC_CMD_OP(cmd, 0, 56, 8, uint8_t, cfg->priorities[7]);\ - MC_CMD_OP(cmd, 1, 0, 8, uint8_t, cfg->num_tx_queues);\ - MC_CMD_OP(cmd, 1, 8, 8, uint8_t, cfg->num_rx_queues);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_IS_ENABLED(cmd, en) \ - MC_RSP_OP(cmd, 0, 0, 1, int, en) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_SET_IRQ(cmd, irq_index, irq_cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, irq_index);\ - MC_CMD_OP(cmd, 0, 32, 32, uint32_t, irq_cfg->val);\ - MC_CMD_OP(cmd, 1, 0, 64, uint64_t, irq_cfg->addr);\ - MC_CMD_OP(cmd, 2, 0, 32, int, irq_cfg->irq_num); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_GET_IRQ(cmd, irq_index) \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_IRQ(cmd, type, irq_cfg) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, irq_cfg->val); \ - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, irq_cfg->addr);\ - MC_RSP_OP(cmd, 2, 0, 32, int, irq_cfg->irq_num); \ - MC_RSP_OP(cmd, 2, 32, 32, int, type); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_SET_IRQ_ENABLE(cmd, irq_index, enable_state) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 8, uint8_t, enable_state); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_GET_IRQ_ENABLE(cmd, irq_index) \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_IRQ_ENABLE(cmd, enable_state) \ - MC_RSP_OP(cmd, 0, 0, 8, uint8_t, enable_state) +#define DPSECI_VER_MAJOR 5 +#define DPSECI_VER_MINOR 1 -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_SET_IRQ_MASK(cmd, irq_index, mask) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, mask); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index); \ -} while (0) +/* Command versioning */ +#define DPSECI_CMD_BASE_VERSION 1 +#define DPSECI_CMD_BASE_VERSION_V2 2 +#define DPSECI_CMD_ID_OFFSET 4 -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_GET_IRQ_MASK(cmd, irq_index) \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_IRQ_MASK(cmd, mask) \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mask) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_GET_IRQ_STATUS(cmd, irq_index, status) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status);\ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_IRQ_STATUS(cmd, status) \ - MC_RSP_OP(cmd, 0, 0, 32, uint32_t, status) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_CLEAR_IRQ_STATUS(cmd, irq_index, status) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_ATTR(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, attr->id); \ - MC_RSP_OP(cmd, 1, 0, 8, uint8_t, attr->num_tx_queues); \ - MC_RSP_OP(cmd, 1, 8, 8, uint8_t, attr->num_rx_queues); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_SET_RX_QUEUE(cmd, queue, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dest_cfg.dest_id); \ - MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->dest_cfg.priority); \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, queue); \ - MC_CMD_OP(cmd, 0, 48, 4, enum dpseci_dest, cfg->dest_cfg.dest_type); \ - MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx); \ - MC_CMD_OP(cmd, 2, 0, 32, uint32_t, cfg->options);\ - MC_CMD_OP(cmd, 2, 32, 1, int, cfg->order_preservation_en);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_GET_RX_QUEUE(cmd, queue) \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, queue) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_RX_QUEUE(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 32, int, attr->dest_cfg.dest_id);\ - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->dest_cfg.priority);\ - MC_RSP_OP(cmd, 0, 48, 4, enum dpseci_dest, attr->dest_cfg.dest_type);\ - MC_RSP_OP(cmd, 1, 0, 8, uint64_t, attr->user_ctx);\ - MC_RSP_OP(cmd, 2, 0, 32, uint32_t, attr->fqid);\ - MC_RSP_OP(cmd, 2, 32, 1, int, attr->order_preservation_en);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_CMD_GET_TX_QUEUE(cmd, queue) \ - MC_CMD_OP(cmd, 0, 40, 8, uint8_t, queue) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_TX_QUEUE(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 32, 32, uint32_t, attr->fqid);\ - MC_RSP_OP(cmd, 1, 0, 8, uint8_t, attr->priority);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_SEC_ATTR(cmd, attr) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, attr->ip_id);\ - MC_RSP_OP(cmd, 0, 16, 8, uint8_t, attr->major_rev);\ - MC_RSP_OP(cmd, 0, 24, 8, uint8_t, attr->minor_rev);\ - MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->era);\ - MC_RSP_OP(cmd, 1, 0, 8, uint8_t, attr->deco_num);\ - MC_RSP_OP(cmd, 1, 8, 8, uint8_t, attr->zuc_auth_acc_num);\ - MC_RSP_OP(cmd, 1, 16, 8, uint8_t, attr->zuc_enc_acc_num);\ - MC_RSP_OP(cmd, 1, 32, 8, uint8_t, attr->snow_f8_acc_num);\ - MC_RSP_OP(cmd, 1, 40, 8, uint8_t, attr->snow_f9_acc_num);\ - MC_RSP_OP(cmd, 1, 48, 8, uint8_t, attr->crc_acc_num);\ - MC_RSP_OP(cmd, 2, 0, 8, uint8_t, attr->pk_acc_num);\ - MC_RSP_OP(cmd, 2, 8, 8, uint8_t, attr->kasumi_acc_num);\ - MC_RSP_OP(cmd, 2, 16, 8, uint8_t, attr->rng_acc_num);\ - MC_RSP_OP(cmd, 2, 32, 8, uint8_t, attr->md_acc_num);\ - MC_RSP_OP(cmd, 2, 40, 8, uint8_t, attr->arc4_acc_num);\ - MC_RSP_OP(cmd, 2, 48, 8, uint8_t, attr->des_acc_num);\ - MC_RSP_OP(cmd, 2, 56, 8, uint8_t, attr->aes_acc_num);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_SEC_COUNTERS(cmd, counters) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 64, uint64_t, counters->dequeued_requests);\ - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, counters->ob_enc_requests);\ - MC_RSP_OP(cmd, 2, 0, 64, uint64_t, counters->ib_dec_requests);\ - MC_RSP_OP(cmd, 3, 0, 64, uint64_t, counters->ob_enc_bytes);\ - MC_RSP_OP(cmd, 4, 0, 64, uint64_t, counters->ob_prot_bytes);\ - MC_RSP_OP(cmd, 5, 0, 64, uint64_t, counters->ib_dec_bytes);\ - MC_RSP_OP(cmd, 6, 0, 64, uint64_t, counters->ib_valid_bytes);\ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPSECI_RSP_GET_API_VERSION(cmd, major, minor) \ -do { \ - MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ - MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ -} while (0) +#define DPSECI_CMD_V1(id) \ + ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION) +#define DPSECI_CMD_V2(id) \ + ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION_V2) +/* Command IDs */ +#define DPSECI_CMDID_CLOSE DPSECI_CMD_V1(0x800) +#define DPSECI_CMDID_OPEN DPSECI_CMD_V1(0x809) +#define DPSECI_CMDID_CREATE DPSECI_CMD_V2(0x909) +#define DPSECI_CMDID_DESTROY DPSECI_CMD_V1(0x989) +#define DPSECI_CMDID_GET_API_VERSION DPSECI_CMD_V1(0xa09) + +#define DPSECI_CMDID_ENABLE DPSECI_CMD_V1(0x002) +#define DPSECI_CMDID_DISABLE DPSECI_CMD_V1(0x003) +#define DPSECI_CMDID_GET_ATTR DPSECI_CMD_V1(0x004) +#define DPSECI_CMDID_RESET DPSECI_CMD_V1(0x005) +#define DPSECI_CMDID_IS_ENABLED DPSECI_CMD_V1(0x006) + +#define DPSECI_CMDID_SET_RX_QUEUE DPSECI_CMD_V1(0x194) +#define DPSECI_CMDID_GET_RX_QUEUE DPSECI_CMD_V1(0x196) +#define DPSECI_CMDID_GET_TX_QUEUE DPSECI_CMD_V1(0x197) +#define DPSECI_CMDID_GET_SEC_ATTR DPSECI_CMD_V1(0x198) +#define DPSECI_CMDID_GET_SEC_COUNTERS DPSECI_CMD_V1(0x199) + +#define DPSECI_CMDID_SET_CONGESTION_NOTIFICATION DPSECI_CMD_V1(0x170) +#define DPSECI_CMDID_GET_CONGESTION_NOTIFICATION DPSECI_CMD_V1(0x171) + +/* Macros for accessing command fields smaller than 1byte */ +#define DPSECI_MASK(field) \ + GENMASK(DPSECI_##field##_SHIFT + DPSECI_##field##_SIZE - 1, \ + DPSECI_##field##_SHIFT) +#define dpseci_set_field(var, field, val) \ + ((var) |= (((val) << DPSECI_##field##_SHIFT) & DPSECI_MASK(field))) +#define dpseci_get_field(var, field) \ + (((var) & DPSECI_MASK(field)) >> DPSECI_##field##_SHIFT) + +#pragma pack(push, 1) +struct dpseci_cmd_open { + uint32_t dpseci_id; +}; + +struct dpseci_cmd_create { + uint8_t priorities[8]; + uint8_t num_tx_queues; + uint8_t num_rx_queues; + uint8_t pad[6]; + uint32_t options; +}; + +struct dpseci_cmd_destroy { + uint32_t dpseci_id; +}; + +#define DPSECI_ENABLE_SHIFT 0 +#define DPSECI_ENABLE_SIZE 1 + +struct dpseci_rsp_is_enabled { + /* only the first LSB */ + uint8_t en; +}; + +struct dpseci_rsp_get_attr { + uint32_t id; + uint32_t pad; + uint8_t num_tx_queues; + uint8_t num_rx_queues; + uint8_t pad1[6]; + uint32_t options; +}; + +#define DPSECI_DEST_TYPE_SHIFT 0 +#define DPSECI_DEST_TYPE_SIZE 4 + +#define DPSECI_ORDER_PRESERVATION_SHIFT 0 +#define DPSECI_ORDER_PRESERVATION_SIZE 1 + +struct dpseci_cmd_set_rx_queue { + uint32_t dest_id; + uint8_t dest_priority; + uint8_t queue; + /* from LSB: dest_type:4 */ + uint8_t dest_type; + uint8_t pad; + uint64_t user_ctx; + uint32_t options; + /* only the LSB */ + uint8_t order_preservation_en; +}; + +struct dpseci_cmd_get_queue { + uint8_t pad[5]; + uint8_t queue; +}; + +struct dpseci_rsp_get_rx_queue { + uint32_t dest_id; + uint8_t dest_priority; + uint8_t pad1; + /* from LSB: dest_type:4 */ + uint8_t dest_type; + uint8_t pad2; + uint64_t user_ctx; + uint32_t fqid; + /* only the LSB */ + uint8_t order_preservation_en; + +}; + +struct dpseci_rsp_get_tx_queue { + uint32_t pad; + uint32_t fqid; + uint8_t priority; +}; + +struct dpseci_rsp_get_sec_attr { + uint16_t ip_id; + uint8_t major_rev; + uint8_t minor_rev; + uint8_t era; + uint8_t pad1[3]; + uint8_t deco_num; + uint8_t zuc_auth_acc_num; + uint8_t zuc_enc_acc_num; + uint8_t pad2; + uint8_t snow_f8_acc_num; + uint8_t snow_f9_acc_num; + uint8_t crc_acc_num; + uint8_t pad3; + uint8_t pk_acc_num; + uint8_t kasumi_acc_num; + uint8_t rng_acc_num; + uint8_t pad4; + uint8_t md_acc_num; + uint8_t arc4_acc_num; + uint8_t des_acc_num; + uint8_t aes_acc_num; +}; + +struct dpseci_rsp_get_sec_counters { + uint64_t dequeued_requests; + uint64_t ob_enc_requests; + uint64_t ib_dec_requests; + uint64_t ob_enc_bytes; + uint64_t ob_prot_bytes; + uint64_t ib_dec_bytes; + uint64_t ib_valid_bytes; +}; + +struct dpseci_rsp_get_api_version { + uint16_t major; + uint16_t minor; +}; + +#define DPSECI_DEST_TYPE_SHIFT 0 +#define DPSECI_DEST_TYPE_SIZE 4 +#define DPSECI_CG_UNITS_SHIFT 4 +#define DPSECI_CG_UNITS_SIZE 2 + +struct dpseci_cmd_set_congestion_notification { + uint32_t dest_id; + uint16_t notification_mode; + uint8_t dest_priority; + /* from LSB: dest_type: 4 units:2 */ + uint8_t type_units; + uint64_t message_iova; + uint64_t message_ctx; + uint32_t threshold_entry; + uint32_t threshold_exit; +}; + +#pragma pack(pop) #endif /* _FSL_DPSECI_CMD_H */ From patchwork Fri Sep 8 08:45:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112034 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1245321ybm; Fri, 8 Sep 2017 01:48:45 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBPXF3K+NKbEr1RegwtJg/70nc+52Fa2asfJZ/y2gqTlViNubSSbD3aNcUyS1ko6Nfl9Txb X-Received: by 10.28.185.202 with SMTP id j193mr1067825wmf.130.1504860525130; Fri, 08 Sep 2017 01:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860525; cv=none; d=google.com; s=arc-20160816; b=rJmVO5IOUyU8JBjYIS1bcM5DjweCrCngjdnxhLKUeP0Fxd1f7Ntko0M8hrT0NXeCR0 iC9sVFIm1VEEuRUqtmexCH2bV7ui0CzcUrU3/Kkmr0Tp5I9rEXbajLL2jZL3uMJNf1Gh qrJ0KqFj25N1wMiI57D2wIL8tT/YZuJgmeYFvZvlyiiWVD38RZDCwMQgXK9S9+w60ne3 uQVvqczw7NwkhOGtbHO02n0T09y3CzmvIV4nEQtER8upgfEny/LzGRCcdDdlKb//DWme ai2p3UKpT3PHfchQfA60EPvmO0wwMX07DS8iVJ9oL6qGMZ+gqG9bID8Juj4k467dUe8h HZdQ== 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=X2XGdiCS4upodAJH6hNqvWPG+vRRv7QmAbnGXNUaZKw=; b=OxEbjcn0inhNSYy/II9miClWk/QWO+vCt8vDe48uqaSoEUU8aX+p3DBs4SC+kCSxv7 OGaqtHNAQ60yEIumwWN+8E2mYHEmbrehPv5vYsjP3eb/Nk04tFxAZOZmgReC8gwsB3JQ OmTgE5K1/7ArBlMtGyq3UETeATD5CY8lk87OoDMQ4FGEKbvb/W/qaWrdrO61awEZ2T3g G2cbhQpBL0butzyPH5M0xqurCbklMxtyqvBIz5xlSTHxMTE5Lhh/LTnp20u3OfYvw/Nu eL06w5tennJXT0iXK6tJbe7DzD2rvth0Uk8RpaOaVUNiA550F89nvGD6UjFC7Pwxzc40 +HDg== 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 k57si1096870wrk.37.2017.09.08.01.48.44; Fri, 08 Sep 2017 01:48:45 -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 6333E19A02; Fri, 8 Sep 2017 10:46:20 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0077.outbound.protection.outlook.com [104.47.40.77]) by dpdk.org (Postfix) with ESMTP id 4895F199F8 for ; Fri, 8 Sep 2017 10:46:16 +0200 (CEST) Received: from BN3PR03CA0114.namprd03.prod.outlook.com (10.174.66.32) by DM5PR03MB3324.namprd03.prod.outlook.com (10.174.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:14 +0000 Received: from BL2FFO11FD017.protection.gbl (2a01:111:f400:7c09::185) by BN3PR03CA0114.outlook.office365.com (2603:10b6:400:4::32) 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:14 +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 BL2FFO11FD017.mail.protection.outlook.com (10.173.161.35) 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:13 +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 v888jmoi023063; Fri, 8 Sep 2017 01:46:12 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:09 +0530 Message-ID: <1504860327-18451-13-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: 131493339737904357; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(8936002)(68736007)(33646002)(110136004)(6916009)(6666003)(2950100002)(53936002)(47776003)(104016004)(5003940100001)(5660300001)(85426001)(48376002)(50466002)(50226002)(4326008)(77096006)(54906002)(356003)(305945005)(8676002)(81166006)(36756003)(498600001)(2906002)(97736004)(86362001)(2351001)(8656003)(76176999)(105606002)(106466001)(189998001)(50986999)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3324; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD017; 1:r/j9PuWXFPjFM5mkBt1i7VQe+VhbvEP07FVfLF/5epN9dt6gsSJwUJmrSXzWtNtL5mjXcRsLWkKdKWAwvfxu33tK9Ojy5u4C53PnOrgJ1emabFyq+wKWOBQXHlecq5zR MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28371b41-727f-474f-54e5-08d4f6960fdf 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:DM5PR03MB3324; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 3:BnneLkWgUB/zLDWNPy6PG9VP1KFZ437/QJt/0SaYDP05pzDmrSydHkTxTBaOS7JudqgJgEBwQcw41JeRJZRmokoR162rhHUe/88fCYhcYmhyAOS7VBiqhb7duvkjD92DBNyPXxzX8T2qyp3w8utaAJzEBXoFuYzUhOCuZIFVf3FjL+/NxJXMq9VBzKPpScgwXn0uCsfAkIlIdPng9nFsoofcMHlKZp1dg92HSp4FPhk7dGyhFp2uSMd31h2ShKsH05Ho2uGiCW+cqxh3h3pL53anEvbKujKwyKVmPnCkEvHUv9duZJsat3+d+LX51dFe/Nms1rE3ecSy15zd9uGO88g1bE+Uj2EjWhzfqVeHiHs=; 25:yfkHNMjX/l/H0l1/hV1kqvcJSXqpAQB71t394vZDsRMWIj0STDFywIv7qOzr2Olw1oUYLx2ucqLoEXa/ceUR1xOcL1p+CqvKFPaXo1FzrFkcUrASk/TBbYtBE03pLAfzMZ/DILv6qlpXbOLbBLgdcfpOExqCQxnp67dgLy5QPG+U7O6hwKX9VuGyD8/k5tnkwUmuixQ4hE06lYrHdSpHbPKW/3LlQsj/s3sF6XSpxxVfV8WqaSTzZl1VRqBFWtCj3EjIc6UQKs+rNTgddkpxUqksttzul9bXnoizyCqFBfFtClzi7eFolNcMnjZ0+skuJmECSL0HvTZw6fLAz6OuQA== X-MS-TrafficTypeDiagnostic: DM5PR03MB3324: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 31:tZcP3nlbldcZqVk0N2DR1wxUEnLo/k+RcttZyiIGykpkW2+yyW4F77u0CkO7m67N4YiCz2fRNxRm1tM2XE5YPw+kkrwFde1g7+lEpwJsoYdGW8ofbLXnmNUcSOHNI48rwjx2st4Q9DfvboyOpxxKcPjZ03pJQD06X3Ba20dIQgW5ZPI1oq6S7VkcGvBdrN+CKM5lIPAE6dH2Y8Q92N5G4DPVXfbHxTg4MnvcZz8hrMI=; 4:0n3IJU089Xn9/eZVb/j95KnNAIBuCzpqAax0cvMdB4ZZAcm0lUw3tmZGtLUp1cohehpBFp02THVDmFuxpsa7qfvIo0IGqCpwwnDd8f4g4S7fml37A0yXBuhRgB6VD5AcY7gslYN7lBhlTbY772k5hlYl20a3w/2N4t2xig0z7EW5532ELwIs1POtK2bUhPpEL/E7LtWd2btRChAxaX0i7EtT6Uc1yaJzaPytPyaFqqy74+MNqj05Ytt38taPFCUYeikGgdSxMyVFef6JMadQL+aHH0iNO0oKGWbHwJB/dqg= 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3324; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3324; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3324; 23:bsiNG9Cd6piyYQ6j1qQxa6sbtpxVa8Gw1UIc+iQ3A?= CEnDTl3/cS3taE3165rGdMBJ0DWoDOKXA0D17Mydk4bTIWI7KxvBm0zKnNfZgoC5/GX7WAu6MeUqCkHa5DZSlY6Ndwjiz1/msdqM0bPYEefSuwN6cbEGaeRWQBjXSBFrZqPnQSAkGGJ3Y8tjWYrTpTsQr4w3HA4VrTLq1PajilbeTRWkqnFF+yKAgfdI9wskCykLPFeW9nqm9AiXGzdquSphzrrP88A3ER0N54A8WPIb7mcD+B/5Jh+O8zi8AFdBKBnleD5EM1GkQb4pprsnkkpQq4YxayPM6YXRllX6IJVIUF98VMEmRhHmkzU3nSSVnECHZUFjzD2VBfKT3xl2SxCSu8Q22QWTOusm3IJuahz1KMkCOlMThZMNpmJiTZYs3R4R/tYO8hOAVsCYl+bMhkSfW6V5TELLbK8n5klBc7F42v6Ye5sle86qmWVI1cTGp2tr2+i2dzyrap51AQ7xThNCcN9Ex7oPDn+JeFPx2GaognFJdpImbsI5CKsvVlkdMY8U1unN2T8haWZyBjyTQ/BKovCvvf0LDrpUmJ7N/imz/tiq4swAjWbhDky0M9Pfl2j/lH4z8BrGOlGQ9PTcIeTjSStsQJyEf3xsTi72UY8Z0AMWu0L82Xqn7w2+PgMCmm3UVWVHXv2CsILVaPCWH9mvy8h4GhrijEjNoEt7hCxAUK/WgSTNXDGbvuxV/XivV5l8dGqIjTPL7e7s+W+IgN6GzAheSxJm7zrdKRfiQWkLcHdK6b1Uob/MAjOgutGZBoFhhR1aL6fj3H8eT1zJ2HVMDApHzBkJqT6q1bZ7rOwOv8cFjdAZyx+w6tzsELrm71wBGAqELXgV5JZROQg+A1o8N2Ap84k4G9JFsa+YoxyX7HVnq98NPK+u3FZNN7UVUp3oIdGy9MnKt9Jt6AS1c34e40l8S6kYv3PRlVjoeGY2pFGIFhmFWXtcyoCqMjwvJyBiZs6FxdtujXJkjZ9YufIyRFk5lZaOlSg7nROeFI682A25r9ltX4neBkApQAq10O2+KkPfX/X30snmxA+fpBk85Pg/epWln1ko9y/6Yn9P+7pnNK1kl1uypnO5eo3C8E= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 6:9GF+PC7dAOkHLGHkPvmudNob/b4G7qJ4o0vg4XcylsDTZHtApH/V1zFKhHDwEJd4wIZOTdeLU3iIfn6fLc9L6LjWK1pSNlMYmCmGSL5FPTMHOCmG6bUV3F7I5Gwtlh/Z8D6a2Aa4YLKqEvtXRBZ2RzIoCrot0gNvHqaRQewumdm7BnhmoXSZiJ+2bexLJvUFrLFVHsAeMc10Htlq3rAvBF1atZop0mccOL+IFLeQz3+TW16nkILfAUAV3ZaJhkRnlgMtoao3YLkxZvnMA5PTdeQLUS96Tv+TXSn6aSc7klvOYXC7c9BpWboREUbP8Q66W+Ofo5AjBmeNpoQE81C6ZA==; 5:81fltvgIn0dEQfakviVX/l98uOpA71qAbx3l4sNWG5cgmDfLNxG5FAiNI7YQIcvooeRvaC8TlGyti5DxFhixuInnc62jADFNd4Ic5iN1Mqwxk0AQHDfGKdf0YhIcu4FVvhB1+LmHk0wZY3j7k9I/sQ==; 24:ybBhIfmTXWZN+fKjnYwWMol+4GgLllbL6DDt1i1pSNrXs81dK0Mm31R3fEffTxzs19Xoi/GKLXQGojsPuSAInTPnDqTFUE5MEeaxHHDEIwA=; 7:dBOuwvaT7GJGRqivOKlu5HxfqEnMfAG1yMS+/nibJkikm+O54fY+9bN5HKfc1+pyUpMad2iEl0okQ3aBerk8Yw9RDYSJTJNzJOftEqfZ6oA3M5ljLAh/LK7HCDBkUQLd9bCXKF3SGi9F37Ejj/ogo6qDQmU5SMgXysdOK6HKzD+WCy46QVJkVQMexcXdZo5RetgfojY24kdKBAvpzG0YGW+fTSMRtfTfADpegbPmOZo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:13.6188 (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: DM5PR03MB3324 Subject: [dpdk-dev] [PATCH v2 12/30] config/dpaa2: change max lores to 16 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" From: Ashish Jain To support new LX2 series Signed-off-by: Ashish Jain --- config/defconfig_arm64-dpaa2-linuxapp-gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index 8a42944..91f4993 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -39,7 +39,7 @@ CONFIG_RTE_ARCH_ARM_TUNE="cortex-a72" # # Compile Environment Abstraction Layer # -CONFIG_RTE_MAX_LCORE=8 +CONFIG_RTE_MAX_LCORE=16 CONFIG_RTE_MAX_NUMA_NODES=1 CONFIG_RTE_CACHE_LINE_SIZE=64 From patchwork Fri Sep 8 08:45:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112035 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1245679ybm; Fri, 8 Sep 2017 01:49:03 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6kpSZnP+HA6LUoQGq963+COdrWDiICja4e+WXT8ynbNLyMb1KpLV/VtnUh1t5Hqkqed884 X-Received: by 10.223.196.11 with SMTP id v11mr1398233wrf.21.1504860543672; Fri, 08 Sep 2017 01:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860543; cv=none; d=google.com; s=arc-20160816; b=ZmyOFCHnrN9tMl1lPRugEdnLy0qsxKom0Ax31kzBrUwYv8Zm3jT1haz0q2yGORqDLi awy3OOCsjKR5crleX/68g7a7J398rq3sAzWO4X/ekH5ZYgPav0aS7QTaYDTPqnIipXy4 YWfU5GmfmSnvmJT3umvEkx5cCxqIaDbwMICTx6gA+nfuEqKK+1h+Ph6ItunR6xsDxhsF PkXzofsp34TkpFfTEg+KhHbaVh9V8ulFTxhWCsUBcnFhUn+X6lfxO8JxLDSh0ASNFwmE Gf9Fb5XmzAIWs+FeUUxKgecDZcmujqjJrhpbFLmuFQjFm/fPP99bS9NhEPXGdu/B2MDV gNJA== 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=glJJ0ACGQ4I9PvO8IDuyxh0J+xGSYF/Z7x83A3lUeWY=; b=rNqTcBNJcQjFVzwrXKk0q8h2tFgvPsmnTuEtxl6j0fsgwYVhwL52pqLKjGXSVSH4t1 aAUIPPpaspb/WUZPkWUwmEM0XJ4xjBY+9Y40ZJhIWY8rkIlhvdIIlgjFsucSvXVyGNhl Jy1sSW4iV5t7E3ymiS6eGaurIm3GINVgBpuozRcpDK+Kwyl7nAK4DsRdEGLLyH9z5KPv dri2gj6eMgHugpoXcznQf7/zCVHR0YOJwVuUyIW4JPDOyrGetZuD2tQEvIwkomh0o8UK MiHmk+J6M49rBNcadyZJbr0hff+HtVJbNtCsbKe2PZoj+qV58ZxmdFXomI6/tpR7uHon LjqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id b126si975818wmb.216.2017.09.08.01.49.03; Fri, 08 Sep 2017 01:49:03 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 663A419A10; Fri, 8 Sep 2017 10:46:23 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0055.outbound.protection.outlook.com [104.47.40.55]) by dpdk.org (Postfix) with ESMTP id B2D03199F4 for ; Fri, 8 Sep 2017 10:46:17 +0200 (CEST) Received: from BN6PR03CA0089.namprd03.prod.outlook.com (10.164.122.155) by DM5PR03MB3324.namprd03.prod.outlook.com (10.174.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:16 +0000 Received: from BN1AFFO11FD036.protection.gbl (2a01:111:f400:7c10::129) by BN6PR03CA0089.outlook.office365.com (2603:10b6:405:6f::27) 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:16 +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 BN1AFFO11FD036.mail.protection.outlook.com (10.58.52.240) 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:15 +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 v888jmoj023063; Fri, 8 Sep 2017 01:46:14 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:10 +0530 Message-ID: <1504860327-18451-14-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: 131493339759712640; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(8936002)(68736007)(33646002)(110136004)(6916009)(6666003)(2950100002)(53936002)(47776003)(104016004)(5003940100001)(5660300001)(85426001)(48376002)(50466002)(50226002)(4326008)(77096006)(54906002)(356003)(305945005)(8676002)(81166006)(36756003)(498600001)(2906002)(97736004)(86362001)(2351001)(8656003)(76176999)(105606002)(106466001)(189998001)(50986999)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3324; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD036; 1:M1XyHhAoH4zTbVI1si7Po873Vp9E3nuJfsnd7Zjm/8pj6pgcB5138qb+0cT0Cbafmu0pVtnDBkIyPrQ4jCKNv6sYDi5RABYY0TJxJdynafbiywVPUt97CZvZPjZdFjHa MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72a4f988-0403-4fab-1980-08d4f696112c 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:DM5PR03MB3324; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 3:GXs8iQyn4biVpYT4vM2IYw1JIuvdfTrPfVWQ7hIbIKXIgzudGrodKHTsZWtfG4Uxl16aP9jX8Ua+DvPP7QJ1Qv44pK8F37Ijf0cp9OVWOn2UFc5b3eGqWzEJQhLhidxirk95J8BiHyrDna7bn98+1Y43FovC8OiwKDu6Piya6h3VmxWxlE1HQnY4AUGCSWA4IU8SPqVUHJpw4xwOL9ijdWNFDor290PkPMf/f3E3JGKeCDDI6OSrJn9DeH4HD0nUxFaUeP/2H+8nrWI1iTsmianmJzEo5/0rUQholdosDw3IIl1J9TYJ5LOhJEeIvDZx713Toos2cSa+EiwAt1BYrqNs2I4oMCP3rtAD4mXHuAg=; 25:RJhGlDIaEQfEh/pUF4xhcFe5Rqn9Q7Yb+l4AlrsrY3fsDzSTlyo/by7siPeF18Mo7aame7CN/DJTkzVgng20W8VnXFCGFThmFzNvZc/rCnbcKQNDbkfhdvkfV8AggcQ+HwWoj1G9cVnvBiZjjLPob97rEqUdnxqLiE8vmMH7VdIoaBM5S2pqXc1lP0b7I24/ed1pMBPieVi4XaeQF9/E88AADYKjscJvtMfmMBbFGKixSgEDCigQrJPgHBNK0TpZ6rx6nwoJbChHYC8GHKcvIK1y22f5NdrXCjk+/qzaVwNmT8AXTDTJpvWD4hIvkPidd7wlD6HpB/ZMNZ79nRtUiQ== X-MS-TrafficTypeDiagnostic: DM5PR03MB3324: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 31:M8pI6+d43IC3yn/c0OKQO3qKsp+EiIDpBS5UXVNqJAlun7T1iKGyMY574jJ8VdLO28RF6f3hznZWLlHF9HohOsVrFLgYhcrvd9wfa2pUVcJYSQ9jXFJemjFQyz0uUJ1w/CuPTKcXIAgGAOP9gqUfCWMb1DbDo35LSzAVRWRkEdRevX84an0k2TvHAWsDUmW8pYNKIeLBmjHlXSY7gQNjG1vvO+cx0JFQDmb2UVmcoP4=; 4:sLhS15gUf0vLj2q5XdP67Usk+nRJl1v1xnR5OW3sihzrCUZBkkOcPpjN1u76N+XQapI2x+siR0juYcQTdbCocqgF3+w0cFFSQ7zGJ4JMbRtpMMwc6V/UaR+2NospBQD5jgNB+o4SpMdmka8TnwLpkZDpc5mk7BtJHHlRYzqRDFxqIHmrQEooY7dTfBeQPBfoZerKu0S9aDsnW1cBvtlKMopya+Jtp+YiEPfIjuaGT8NGNIsnickO6q4Axo2t931mzfcKoeDgOBxkCnwLxcIjMSGFHN8TQ/mRj7eLElcDaoJTUPiojADhS3wSGu3s8Ia7kyg1cHCsYB5AE1sgNI9zjQ== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3324; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3324; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3324; 23:7o0p9ju9gJr9nH1WOubo8T0pi8r4MqO+we4vg6w8m?= p2R8BjD8pw0/BUZWDvJKlq9RfpvHEyrEUgO7UfjWA6BNOyqnvScH604Xta1YonDGmN8/KFKM0kqx2fsD5IX8NsOyCZ5dIecpRUTGt92kLhtBkAg0puQQ9vONMBQiRJQi9HfwkKkYzdn8QiQh+ILJ0fyp9M8I1JXq7Ygxy0F+9MefL5EwuALdbWZWkNiiMj2/fGTb9eUJ98tFL6o3WpQEzqmvK48xrQSGgTntouqI30IceVMxLsL2nU3I5fVgb5TDqMSV7hJNUCtj6NcN9iY9P3XMb3CelYxGa4H79WaClc6QGEXasyLyqIyQX0bXbhKYIJO5stCBgPEQUuvOOfzUyPw3953j30ew6kUMq9lTu3pkLh23zyV2OZy2ZBA7+iU+zpGsamsz6RwijkcKnxNg1sZmi4T6EqBw4g6byRRMMV2v1ywCz49CgLdjyEt10mlGCzlMs/hQNJlupG/fnmC8Aj1heL3gzt7b45M5mxpcEdlI9h4IPFJ1tWOIiNIt0JW5OQq3QTGXoEmPeC/JQFMweWOiDJ6IiqmWfPkTY8z/baVgAMx8HnreFvByopThQMY+yb88ml+ElCnE9Hn9GKR3yvQ8YZfMI6WT5H/WBbyIlt2Cynla+2vySsH522GRErjr3amBe81QjD3bo/9Ks+7AspBD2+AAF/TShu7bVgjF7SNqEc7c30+kdR2l/xVp9UhB9p81L7Ppw5sBxoEXlzjegzzEpBmBOSn++PYqARaz1mXgL0joY+hjvapORt3tjaBHR9qyg4p7fsDU8aLtH7N5j7/7do6vslcLwpAgCFu0WEen77Dw6RqxZ6HkstDvKpgdP0gr122pEIlrZZ5/ruRHtDknIUD9Ox1zf0pZbzE6JIv/HyL/VzsfgPSI0QU8ag748sxBL4XmBRTOfsj/KObTkUDq1p2aAuAyRBsVKP0/eipUf/fo8OXukZxIXbt3FEsFcsDNO6XWlASQxw1OmWQpzuA5q1TisA5pJ14bfqH2M5qhxnAuwRYoNeVDX1bNgTw61OAbdOHQWPTWNxuINRlUPNxFiUK8iRinh5P/aLS3WySkumDTcOCc4WR3YVA1E2sgVY= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 6:ZVe/5SEIEsZ3D7h9TOJKWWGKNpnvbQkpTxxP2ykIbA7V361R9RkFnFLsmfsq/BZFOA4626laDnAV2iuvVn1FAGAaMwQbSji0H/Av5d94glVzzgD4hxnRdp6g06eunlmw2lglptqiPDFyd+sOhP4vZq1WAAuhZxr3XHnClwgekKgC1hGZXHGSM2ydyHqnHfgvS3i0PI0WxOc51lamINCzrxJBKqSgbJgOjBv42sH+M8dKTXcPPdvCZYESulLGKyfEMfRwTFuBUrb/6pNIuXkcyclOZQi+pQewpu66bgLhl2w5M5P7K0Bi0elES/aHpd257wd5/7ToSYtRSqXn3JmMKg==; 5:1xhA9Tn116d96Sh6HF7DXQU/r87C3j0OUu1ZI70ql6idrOdJo+95R6EozVFo2LkGmGraQAsEBc6hhuPr4GKRD2s2z5s0hloPqJrlZ5EPUF6+WHJQKYEaEgovt/QYhYxzBlcoqUhjy2qgGeESzaORQw==; 24:eBuJW7V+5HEDWv8JIhkpUG0CK7rYr6to3Q69O0657msXX7+kLhtve6HS6vNCkYPIZsN2nwvSHEXswTA/G1UjmaEMhG4Q2JsZ0PAKrWBzSQA=; 7:JPlEMwjCr1zcopxco5Jmtv9oXdUt6YflvLB0Lh4kdhnq3y+3s6y0/DySxCcnzlYQPxJBD6FiCus4hY2S/6EPirCYlA3ayWG0Ydpwu0BTNDc5Iw+HP70fSV3nrs7c/v2dNNVYvfx4uygh5BsJU3EoaXZ1QZEer7ehZZfE1WT04xZWNRAdaViAhuCpL/YFrBbOWvz21U79emDwguQZWtvuiO24jI71MuBlG9S5E96pF6s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:15.7996 (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: DM5PR03MB3324 Subject: [dpdk-dev] [PATCH v2 13/30] bus/fslmc: add support for LX2160 platform 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" From: Ashish Jain Signed-off-by: Ashish Jain --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 22 ++++++++++++++-------- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 1 + 2 files changed, 15 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 7315555..8db1f6c 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -90,20 +90,22 @@ static int dpaa2_cluster_sz = 2; * Cluster 1 (ID = x02) : CPU0, CPU1, CPU2, CPU3; * Cluster 2 (ID = x03) : CPU4, CPU5, CPU6, CPU7; */ - -/* Set the STASH Destination depending on Current CPU ID. - * e.g. Valid values of SDEST are 4,5,6,7. Where, - * CPU 0-1 will have SDEST 4 - * CPU 2-3 will have SDEST 5.....and so on. +/* For LX2160 platform There are four clusters with following mapping: + * Cluster 1 (ID = x00) : CPU0, CPU1; + * Cluster 2 (ID = x01) : CPU2, CPU3; + * Cluster 3 (ID = x02) : CPU4, CPU5; + * Cluster 4 (ID = x03) : CPU6, CPU7; + * Cluster 1 (ID = x04) : CPU8, CPU9; + * Cluster 2 (ID = x05) : CPU10, CP11; + * Cluster 3 (ID = x06) : CPU12, CPU13; + * Cluster 4 (ID = x07) : CPU14, CPU15; */ + static int dpaa2_core_cluster_sdest(int cpu_id) { int x = cpu_id / dpaa2_cluster_sz; - if (x > 3) - x = 3; - return dpaa2_core_cluster_base + x; } @@ -278,6 +280,10 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id) dpaa2_core_cluster_base = 0x02; dpaa2_cluster_sz = 4; PMD_INIT_LOG(DEBUG, "\tLS108x (A53) Platform Detected"); + } else if ((mc_plat_info.svr & 0xffff0000) == SVR_LX2160A) { + dpaa2_core_cluster_base = 0x00; + dpaa2_cluster_sz = 2; + PMD_INIT_LOG(DEBUG, "\tLX2160 Platform Detected"); } first_time = 1; } diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 5d7a828..bb52a15 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -51,6 +51,7 @@ #define SVR_LS1080A 0x87030000 #define SVR_LS2080A 0x87010000 #define SVR_LS2088A 0x87090000 +#define SVR_LX2160A 0x87360000 #ifndef ETH_VLAN_HLEN #define ETH_VLAN_HLEN 4 /** < Vlan Header Length */ From patchwork Fri Sep 8 08:45:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112036 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1245925ybm; Fri, 8 Sep 2017 01:49:16 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6hWfhhbKGL010ppS+mzp8UzFPQSqgfxg3ndXaUs5PzHji/WFCotabJC26fMBam6JVhYtvJ X-Received: by 10.223.187.148 with SMTP id q20mr1688484wrg.34.1504860556343; Fri, 08 Sep 2017 01:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860556; cv=none; d=google.com; s=arc-20160816; b=yS467lH3kfUg56iGqA9EFokHBcGxheGtDqR+2nIrvDjXKPCU7Xbt+9P1gkHxNWBrpz B/+NJo8nP3mLknB+R6sJlSmmwBu/QfcYIB5+uleB6lsvmmW1voMp2176fbGmSLnaE1u1 4XpUwHWHYO/OUn+AYz0vQ9doozLPXF2WLb+ypwRm7n03AYoI2zKiC1h8kiBckLIZl+zh ffxGWe2Mr/tvrm3Nn4z4X7imgkJ8SkCubCJlDKbrLbaUj0ypezbkTnm49rwATVD6lCwd P0OXsZ7WyhPmSljPjMkUFZiz/bYk42H/fbG00iqUQhLfHflTpMThHsxQ2YRRT7hPtLe1 IqGA== 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=jsg1zjxoMjBsMxWqo3N3g9209JIMgBrXSbbB4MLqQP8=; b=0oO3Eb/mhCJuF0AzinEZl0nZw0qj377AplVRFAI8CDPE4UQJPIkk5vXfKbbYyWLkLk 2qQAVjm/qoOwg+2uBZGdJfqfLdk9vIc/VZQn0+dwRTPCfBA+y8GTECF8StN6VoAPmzL3 k6RVfBR+OxzcZInXrhcnRalNqAZgikkJ/f7+VW927cSWKH7yZlCLlozgvQiaJO7xqKQc hYlUncP/TQdjBZcpSk4YeQklXFmcjqyFL04iYAlRINtbI5JSJJpG8QWLm6hJX2hRrIIE jUnKUw6z3b0f/Qdn+mAPYKALCge4OFmcFJzlTk05Ffcosd+9TO+6/J00FCt8WiEfI0WP Zskg== 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 y184si1015218wme.126.2017.09.08.01.49.15; Fri, 08 Sep 2017 01:49:16 -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 0D1C719A17; Fri, 8 Sep 2017 10:46:25 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0074.outbound.protection.outlook.com [104.47.40.74]) by dpdk.org (Postfix) with ESMTP id F3358199B8 for ; Fri, 8 Sep 2017 10:46:19 +0200 (CEST) Received: from BN3PR03CA0097.namprd03.prod.outlook.com (10.174.66.15) by DM5PR03MB3324.namprd03.prod.outlook.com (10.174.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:18 +0000 Received: from BN1BFFO11FD033.protection.gbl (2a01:111:f400:7c10::1:125) by BN3PR03CA0097.outlook.office365.com (2603:10b6:400:4::15) 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:18 +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 BN1BFFO11FD033.mail.protection.outlook.com (10.58.144.96) 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:17 +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 v888jmok023063; Fri, 8 Sep 2017 01:46:15 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:11 +0530 Message-ID: <1504860327-18451-15-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: 131493339781613254; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(8936002)(68736007)(33646002)(110136004)(6916009)(6666003)(2950100002)(53936002)(47776003)(104016004)(5003940100001)(5660300001)(85426001)(48376002)(50466002)(50226002)(4326008)(77096006)(54906002)(356003)(305945005)(8676002)(81166006)(36756003)(498600001)(2906002)(97736004)(86362001)(2351001)(8656003)(76176999)(105606002)(106466001)(189998001)(50986999)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3324; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD033; 1:3F2GKJ53imcdmn1HlUQ4mv5WqIQNW8Fr+vXSprnNqjnfcYzHZfiuVVWAqkxLqCooMzWecuKi85negMaqgjHcyFZSg1LiegVBghFT2H4ZJkIzOtgdsTBHrQohfvvMR1Kk MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b62c637-a510-4939-e565-08d4f6961277 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:DM5PR03MB3324; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 3:cPxXK8+p5Uz0vp8Q4qGcsd+M+lU//AUXyBqhbkN3hsWqmWeXPZUFQlfuVPPbJYyaBGRszWXPkRLKMzCztSLzbI0i8OsBk0chk++Ar9xnx7MaGdoodQDRTX+aJCX0gNIVMzDJ/zKRE3df261ZYb3NjV09tiztCpH3K5OZmahxtGYogUr/5daB8jb+NCJd0SPo8RiIJwsxkVES+6hEblbKcWuciWlp0LebIRJxlqFaJBlmf797dQwRyliuvSPXHvo0pPFeX+7I59dpcdudWwRVXnuEVgAYjwxx8jXyTY8tawZws7mYZHznjka48IRtl4uUj5E9tmdMRyiE4iuX3thVzjbYrY0IxpXV2De61Srj99k=; 25:ynHZhcgWdGzLVDmD0fXk++Djlg5C/+55guwFXgcmfhRNutNVLWjdksX7tNzkAHWenYTkvvKMfo1BpDIEcvMeaGe7sK6qyvbJVe6GCle4A8wPXwLAcGRmhhjMism//3/JZg3M5YwKJJ2vHApIOTG/kqemGN9aoXfZ+CK+UZE8aTq59mw3fR18a0GmmJCWljrKB9VE4pBDJoxLn1gp4cnT812rtNaKSRXrkmhW5UZv3QQk824JigefOVCPI9OAuap45Eb2UxWfhaStqeXmciBmTHaUbMiO4jCcyt6IR5OpIlZjlCRGozlRwxbw6elquwxgpDrHeEvmyOiuviu4tEA9jA== X-MS-TrafficTypeDiagnostic: DM5PR03MB3324: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 31:g7uO+YtDF9FWx4BlzsNLv5JZWWnSosrI2a4x9Qd8ku4C0mI0rMJhMf0HUTptyg1fk/S3Uad2X7uyRV2uKkGcQuCc2DbUW+II1ZoCe2l8KUyvby8xoiNA9rCAuA45Z6rBJaAEArWjQ1eh3DkNyMzft5Ssj+GX8NwShCTo1yc24vY69Nix6tNmiZdYzIREtLQE46pbjQKvL55C6Yy9a37LS+6O6HsWoiCIvnfcm0fAOJI=; 4:5aC3RBFLmrpDM61t1ol2LuqVp6A7KxpTl6WXY5jDJ1z+gYtjR2sM2O22nHlVm3adprkiSI8rKqcmB3bRvWbXaId156+myvMtwD5vICW6Py7fWHd3249U/mwZVtMwVVRDDNuKS7CRt6WXmMENyvuVHrpzPurivnz9k/8HD/yMsOpcHtOLn9jMwKlBawjRJW8RElf77nNly64xFOad42mDT7GP9k5GqREpviHleK192YDTVDcAKYh6RgbfBJe2s26M7UY598rXfNLUgPwXu/hjg//kzf8GqS32b4Jr/bSKvXw= 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3324; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3324; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3324; 23:DQvvfUskR86A3e9l+DVBvV4W+XYll6srEyTLgN905?= 5LA1SBfqR700NnX6M397OGpM3OpGBytyKYjPske3XMJGdOcCKQhB/JylhKjlvMTJrax7pgyuB0iB2VwYRwEqGEYUNNMlsCE1vtWYPcuVk6SPX5CdRRq1oJirb1X89FgU1q010T7KktOdJzUYfOVrTCNivJbEgd0r6jYVS7hGVRiuooyr9AkavhFPs/s8nDTPsCMPuVV38goyGwA2hnPG7r1QOTOfvotJNgiFev+EiU0/e6lCpe1F9YlkdKdpKJkFY+EHXKgHNq4GgxxB4iI+doUoBibAU2BmoaNg2euQSmIT1j+vJr5roPyTuQOK3CtE0UWbHUhtQ9DeUYZSdAE0WG4iBg1+XIY2e1k1m+125Hfh7YLhs3Fib+LMe9tEan3eRKmsaWXLDlfLcJCAxd+bSRuq61ghH/0AVzMFVMUviv7485i09tyiLEB6qojPpkcUN9rWJrwqDnYK3nQx7BcjFcIJYWMz/+a1ZQ/6nWs3xKWrNZjH79kwnEtTlHt1JCtvUK5gFMSX1+sGD6ht55zGNMtoc+lG4aOsVK118P4kVxIaOCIm0E1DzcZ89K2FAKn75yQ/IH47iBCe6hYQutSfQdStlJmpitxE4iAOMbPIG6UfR4SdfXPQ+vJMemT6F0B3I0El2b7c7uS5Q4MI9y4IYJdAC8qapUt4a5ZPU0ZmKykC5/8qM8iMxiNJtXMAmUCrQy8m4Akh8KeUgt0wJBRdZBoZsytMaMXsBwucQSF6vBHh8ob/gYXloFLDuqnZkrMDyGMhVpsm+ikwp4WbNuE7RubydruIXLzgNCswdpvRa2Sdex38GwBNIaI2jh7JeW9z9e2drpxHn0WKA5CjaB5zd0PSdXAfGnPlV6IoiB9r+qd7VsEjW09YNURN+n1ew54NCURf37Lmvu3tNIOFlguDg3eUMw4ai6RAH5fXsOTwXkCduuff2LYTpJxO+EQHr28Vm6fJUxzGu4gP0QZJ07Hcs9GrMt1HCnCO87cxp/MPuyxq6Czg3RNjAqjND8Xcepjx/ftrWgpHVaaIpJrJ1EX7uEIqh7kmTqjJuSg05ZYiv/uHcrmNF3qzk394P1r1DMNLNM= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 6:P1ZokzKIQhsSiKtNhD4qPDVfGpglsB1cKiuYCZ82a1/gZFi8CCKgn6mjQpo0NJV0IxkOlMn2sGEvkUI1dwxVqh1FOuSt7hyIQEJC/QrGDLPHrEbgVjGUgjqHJMCIojZ1EoBuolJ5/4fOJb08SHixhao/1gO6F7snYNJyoEz+nfWXljBB25eD3snhHusG2/TJ31ql1DM+h9B8qKRiQwYpyYQspmmav3PIKi8GMDAw9i79X3CqFtVZqWS881vcM/BSNsSUrZHyHf6z2sQjRTY9D8lm1npVu96qYGgYVJf3GcLsQEv1Ww8vTHz/zHJc7mCUYuRteoZAbtCgjpmjsnrCNA==; 5:hLbrblC7xd+XfsTOQaaZIKClzEE0CMk0T0L9wAViME/sZU8D5g3NTP/+GxNPpYWnmG8M0e+zu2D+7rQHQQeE9j4hy7cEqLVXajzlR2fsZYzaoTMIofAzwwLACpdXFRx1V8dTqo8vF+BZeJ0fQjgcDw==; 24:PnjHgJUuoZQLTEGVGJFvjvwC4xZqu4Ldbo+/0Ecn2tHVQY+k/QjJFQyWgLvejCu5K7gOQyb059Zpa8RJnx34Kzaf1eLceWkd6qaBCyjP55k=; 7:O4o+gcAm9yHYtewEy7KRX9wQ5gcCNSTBg0tCB1KLHgYmOm0WiTMYXuuAfnDNrQnIpX5yWe1+VSBJu1xs5G/lkUKvi7dsks9dj/xIHi0IKzeZ4s7cX2nzVv5G3qrDsxxLQbkkge4Ot7IuINAeu1CYTk3EdySaqTuKjTZIlDSDKA4K2/N2ETXlSMIPtbzT1T+0wfD71xcfOmlCeBq9de8/oCObcA/uc/eROfg9jgEimW4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:17.9741 (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: DM5PR03MB3324 Subject: [dpdk-dev] [PATCH v2 14/30] net/dpaa2: add support for congestion overhead 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/dpaa2_ethdev.c | 1 + drivers/net/dpaa2/dpaa2_ethdev.h | 1 + 2 files changed, 2 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 945dcc7..d7950a5 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -419,6 +419,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, /*enabling per rx queue congestion control */ taildrop.threshold = CONG_THRESHOLD_RX_Q; taildrop.units = DPNI_CONGESTION_UNIT_BYTES; + taildrop.oal = CONG_RX_OAL; PMD_INIT_LOG(DEBUG, "Enabling Early Drop on queue = %d", rx_queue_id); ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 07e1da6..6ee1a9f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -61,6 +61,7 @@ * currently considering 32 KB packets */ #define CONG_THRESHOLD_RX_Q (64 * 1024) +#define CONG_RX_OAL 128 /* Size of the input SMMU mapped memory required by MC */ #define DIST_PARAM_IOVA_SIZE 256 From patchwork Fri Sep 8 08:45:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112037 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1246106ybm; Fri, 8 Sep 2017 01:49:27 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6VBpS8ctvK4FTB5ajkzpNFBWdm3AMqeHa3YT03q3IMpSG+cWMVN5Ix5OdXYaLDLekF8SAx X-Received: by 10.223.153.106 with SMTP id x97mr1396517wrb.107.1504860567706; Fri, 08 Sep 2017 01:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860567; cv=none; d=google.com; s=arc-20160816; b=TozrRdb5JU+NCNgL6WxnDcRwa8hQr5HKC05iQEsQK51ZDjiGckpDv1qhOT7uCpu782 WkH+x5eyN2VFkFSDUx4Ve2r/oBHJHV9+U2qiCYW47lqzwSXYk7N95uKBcPgI4MfkC57b Ia7r/n6S66yXqzbevNlgeymMj6Mrod34kvjWi6ZYF5hNyA3MeRifBhYxW7/6/7Rmrqyo TQbsMUkntsB/ofJCPkMy7PP/RQdv6WIzavguwWAb2qv/GN+uC8cOtPkbsUBpOMl7zZrt 0jKM9QXXYBsERTzrIbXHlIO4TVpBZUb55rjfdfrTBHGdPKh1NaA4sypIrB49bdDiGhcz Rp4Q== 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=R4zj7WJFxUNcjO4OX3hDbevwrhn2uGTZkTCwVBIr2kM=; b=EBNf31bVWy1blac78pUujKyWRKhzinfTOHiRK2ADamRRnxULcALVS4JnkCG/DpIrlZ sKA2eyNnq8IwwiVhN7o1kVKxeM/t8XmOgfR+d4njj+FYXHbplTiS1yZM2ShlK/RlulW9 QE3Nk7IcntWv7QqaWpeWwnqjtFjrERCYvrSIfmXdGTqYE1buvytdlf7pGGRF1czLtl7n 8jI4lNZOS/+YZWBevSr3RDT5AAmrKzunq79wWfNULIva3tsxzot+U6r4NocnBEeqmqJ+ dkSrtGb/MPRbzKXeniffV7zfEnMvlmo/A3+tAPOO/nKrofwMNt3tFwMmkdMcAkZF4jBX GNDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id 36si1068964wrh.397.2017.09.08.01.49.27; Fri, 08 Sep 2017 01:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 4119F19A19; Fri, 8 Sep 2017 10:46:26 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0049.outbound.protection.outlook.com [104.47.38.49]) by dpdk.org (Postfix) with ESMTP id 06542199B8 for ; Fri, 8 Sep 2017 10:46:21 +0200 (CEST) Received: from BN3PR03CA0097.namprd03.prod.outlook.com (10.174.66.15) 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:20 +0000 Received: from BL2FFO11FD034.protection.gbl (2a01:111:f400:7c09::186) by BN3PR03CA0097.outlook.office365.com (2603:10b6:400:4::15) 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:19 +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 BL2FFO11FD034.mail.protection.outlook.com (10.173.161.130) 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:19 +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 v888jmol023063; Fri, 8 Sep 2017 01:46:17 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:12 +0530 Message-ID: <1504860327-18451-16-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: 131493339795761805; (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; BL2FFO11FD034; 1:beVOMz0lbAoVbjU8ISwjKLkZ+Xdf+KjWP6nweoxr3vWv49Qhxg4zs0/6Sd3XFph+dw55AUc7U72E6fGcVYB8Q1jTz+aCVvwbO8gNOJZ4Q542bcseUeQA+1TxH9c3Ajlf MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b454ab0e-5060-443d-2a8d-08d4f6961352 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:cAWarN5H3pb0YOf0eXEW8p+gngKRGIjyg6pv9wKP+SGKqYxd0r1nz5CibzSt6oW4Uir8WxunvSnd39odT3bkUC+WL6eLcbpE7eDODL05EwNQisZtsZjQsG86PiSQx8cOyHYA6n2qNgbB0KW5jDVD34zkHcCz+7PFa/GFGmtxcd4oYw65v/WPKUVz4dlzw1/O3RT2h7427jJE19iEqej8+p8R3+6EPAfPe+l6uKtxyM8/VQ8hVwNE1/siRdHARGk8BAAO/v0CyFwUqEXbk3gvu1QvJHl5WNht/aiskVmrqz5UaG1S2j8NZnmI8xifpiCZpmQNQnjGseiEVMZav7bRGXwGX/tPJOlmnCl0/S5/Tn4=; 25:aIgzD61GTz38llXT+X4bTJ+r78r0805162En2cwxI31Ys6SI8WNn1qn04IzTeEijeh+k4te0UvnE/RISePgBmcjfZnjoTF70WVWm3k8WXQHniF2kAb8rQIpoMI+mQ6O5L++w4uGOS0a04IEiGnZCk0FvP8J92pOSpABOWq+SOBMKahQyNY7M/GNPffOMFDBVtP6NRrdlvdWJSe3/cf7vnMfweCmDNbRaFFrLavF1LHgnShm3bLbT3QkF23kFac/GTMFXggIwaX91C5OAqyjWlSZw3eICZQpCJ9H0v0r+eXPqY66T1TkcF1TtwPNTk5LN1UiP1zjhoQxRjrVRi7Bk7A== X-MS-TrafficTypeDiagnostic: CY4PR03MB3320: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 31:vQhcwFU6AvN0ReIoBSst/5XiyldC0beZAPUOpwNpqeLsVdwBU1hbuPBu3HWXaIsP7MpvCE6thRx5Rxw4HkXL11m9EYQBYwJA15flEpTKnjitbAeOUs7E9iXWhlvXNu9s15jdCH8WK2ZEwiPiv0yZW3wiANtNLy8O6poz73RutAlVyfB+eyXJcNaALuv92dUV+kU8VXJXrWpS7i16GRUTLpl6ywqBOThEa32WSZSTXh0=; 4:kCZhgN8aiKsnuxZqglqWK2p7n8VOZVUzr5/wJ+TJp0ecK+MJ4ssWrhSMxh4t6ENOD0VywadJFdrKkpsvNsjdFxVu3rwozuDzAFSi4lhnPBQc4WKCoQXH1eNJXQQiaX/aX5UVlp+KEzN7jo5L+LSPl5ueRJ6qE85ucrFq8g0FrWUesrjAv+3RqMPWKxVxXb7Ald+ZFgadOYg5dTvvyHBaOvb9LsTYQ9K/vGKpMQMtFiBkFYf1KmzzXcAt6CSMAe8B98ZfJ6XO0wNh91bZJAMyuWp3nIKDIAkmDzKARtElkiYgbPfaliX39ykV5UgfWUaxqZA/mDRpKWnY6duH42K7LQ== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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:qwnPBxxSQTDbNxJ0ViVv3NpmncFKWteYDXLqsNwWE?= zKE7kl6QA/IunXFpho/MrUX5yPrNcIs8zUerPB6Wwnuaok4AnHlddBEKsT1tMFNogrO24ZCid/TR15lEUN/Kg9yKyIvNyYav+9plk0hiw+uM01DFPk71ekT1j4NX2Zvcllpi9PJfbE9Amhf4CNf3cZYqoqiUndVQOgxZclnlBWcqs8pg0dD6cm7XNdGxndwTBdeLXi90KML9FvJRciBxkUhJd3jqOt1Iu2dGr78fOeHkFPSuU5DUYfgjGvyinbBTF5wroWcBbxM4tpE49R4OMB5LhT8Ut/gg+2kq+wXALkxGIszS+BHKIq+jRWMXjD4bXHkZXeSM+TaA02Hw6rq6L/yUz1/vxd8atZBx1deDvqr/fhRdLWQXMNfiAHTXf6pJ6+Bz21zgfmAPqqLHp0WqyF46IJuSBc73/BeqzI2oTZm8/uuRN+1Jgd1r5GztxpamHI0S6AYhanrZyLOj3GX03UmI+u4K4NuM3I05QfK+p4iZLWJoZMkcA1OfA1WKM1DKBQQG522ShzaVm8UgDSNZh3IkcLsZHwFpOudxRE9CRyjT5mVUPwXrq+fxSb0W26+afKIi6rbJdPEFvE10Gc8rosWJPm+JBGR/HHSC8F9PQhIa5juRSYmKfYVIEJb8dGplxM5EKvi8UrZExOYF8zNogbazRdqRhUdnvv2keryf8DW6qKBvx2kl+hr0z56u1ucC4j5CzQeBiwmJTww3tULPYExol1ok4TcYCaisvktq6M5zhjwBneNtlwdN6ALM4GTMo2ZHQahsEvOX9wnNTFwRcO5y59ujgrHzmZRAmiUO+kyk8jCeMqGmtG+3l06G2ds/NHMTDFiGdyTiS71f0PrRYbQsyTzFEYBEn7Lpb32YCksafjjsNCDRS9FaRAAgoQ0I0ublX648ER07ugX0Id4ISqGVf0gDvaQaMv2CElaLa5JhOoXMhGTeRLFyUmagzDJvw7vEtJZ3sDiTuKvbPF3pxNbOOC5cP/ON/aRfurv6K5YoQVwhbshLH1RG6275z7uKEAiEIHlIUsg7cSSBHEmjXHZOX2ZEl2albc+LSTVb0AYG5CxEofJT1OZSFEU5ZOGXSo= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 6:48Ts0mHZrtUkGZC0sfnkGGAj9+NtE7QvumoqiuQH72dbm9Nr6BRtnzhAq+QI2Uzbt0AlOuRhp7Uolw0coYAA95tGC40GvYtFMpodCgO2LYznxzCXOAaell2C2RTOqw1duTcsh+yqWF2OWexOXRDbCKWtXOHWO/HzeMKzafO2Gjcx2OddmiuTosCYiYgieG+UnCbItBzBj07G2l+iPDDEzdJAtCr9VQS3yCgxMIapmL8+IK81qR92fTeRCaX8Dntk2LEupm74apjsiUJoYv1smuQCSBk6DJGa1FGnpcDGwaXs/n8ePEOWImQU/OfGBEP1f8J9yLX3ZXRzl536O6rejQ==; 5:fKkvv7yEZOv7qqy5TA3G2YPB2Tcxn+QMZEzFbS8oBzuNj8832wAlwsoW5zBzDUfJAOeS7CABP5LTpoLAO1ZnoexlknjnF2MHs+AusMTK7xRDwJMOvkoax6XbB07Wlgb3PJQLmmyyVJe15q4LesLOHw==; 24:/WfVTB17bEKWkxuKqhBXkkOGjFDGUkT6dxUWK5cvJ5zCrYJ2sqTDthquKxJHhlLMdAhzehooDgtqeU5TPx9u6rcn40fs7PbdKnc3/827LNI=; 7:lJK1siHvvWMgGqyW3x64oJ1dcJOLEhWgQONMWcEW7w41qyCuvE2ti6Hq7Rx0XHRAmwaVf/ZE5dsgE0fZhsnQH2+x+mWaObGT0eaEDx+SNFN8TQwGkfl7Iia45AxGziEUq/TDBN8tpeJ9AgyajHBtpfPkuXXX3jc4oe/Qol5ASaW35Y/qzHLmuG3bgdUr/H1FUnYMdAFE9BENqeAwYDXlKGtyqAyWOpo54O5DMghGD2g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:19.3109 (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 15/30] bus/fslmc: add support to check dpbp presence 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/bus/fslmc/portal/dpaa2_hw_dpbp.c | 7 +++++++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 1 + drivers/bus/fslmc/rte_bus_fslmc_version.map | 1 + 3 files changed, 9 insertions(+) -- 2.7.4 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index 1ddd280..7e96115 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -129,6 +129,13 @@ void dpaa2_free_dpbp_dev(struct dpaa2_dpbp_dev *dpbp) } } +int dpaa2_dpbp_supported(void) +{ + if (TAILQ_EMPTY(&dpbp_dev_list)) + return -1; + return 0; +} + static struct rte_dpaa2_object rte_dpaa2_dpbp_obj = { .dev_type = DPAA2_BPOOL, .create = dpaa2_create_dpbp_device, diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index bb52a15..8f39cfb 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -366,6 +366,7 @@ void set_swp_active_dqs(uint16_t dpio_index, struct qbman_result *dqs) } struct dpaa2_dpbp_dev *dpaa2_alloc_dpbp_dev(void); void dpaa2_free_dpbp_dev(struct dpaa2_dpbp_dev *dpbp); +int dpaa2_dpbp_supported(void); struct dpaa2_dpci_dev *rte_dpaa2_alloc_dpci_dev(void); void rte_dpaa2_free_dpci_dev(struct dpaa2_dpci_dev *dpci); diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 3cc7dad..7b25248 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -83,6 +83,7 @@ DPDK_17.08 { DPDK_17.11 { global: + dpaa2_dpbp_supported; rte_dpaa2_dev_type; } DPDK_17.08; From patchwork Fri Sep 8 08:45:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112038 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1246421ybm; Fri, 8 Sep 2017 01:49:42 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4L8pExSSoeqDqBx+ldNQ9hzQo2CQL2IMKEOrbE9KTEnLWFH2iRHLSPxFzxc2tWbV270B7S X-Received: by 10.28.26.15 with SMTP id a15mr175022wma.16.1504860582273; Fri, 08 Sep 2017 01:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860582; cv=none; d=google.com; s=arc-20160816; b=AzSTkspUcVeDE0E9mcJm6zcuJR2+gNPkdFPmOAOj26NBcCknor6ZTQvgLTF/V2WP3B Kv7q5F02P3Di/8Uq0dFaHsbRmgL8PlHGCuA/SJVqZICCWByG1V1XUQoDJyiHC9S7G6j+ 9h/slt8otqZ06atUFgeejOgQ+z1ctqKwTezDFdtVyAxnQcscuUiFMMaWnI/Xc3Ruo6to 7/D6fwhpRon8mmUcAEyoOudYDcVdJu+3mPQ1wzVEiMXLT5sLJos7F0CArmkkAgEW6kXS lZ2aivvRj6KAePffQpzNXwldXz3BUNG1VqzdRpszYEj7M+T1OKituJ3Imay0TCrekjGT 3Ysg== 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=+Au9nBWwFDFvAZ3JRI3SZBDLtac2vJcp6rvSJfr4uNE=; b=k0uGA3oyDn5SSnqdXAd3WZywqVW+scl8sEjTQ3xUttMGu0UJwsDu0hqC91neT66rtp cOj17T8nZta6s3XY0djTTmiE/4SCo+FFxz1FYJu9MJAnZXacpdgqBN8eh+9PKwfpDron Flg9sABtEC9Vob5c3WBD7UvGFHtcoQzKjEBLl+peglT/A+3QWs42+rLgDz+yyUpr5wYa Tv3zW1MLGLOi2rJH2CHeb4LFsiCQUYQtn0TMyq2LQksMqGSEp4z5O14MeJGkcxnR4Zb+ FdzMgwPlrne96GIKLLOaJH51lamstZwsFQsldCS0tuBFv1FWlrfatY5k2yQqYkAiGDDv HbUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id e58si1117966wre.38.2017.09.08.01.49.42; Fri, 08 Sep 2017 01:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 62FC719A24; Fri, 8 Sep 2017 10:46:27 +0200 (CEST) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0063.outbound.protection.outlook.com [104.47.33.63]) by dpdk.org (Postfix) with ESMTP id 160A619A13 for ; Fri, 8 Sep 2017 10:46:24 +0200 (CEST) Received: from BN6PR03CA0088.namprd03.prod.outlook.com (10.164.122.154) by MWHPR03MB3325.namprd03.prod.outlook.com (10.174.249.143) 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:22 +0000 Received: from BL2FFO11FD047.protection.gbl (2a01:111:f400:7c09::144) by BN6PR03CA0088.outlook.office365.com (2603:10b6:405:6f::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:22 +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 BL2FFO11FD047.mail.protection.outlook.com (10.173.161.209) 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:21 +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 v888jmom023063; Fri, 8 Sep 2017 01:46:19 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:13 +0530 Message-ID: <1504860327-18451-17-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: 131493339816136977; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(76176999)(50986999)(53936002)(4326008)(50226002)(8936002)(110136004)(104016004)(81166006)(81156014)(8676002)(48376002)(105606002)(356003)(33646002)(50466002)(106466001)(2906002)(2351001)(5003940100001)(305945005)(47776003)(6916009)(2950100002)(97736004)(189998001)(36756003)(5660300001)(6666003)(86362001)(8656003)(77096006)(68736007)(85426001)(54906002)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3325; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD047; 1:aJ9tuytgcL3iBUwet8evBWZrGVATRrL9EOktbreG2vdDKROI/G9+rcCWIBgHwMM8xftcZD47QezBfRmV8oXW12duTeJ/Zg8QHDDmY629KVnrU3CV2W7GiDzJYs4vLNdS MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 680df82c-59bf-460a-1111-08d4f6961489 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:MWHPR03MB3325; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3325; 3:JFAPS6kRmIGcplhGubgkJ21GmrSJPlpJDm+fqH4RJRjAVpHcTo+NZilVKijrrhPG605b248K/H2p84GVTtpQgBfwt5i28Gy5B7d9/0n2/bNfMUa7vn1dXe5lzgy7mEq7yZI7Qn8vcuKmoVZlR0Y/Upc/DWDaZJRx3qlJnQdXcM6oERtWy/QtLBoFLMAw38D2hRNu0xBBUL0bCSS5JZp99VHR9bKMxiycPO0SjcJnexCECiCQgaHyjJn9b4S2mWpEe3MEWQ4TYaG6F/9LOekwcismbK+rTq74YLqNgAxmPgIb/mbarTyyOz2f7FFkkC/rYb8hKALsmuKl0DwstYazvNZFC2UchLsp+2D1tJIw+tg=; 25:kWUWBe+wWSK5nOch84EkqMMB0Pn0JAa66By283R+iMDw9y9VM33h0Ig23QYj05dUlvDaM50bbfKpABnwJ0txIfWSibtgCKUl8FaSD78jMW+sFdhD7Xq2c1VohU1NcMCxK/mVT4aoazyupVOVBnAm3XgyhnEoztH30C6yCJzzXUt+Il11LWIGk58x4ysCU2TzgFKvsiVmVXyn/Iv15X7SPll2DGIGYKkhWuqAMJ2t/1rHcB8wbDLqLXb8R/iXRhzhgxYGJSCkxYOWemulubIpijaipqzdtyabCLJlvJd+c0/TcG6hGYpb7TWNcxj6CT/MzRpM7Tff74yVM9VbHa+OOw== X-MS-TrafficTypeDiagnostic: MWHPR03MB3325: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3325; 31:xfO0lBtolkO+f36Sq/YtPIJreZPWkuP6KZng5AhGgY450aJvPWbXQF37EjvYutC8vWgscm2c0TQu+oVb1ToXK/4SMO5DRXVhhHHaCK6Mjyxl+tB1ZGyAKIdBmlwvpuw5LEg4MTFJjYFSp0gjxG7ViEq1k4ye1FS7Y7egpYEumG/vAQTQJMkKMzf2BnESuSLUWLv5T2eAIJz+EET+376G44mTUOqNcobzpbQi6zsAfXs=; 4:u4g8FHcM5XXOVrMFYCsIdRkvIah2p2qI9XLxnz+feViqs6qJJwQP6dEXow+PB7Y2MloX+QWh9itsHtPE1GoBUIG0R+A8dUhNCgGU+B11MpehQQO1BY3yhdr0bJTmNG8OirZ7KBOejmWrJ1ldpjirkp/4O2OiFK8MkfC/7nGLHVhhgbIiizYBdSmAzTvT5+E/XCsNhV6k/MMuDvAjjD+vsYdVXsQqR6M4Jx0B/t27QdqBu+SR3Tc7HXNBbvrXn5p/IQ9vOSYw73FXXNcZ14ExwHFwQn4aIIcgSQLyGJxB0d8eeLLCLN8sAyn3SRzkPfEvld6AViCjzx2oJW/BqPrAdA== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123565025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3325; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3325; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3325; 23:6sN7JAbkYP0MRll3gk7TOpCle6bzd7ivvWKdo4fXR?= k0glLEl4sLs5hHBtx+rgoBEvfSHKyS+n0iSCfzzefCvi15h9qqbSvO+z1+XT9Y+Z7BSnHx2HLmPtrQvok2LIvJsWb9/ZP0wC9F7NT4QQSot7tCWdd7nOR+lDqPrYo97rp1i0AJeRRc7aJq0Hdz2E+/9NOz6g9+f2MIc7UOkcycPG8Q9KwyPKkKo48P/ZP1Ajm1tCQ1xHQCmGimTi2NvsW6lfAAe0IcUFFW9xEws6hcHF/BX4MGhOXwMyWbOcQCGGVfa7gpo3Eb7Sw1IClHkvXIJ3CT5Hwa6NdZfOKvQCnVu7YcXS+jog5mkZVkfm+MmvDcweNQRvuuMBHB273gXkArcNYJXnW2WdrkOmgJioC4mEVla4i8Yxyhk5y+FwmlXef0cBHqkFwJOaYCib2FReLDZYoLkVMR0C4+qWopeM4/cnqhhvW98QcM4i0/d45hKPoFbegD5Tybxt6MzZ98A4N7KqqAjhXpQiBOQUzzH08Y/JYFYgbQ3I36mUrZZtA/OB1l563UwH7wuvWfCme6IAa1HsMcyAeTVC3v9/NvVbYtPSAIvvpwwSp5bRiNcZ84E8BYUiakfjh6DTmQ+4MfYCRdI7sRkaJI8MFvgBrpFr5OuGNu2UFzo8R7mGT9t7iUxUCczoWGHtFI0XCEUnYEgINgvYlxECUEeCu7LXcFfd4Xos/+0BGkQ+PwCdl+2Kks1bkiup4a5iB+vBolpIx/m4OulMoRdZww6rUlIM97HkS0kl3dcPluO4eZB82jfrd3R6gE4njMztaIBcIHPS93kg/6ZR0iR2a7NsBXwPd8VoKJVzVD13EBAjxgCdhFBC+8+DRcnA5VQXuK0cHzLwYoLbByR0Uz5QCFVFknQDWZZddX04R68szuduDYYafkyc2cttn8UGky+lmKhrmJmVSQoWC2LnNOD6x/1GEjg38L5oXxyPEBqfaVr2TrkgFJXq59IiTVjHAemtq+lN0m7/kSnx8H++imrFetCJ1BJe1TjXQJHyUzs/kuDHpwcGKKUQSHVZnw9meFz/RPo5An2j/9kQzofmLyudVhsgrrzblNjwhOW8bdCzq31Yv9ERLKnfmzO1XA= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3325; 6:8Lvg0HoSOJpXc73SKM+n7tbNiPdl2xD/dyHoBjnPY73doPryD79klRYVRelXnN3lf5LAi8CpQLVPKCEMkNUnt5w1Jsl1IcBadehCIyxHBR5YxM5BHfNZpGN95gcAT6+M+nNKz/9xDKFrE5JF8U/rGLDY7lD4mHGUu2c9HN+WFhmLKMIpDSM6ejegbs+CMI8Y6MLcgj+J0BtGCC/fvHcD1K22qb1CIycLKuts/li8WnfMqkrT0VZLKQbcUAs468yJkuPsHaJlX3Q5AuF1cyrIwHu8EJWZGKM2HHvBabcj8IWu+8kzj1tOAfN4ztXS3nT1Ipiq2tR9lYhorcilCZtAYQ==; 5:G3B9CRc8J/XDqCkqQln7c7XI3O/RwevOKa6AHxap+U4ag0/99NQuAM1XD7WqGrG/lw3bWJWDdtiwxrlV+NkrHGbDHUXLTMz3S8iTzk5hB5arb7Zcryjen9zZHfdGge1cR+u0X8b+dSWs62tqBe1F2A==; 24:9z94NXLkc1treH6t6QpCPLwDbHNv7AIHDyYDR8jPzXOQOU5oHg4YUQmB1bwig5Pivq/tULv32agqeuWIT39SmAJM9eMMCFdXVcLb+WAbJRI=; 7:N71KyD1pDthvtyT6sIYAB94BsAAcQk6zNlNyR2uUXYr2UQvyGgftcpZkwXAhRpN2VjCGOxqb/N0fUzHuhQ+uooDyqKuo0KnzpCUozK5kJvMY761nwbYejwS/eprPmBko35QTPU66pfXb7g12szYzqM58dmauSGHQlbcdLLPzCRzuxZzJ+Lqc05MENkrofL+w2m7YVhyVcQ7SJX6CriIKqSl1K2XuTStMxARSTDVXbuQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:21.4420 (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: MWHPR03MB3325 Subject: [dpdk-dev] [PATCH v2 16/30] bus/fslmc: cleanup the dpaa2 interrupt support 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/bus/fslmc/Makefile | 1 + drivers/bus/fslmc/fslmc_vfio.c | 108 +++++++++++++++++++++++----- drivers/bus/fslmc/fslmc_vfio.h | 8 ++- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 18 +++-- drivers/bus/fslmc/rte_bus_fslmc_version.map | 2 + 5 files changed, 110 insertions(+), 27 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index d1b790b..37da1b0 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -51,6 +51,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common # versioning export map EXPORT_MAP := rte_bus_fslmc_version.map diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index cdc982b..ab1df36 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -335,36 +336,107 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj) #define IRQ_SET_BUF_LEN (sizeof(struct vfio_irq_set) + sizeof(int)) -int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, - uint32_t index) +int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index) { - struct vfio_irq_set *irq_set; + int len, ret; char irq_set_buf[IRQ_SET_BUF_LEN]; - int *fd_ptr, fd, ret; + struct vfio_irq_set *irq_set; + int *fd_ptr; + + len = sizeof(irq_set_buf); - /* Prepare vfio_irq_set structure and SET the IRQ in VFIO */ - /* Give the eventfd to VFIO */ - fd = eventfd(0, 0); irq_set = (struct vfio_irq_set *)irq_set_buf; - irq_set->argsz = sizeof(irq_set_buf); + irq_set->argsz = len; irq_set->count = 1; - irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | - VFIO_IRQ_SET_ACTION_TRIGGER; + irq_set->flags = + VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER; irq_set->index = index; irq_set->start = 0; fd_ptr = (int *)&irq_set->data; - *fd_ptr = fd; + *fd_ptr = intr_handle->fd; ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set); - if (ret < 0) { - FSLMC_VFIO_LOG(ERR, "Unable to set IRQ in VFIO, ret: %d\n", - ret); - return -1; + if (ret) { + RTE_LOG(ERR, EAL, "Error:dpaa2 SET IRQs fd=%d, err = %d(%s)\n", + intr_handle->fd, errno, strerror(errno)); + return ret; } - /* Set the FD and update the flags */ - intr_handle->fd = fd; - return 0; + return ret; +} + +int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index) +{ + struct vfio_irq_set *irq_set; + char irq_set_buf[IRQ_SET_BUF_LEN]; + int len, ret; + + len = sizeof(struct vfio_irq_set); + + irq_set = (struct vfio_irq_set *)irq_set_buf; + irq_set->argsz = len; + irq_set->flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_TRIGGER; + irq_set->index = index; + irq_set->start = 0; + irq_set->count = 0; + + ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set); + if (ret) + RTE_LOG(ERR, EAL, + "Error disabling dpaa2 interrupts for fd %d\n", + intr_handle->fd); + + return ret; +} + +/* set up interrupt support (but not enable interrupts) */ +int +rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle, + int vfio_dev_fd, + int num_irqs) +{ + int i, ret; + + /* start from MSI-X interrupt type */ + for (i = 0; i < num_irqs; i++) { + struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) }; + int fd = -1; + + irq_info.index = i; + + ret = ioctl(vfio_dev_fd, VFIO_DEVICE_GET_IRQ_INFO, &irq_info); + if (ret < 0) { + FSLMC_VFIO_LOG(ERR, + "cannot get IRQ(%d) info, error %i (%s)", + i, errno, strerror(errno)); + return -1; + } + + /* if this vector cannot be used with eventfd, + * fail if we explicitly + * specified interrupt type, otherwise continue + */ + if ((irq_info.flags & VFIO_IRQ_INFO_EVENTFD) == 0) + continue; + + /* set up an eventfd for interrupts */ + fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); + if (fd < 0) { + FSLMC_VFIO_LOG(ERR, + "cannot set up eventfd, error %i (%s)\n", + errno, strerror(errno)); + return -1; + } + + intr_handle->fd = fd; + intr_handle->type = RTE_INTR_HANDLE_VFIO_MSI; + intr_handle->vfio_dev_fd = vfio_dev_fd; + + return 0; + } + + /* if we're here, we haven't found a suitable interrupt vector */ + return -1; } /* diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index edb86d0..5470a41 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -64,8 +64,12 @@ typedef struct fslmc_vfio_container { struct fslmc_vfio_group *group; } fslmc_vfio_container; -int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, - uint32_t index); +int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index); +int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index); + +int rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle, + int vfio_dev_fd, + int num_irqs); int fslmc_vfio_setup_group(void); int fslmc_vfio_process_group(void); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 8db1f6c..ff41ce4 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -440,7 +440,6 @@ dpaa2_create_dpio_device(int vdev_fd, { struct dpaa2_dpio_dev *dpio_dev; struct vfio_region_info reg_info = { .argsz = sizeof(reg_info)}; - int vfio_dev_fd; if (obj_info->num_regions < NUM_DPIO_REGIONS) { PMD_INIT_LOG(ERR, "ERROR, Not sufficient number " @@ -457,14 +456,12 @@ dpaa2_create_dpio_device(int vdev_fd, dpio_dev->dpio = NULL; dpio_dev->hw_id = object_id; - dpio_dev->intr_handle.vfio_dev_fd = vdev_fd; rte_atomic16_init(&dpio_dev->ref_count); /* Using single portal for all devices */ dpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX]; reg_info.index = 0; - vfio_dev_fd = dpio_dev->intr_handle.vfio_dev_fd; - if (ioctl(vfio_dev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { + if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { PMD_INIT_LOG(ERR, "vfio: error getting region info\n"); rte_free(dpio_dev); return -1; @@ -473,10 +470,10 @@ dpaa2_create_dpio_device(int vdev_fd, dpio_dev->ce_size = reg_info.size; dpio_dev->qbman_portal_ce_paddr = (uint64_t)mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED, - vfio_dev_fd, reg_info.offset); + vdev_fd, reg_info.offset); reg_info.index = 1; - if (ioctl(vfio_dev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { + if (ioctl(vdev_fd, VFIO_DEVICE_GET_REGION_INFO, ®_info)) { PMD_INIT_LOG(ERR, "vfio: error getting region info\n"); rte_free(dpio_dev); return -1; @@ -485,7 +482,7 @@ dpaa2_create_dpio_device(int vdev_fd, dpio_dev->ci_size = reg_info.size; dpio_dev->qbman_portal_ci_paddr = (uint64_t)mmap(NULL, reg_info.size, PROT_WRITE | PROT_READ, MAP_SHARED, - vfio_dev_fd, reg_info.offset); + vdev_fd, reg_info.offset); if (configure_dpio_qbman_swp(dpio_dev)) { PMD_INIT_LOG(ERR, @@ -497,6 +494,13 @@ dpaa2_create_dpio_device(int vdev_fd, io_space_count++; dpio_dev->index = io_space_count; + + if (rte_dpaa2_vfio_setup_intr(&dpio_dev->intr_handle, vdev_fd, 1)) { + PMD_INIT_LOG(ERR, "Fail to setup interrupt for %d\n", + dpio_dev->hw_id); + rte_free(dpio_dev); + } + TAILQ_INSERT_TAIL(&dpio_dev_list, dpio_dev, next); PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpio.%d]", object_id); diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 7b25248..51a2ac6 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -85,5 +85,7 @@ DPDK_17.11 { dpaa2_dpbp_supported; rte_dpaa2_dev_type; + rte_dpaa2_intr_disable; + rte_dpaa2_intr_enable; } DPDK_17.08; From patchwork Fri Sep 8 08:45:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112039 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1246714ybm; Fri, 8 Sep 2017 01:49:54 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Na/GpX8QusfJq6KzK+3PbOfJPW6cs5dkphGlWjJYjnuAv9xx0ST2Ep3qmHkomMJB5Yxh9 X-Received: by 10.223.157.3 with SMTP id k3mr1386773wre.122.1504860594481; Fri, 08 Sep 2017 01:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860594; cv=none; d=google.com; s=arc-20160816; b=Lr9sfuWLGKEKZd3TjsDsSAZdwBezUNsbv/v4cW01C+SC0JbzYXyCXRuy5S23/1kMmD u6XdD0Dw5uYeR96QVzoYm4PH0wSnDQEGU4MacJzs51dMXdy6kamZ6NkO6Z04F02dCCpZ RHUN8r98ppXagFrBCrdXCX6oOWf0ghRoUeUhdSvPp2xlS5TmuHyIakMxCiZzeVPiKvAq AxQUxWrv9K8LtQiEV7n3CckdkVkZgPHah2NE7butMRUQWVkqNRegW75MkYNlOSOWn+x7 sN1OsNiTiiCz445SPn/qwbDIcEVMHBXLwkGpbh/ymRX7juc6k5xDiL8lQfL1UVPjwtSa Tc8g== 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=30svvQ7P+Obj6tU92eboBpHKG5trvs7CvSEFt8J9a4U=; b=ika04PpCpY8no9D/7x17nkEl3J+YyQqwsHrPSNH5Efg3eq19FkmUt7bG0pcG2CCSs1 o0wV7OiWBz28swCsEOEkzhAVwnZmSdmCgAMm527ew67Wv8kXyp7nlw5qWbTkAr/fMJel gAhOIWFhjnz7UMzo9FwxWDFBt7RhZsZHEoKGsMndJ0Efh+qAtIXxruTJoYIkrQvQx4Pi OTvrr+znHpTMrh6Hd+dTXV8kqMd5/6K63kH7ShXt+5qKB22NKvEMCSJK4EJJnubGPVLn Bvi+FPaqaaQ7on7S7lCEy9RLLNjXTwwj1yUl761M8FEmNI9SeTbkeVzhcmu9oMHSaCI9 vLTA== 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 n5si1040864wmi.167.2017.09.08.01.49.54; Fri, 08 Sep 2017 01:49:54 -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 9BE7C19A29; Fri, 8 Sep 2017 10:46:28 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0061.outbound.protection.outlook.com [104.47.37.61]) by dpdk.org (Postfix) with ESMTP id 7824F19A06 for ; Fri, 8 Sep 2017 10:46:25 +0200 (CEST) Received: from DM5PR03CA0034.namprd03.prod.outlook.com (2603:10b6:4:3b::23) by SN2PR03MB2269.namprd03.prod.outlook.com (2603:10b6:804:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:23 +0000 Received: from BL2FFO11FD040.protection.gbl (2a01:111:f400:7c09::130) by DM5PR03CA0034.outlook.office365.com (2603:10b6:4:3b::23) 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:23 +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 BL2FFO11FD040.mail.protection.outlook.com (10.173.161.136) 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:23 +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 v888jmon023063; Fri, 8 Sep 2017 01:46:21 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:14 +0530 Message-ID: <1504860327-18451-18-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: 131493339833220831; (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)(45074003)(86362001)(47776003)(5003940100001)(48376002)(50466002)(76176999)(5660300001)(36756003)(106466001)(50986999)(2351001)(33646002)(189998001)(6666003)(2950100002)(68736007)(81166006)(81156014)(105606002)(54906002)(8676002)(8936002)(50226002)(77096006)(4326008)(85426001)(356003)(2906002)(110136004)(305945005)(8656003)(498600001)(104016004)(53936002)(97736004)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2269; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD040; 1:F4CR9Qk2VIuwrCzGPBn9CF7xSdodb6SeIMKCZowcOYpZU+hTNTgd/BO9XJfGgggG2eGBzgYMYlrgMLnNF1xmfhoTKE9F2XUsbx8ip5gHEz+6A+c4wGLqazAYohURRb8s MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 90c79e33-ee6d-44a0-bedf-08d4f696158d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR03MB2269; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 3:drh8gOKvP3IGgFn6CnVDqBvwU9E8A4bVg33aTOXy+AN4bGq6XnLGe++rN1GgO59SssnEdQrshtVTDCXhOF7usl8k9Qfn1omHkul+pAWWrlFWBnoFX/yzyDOVJ6vlpxiqIH9o2kLbk+EWVvmbpKXKXZLPIMp+FUj4SDOgTj0HnKXYXqQhTCjTdO82c1sQRgaqmoovXuZQj7WKlIxM/Se/IQ9eMplvT+omh3AqXl4fls9osbQ/qAk1qPIX438Iy+t3fTKp13PaRA0EX9z4pVP/Vc8nrvpQwqoGYtjGAM2W9lDnpK1+HE4KzIHZg0BI8RYBaaUYP5F7hJ18FG4RN5lmmpcjUq0REUptE4juwRWbBYU=; 25:mheiwC/iz6bNJwB+gTPlYYJRbzpqbq1tgDBXhtdgDn7sxkxgVaNW35AmrREFcNPPRhgq8J26EACBPD5XIXvqwO14WUPzgK0LtDFmMHJVDwnTwULp0ZLqq1R7+RHinWqkkEn9BjxF10/9EqYYlbbCZnnIdodZBlSa0UGA5dXpfnngbUJnZGfabiMu5EOLdVctQMxrXO+uhfH6C319XEJ2QYTd3bTlZWCwICF0TKfd4N0FY2nf+FKXHPAPksyIp9+dveEkK7OPBpFVt3kJzBluimfUQ54iPWr8Vs+0ebTWtzFh80oX/1F9Y2ll/ng4/93tWZmViuDXSV3c7lqzzuFvqA== X-MS-TrafficTypeDiagnostic: SN2PR03MB2269: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 31:o9xM7OIVXmeCxA3an7dhgy/cmf3Rry0z+SOZweYweceGJluH8q6GEzq27rjPDH3+Jl0fNQvmP5vmbKSyVWH/Gyl0s3IH+sMZKBQE8wPu620G4Uew8klOMSivsI9/tim0O8vD8UqnXi0elT+YxtEPYIWWYBxHr3PI7xw2b4QVGU34i7zzdEdj8edSen9Uri5HTQvOnmfKcPfvmSgqIZiUVppZDQ/85AhebVxQopLWnNs=; 4:mcbBliN7CKYnV+HwxR2kqedkHD6567CcO99HWsp5fuP1kUhheqgplPjtRM4Ah1LKuPu4tozjr2Sfvi3C6PUbchids/xxkUGBzb8EmsHL/Y7JxfrZrnNNySSgDMsCGpH5kpr32WbT4b98uD9oSVMKR/7WG3iRPju0LYI3NFcZ7lNPGvSuhiXuTUPgm5wyisqV/MWb3XQ6GTjDrABz7Kc1hVRKBZudTe8B/wu2rwp8Kw68n50TCTyP+zaS76XWgCd2yOE0Rhl1kIjA7f0V0iHdDbclNEHZUP4M77uqi0dTJM9t8lhOGjtJR1Ccb4h9i2yr4kReuSZ4lg1jqpEuyiI/Tw== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123563025)(20161123556025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2269; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2269; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2269; 23:4Kr8R+BqATn2sQEJAlthK4Qa+CXEQZl7N8THXfL3h?= CrCUn9BOXaYTPsz56+/3IwebfGnezE1aLj+Ie6HvTqxYRx35mIvZTTjVZvKqdbYXpVAvP0BA3rkIzxJFDLjEHs3OsfVQG/osT+J9xcQHjJyLZZjyBTAo6Nk5ysPI05cK1eYY76v05sK2Kc+V0AFXT8jQUjRNYreREWs2RHkk/l/6URYD1y4QQ9vFvNkAELRcm89N2peoBcYYCI8HHdLOiz2GsTNdMfxuLTznG8zICi9ZVDsI48Vd6I5/hzePaOKL/QZ3DylNUgP7NRNvXM8gprzOhjV+qKqGj3WPxErH15LhMG8wsdMOSWAuvgYCdY+i4BoWA72oBAvACtsPYrjkOWmJo/vnMdhG1ruvKhKfXDJf8/75EJFO6F/UY5CnT5mbWRKA8IDSLoLOVxh1LSgr4gNxlbEM2fxVtaKbRC/QY3L0EQ0xhUPBZrux6luKauy80z6tYGHx9yMSgOEAA7hEdprzYoFX6MweJtiUdRObrIrG7cJ4KkSEficM84FW3ht0UwIFOcjLYr9TYt5tUzyMdg6yVWV1NjNugjMWoxYUQJuO65agRuvnL/MZKIe31YsLPHf7MDzIN/CqeDjsBlpO6qA16CjUA9aMjiqXPfsNxy7N5qFy1A4mMZrlFGaSD5SFbAfvnV1GNahATNPaAPyW6yWqT6//YxIJ6Q+ubHZa+2g62aQykiD8yTUf8hSzAeXTBN+noNzXUt25PtdfOOkYuOZT8mWxz0ViyrIcyL1McJa5P0r4+DV/Urruk1c58sAF0A+fr5SEHzFN/KXUK55sYY6W/uvq6u0cdsOjw8jd0cmq19s8MJlbszO/l6Dgon9OGIs1cye/6fjbNq4Idbq7ndD5MjDArhLM6uuFHn7CRgG66UOmd6s8QHI669TPiFBvTLN+NlYYpnMblPyuZxhKSn4pzONQDckMmoUmDKmlhpjk195suG+S+wMsTJxeP6DYGm2CHYFDQAjtmrd60czvowpj6te9OYufQmSHVGQrEjsWIPoMpvBM1Nogyoy4lTtBS3gMsD9/71ruhe+YBJg2XdmU7yTENelG7q3ZSTNJmLaW8TwMUqlR6w5yCQOrn0qWJs0QFFF3H3pjb04dfUxPTYJ X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 6:4kLAm0eKSiluZSFvZYNdVs2Md8rHz0gD1rcnOyeXWHlTt9eKhPZVF8RLFMn9USBIRgG5Q1GHa1X7a84OO7bFji28ZoX4cGR31HBbO1PR7Us++M0t9F01cXXVJm+87BW66ZIjvLZe/aauu7b7FPcD0skuyfVO0UePpo63CpDTFqBNWxlGxl9pC2L4g/gVFPSP52lJskndcfJmts3Ig7WnLj6ievE69jTfwtMlkpXV+QCV34ImAtgxY9aVcRkY4hSr4YjuSHDL4hl02i+MfBtlHmOJ7pmiC1dOFYs7Zk77A7xpsIq7xdACPhGjX8SX7z6S48YYthm5oSbU4dTrZuMw+A==; 5:Gmz2lf88uvqWE8neNVY6/Ib4k5g8YFvTdSwgg2kaWodX0gHDTW3LdvYKkJ6vn8DVQzmDUn4dRi76yfmmIF3QM1d10l+QgjRvNK17ZfOYJWyTV8CM6GDe35l0fTYQ3th88SPX4I0xtlxpt99dqxYj7g==; 24:6oPxS0uJPnX9qB6qI2S+oZDT/tZ1NRotMVl9ZwfSbqli4dVSJv4qcDjjUCArwDN2pZ+GxiymZt/4b2lrnJnRtBZ4Z9BoRmOb8rwIrIPLhlA=; 7:PAcZXxgkbQxA1UepAwZt559yx+nPSSRmTRagVqyX4EWfclLuBWUi4rm02L/NJig5Jl4coM7JDZ1Y0UUKNOCxDaqWMkx76i/Ulc4u8DoDL4N4TtmYtLg54RREa1k+auNF6fEfu+gIsEeKOkPWfhXvpQc12csUXNlk9L0DPXZ3bYoaknDIXpCY72oxWjxNkEIwVzhzjaoHI8paiH7A/w2oWsy1Va8EnHZcpXGVR+uEnwA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:23.1504 (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: SN2PR03MB2269 Subject: [dpdk-dev] [PATCH v2 17/30] net/dpaa2: add support for link status event 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 --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 123 +++++++++++++++++++ drivers/net/dpaa2/mc/dpni.c | 233 ++++++++++++++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni.h | 49 ++++++++ drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 50 ++++++++ 5 files changed, 456 insertions(+) -- 2.7.4 diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 146e087..ba4321c 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -6,6 +6,7 @@ [Features] Speed capabilities = P Link status = Y +Link status event = Y Queue start/stop = Y Jumbo frame = Y MTU update = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index d7950a5..49dc42b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -54,6 +54,8 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd; static int dpaa2_dev_uninit(struct rte_eth_dev *eth_dev); +static int dpaa2_dev_link_update(struct rte_eth_dev *dev, + int wait_to_complete); static int dpaa2_dev_set_link_up(struct rte_eth_dev *dev); static int dpaa2_dev_set_link_down(struct rte_eth_dev *dev); static int dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); @@ -344,6 +346,10 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) return ret; } } + + /* update the current status */ + dpaa2_dev_link_update(dev, 0); + return 0; } @@ -556,9 +562,87 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev) return NULL; } +/** + * Dpaa2 link Interrupt handler + * + * @param param + * The address of parameter (struct rte_eth_dev *) regsitered before. + * + * @return + * void + */ +static void +dpaa2_interrupt_handler(void *param) +{ + struct rte_eth_dev *dev = param; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + int ret; + int irq_index = DPNI_IRQ_INDEX; + unsigned int status, clear = 0; + + PMD_INIT_FUNC_TRACE(); + + if (dpni == NULL) { + RTE_LOG(ERR, PMD, "dpni is NULL"); + return; + } + + ret = dpni_get_irq_status(dpni, CMD_PRI_LOW, priv->token, + irq_index, &status); + if (unlikely(ret)) { + RTE_LOG(ERR, PMD, "Can't get irq status (err %d)", ret); + clear = 0xffffffff; + goto out; + } + + if (status & DPNI_IRQ_EVENT_LINK_CHANGED) { + clear = DPNI_IRQ_EVENT_LINK_CHANGED; + dpaa2_dev_link_update(dev, 0); + /* calling all the apps registered for link status event */ + _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, + NULL, NULL); + } +out: + ret = dpni_clear_irq_status(dpni, CMD_PRI_LOW, priv->token, + irq_index, clear); + if (unlikely(ret)) + RTE_LOG(ERR, PMD, "Can't clear irq status (err %d)", ret); +} + +static int +dpaa2_eth_setup_irqs(struct rte_eth_dev *dev, int enable) +{ + int err = 0; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + int irq_index = DPNI_IRQ_INDEX; + unsigned int mask = DPNI_IRQ_EVENT_LINK_CHANGED; + + PMD_INIT_FUNC_TRACE(); + + err = dpni_set_irq_mask(dpni, CMD_PRI_LOW, priv->token, + irq_index, mask); + if (err < 0) { + PMD_INIT_LOG(ERR, "Error: dpni_set_irq_mask():%d (%s)", err, + strerror(-err)); + return err; + } + + err = dpni_set_irq_enable(dpni, CMD_PRI_LOW, priv->token, + irq_index, enable); + if (err < 0) + PMD_INIT_LOG(ERR, "Error: dpni_set_irq_enable():%d (%s)", err, + strerror(-err)); + + return err; +} + static int dpaa2_dev_start(struct rte_eth_dev *dev) { + struct rte_device *rdev = dev->device; + struct rte_dpaa2_device *dpaa2_dev; struct rte_eth_dev_data *data = dev->data; struct dpaa2_dev_priv *priv = data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; @@ -568,6 +652,10 @@ dpaa2_dev_start(struct rte_eth_dev *dev) struct dpni_queue_id qid; struct dpaa2_queue *dpaa2_q; int ret, i; + struct rte_intr_handle *intr_handle; + + dpaa2_dev = container_of(rdev, struct rte_dpaa2_device, device); + intr_handle = &dpaa2_dev->intr_handle; PMD_INIT_FUNC_TRACE(); @@ -647,6 +735,24 @@ dpaa2_dev_start(struct rte_eth_dev *dev) if (priv->max_vlan_filters) dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK); + /* if the interrupts were configured on this devices*/ + if (intr_handle && (intr_handle->fd) && + (dev->data->dev_conf.intr_conf.lsc != 0)) { + /* Registering LSC interrupt handler */ + rte_intr_callback_register(intr_handle, + dpaa2_interrupt_handler, + (void *)dev); + + /* enable vfio intr/eventfd mapping + * Interrupt index 0 is required, so we can not use + * rte_intr_enable. + */ + rte_dpaa2_intr_enable(intr_handle, DPNI_IRQ_INDEX); + + /* enable dpni_irqs */ + dpaa2_eth_setup_irqs(dev, 1); + } + return 0; } @@ -661,9 +767,25 @@ dpaa2_dev_stop(struct rte_eth_dev *dev) struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int ret; struct rte_eth_link link; + struct rte_intr_handle *intr_handle = dev->intr_handle; PMD_INIT_FUNC_TRACE(); + /* reset interrupt callback */ + if (intr_handle && (intr_handle->fd) && + (dev->data->dev_conf.intr_conf.lsc != 0)) { + /*disable dpni irqs */ + dpaa2_eth_setup_irqs(dev, 0); + + /* disable vfio intr before callback unregister */ + rte_dpaa2_intr_disable(intr_handle, DPNI_IRQ_INDEX); + + /* Unregistering LSC interrupt handler */ + rte_intr_callback_unregister(intr_handle, + dpaa2_interrupt_handler, + (void *)dev); + } + dpaa2_dev_set_link_down(dev); ret = dpni_disable(dpni, CMD_PRI_LOW, priv->token); @@ -1458,6 +1580,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->dev_ops = &dpaa2_ethdev_ops; + eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; eth_dev->rx_pkt_burst = dpaa2_dev_prefetch_rx; eth_dev->tx_pkt_burst = dpaa2_dev_tx; diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index f95e669..6f671fe 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -351,6 +351,239 @@ int dpni_reset(struct fsl_mc_io *mc_io, } /** + * dpni_set_irq_enable() - Set overall interrupt state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @irq_index: The interrupt index to configure + * @en: Interrupt state: - enable = 1, disable = 0 + * + * Allows GPP software to control when interrupts are generated. + * Each interrupt can have up to 32 causes. The enable/disable control's the + * overall interrupt state. if the interrupt is disabled no causes will cause + * an interrupt. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_set_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint8_t en) +{ + struct mc_command cmd = { 0 }; + struct dpni_cmd_set_irq_enable *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_IRQ_ENABLE, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_set_irq_enable *)cmd.params; + dpni_set_field(cmd_params->enable, ENABLE, en); + cmd_params->irq_index = irq_index; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpni_get_irq_enable() - Get overall interrupt state + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @irq_index: The interrupt index to configure + * @en: Returned interrupt state - enable = 1, disable = 0 + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint8_t *en) +{ + struct mc_command cmd = { 0 }; + struct dpni_cmd_get_irq_enable *cmd_params; + struct dpni_rsp_get_irq_enable *rsp_params; + + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_IRQ_ENABLE, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_get_irq_enable *)cmd.params; + cmd_params->irq_index = irq_index; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpni_rsp_get_irq_enable *)cmd.params; + *en = dpni_get_field(rsp_params->enabled, ENABLE); + + return 0; +} + +/** + * dpni_set_irq_mask() - Set interrupt mask. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @irq_index: The interrupt index to configure + * @mask: Event mask to trigger interrupt; + * each bit: + * 0 = ignore event + * 1 = consider event for asserting IRQ + * + * Every interrupt can have up to 32 causes and the interrupt model supports + * masking/unmasking each cause independently + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_set_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t mask) +{ + struct mc_command cmd = { 0 }; + struct dpni_cmd_set_irq_mask *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_IRQ_MASK, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_set_irq_mask *)cmd.params; + cmd_params->mask = cpu_to_le32(mask); + cmd_params->irq_index = irq_index; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpni_get_irq_mask() - Get interrupt mask. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @irq_index: The interrupt index to configure + * @mask: Returned event mask to trigger interrupt + * + * Every interrupt can have up to 32 causes and the interrupt model supports + * masking/unmasking each cause independently + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t *mask) +{ + struct mc_command cmd = { 0 }; + struct dpni_cmd_get_irq_mask *cmd_params; + struct dpni_rsp_get_irq_mask *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_IRQ_MASK, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_get_irq_mask *)cmd.params; + cmd_params->irq_index = irq_index; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpni_rsp_get_irq_mask *)cmd.params; + *mask = le32_to_cpu(rsp_params->mask); + + return 0; +} + +/** + * dpni_get_irq_status() - Get the current status of any pending interrupts. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @irq_index: The interrupt index to configure + * @status: Returned interrupts status - one bit per cause: + * 0 = no interrupt pending + * 1 = interrupt pending + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t *status) +{ + struct mc_command cmd = { 0 }; + struct dpni_cmd_get_irq_status *cmd_params; + struct dpni_rsp_get_irq_status *rsp_params; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_IRQ_STATUS, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_get_irq_status *)cmd.params; + cmd_params->status = cpu_to_le32(*status); + cmd_params->irq_index = irq_index; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpni_rsp_get_irq_status *)cmd.params; + *status = le32_to_cpu(rsp_params->status); + + return 0; +} + +/** + * dpni_clear_irq_status() - Clear a pending interrupt's status + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @irq_index: The interrupt index to configure + * @status: bits to clear (W1C) - one bit per cause: + * 0 = don't change + * 1 = clear status bit + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_clear_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t status) +{ + struct mc_command cmd = { 0 }; + struct dpni_cmd_clear_irq_status *cmd_params; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_CLEAR_IRQ_STATUS, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_clear_irq_status *)cmd.params; + cmd_params->irq_index = irq_index; + cmd_params->status = cpu_to_le32(status); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** * dpni_get_attributes() - Retrieve DPNI attributes. * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h index 092d3b3..5227ea1 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni.h +++ b/drivers/net/dpaa2/mc/fsl_dpni.h @@ -247,6 +247,55 @@ int dpni_reset(struct fsl_mc_io *mc_io, uint16_t token); /** + * DPNI IRQ Index and Events + */ + +/** + * IRQ index + */ +#define DPNI_IRQ_INDEX 0 +/** + * IRQ event - indicates a change in link state + */ +#define DPNI_IRQ_EVENT_LINK_CHANGED 0x00000001 + +int dpni_set_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint8_t en); + +int dpni_get_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint8_t *en); + +int dpni_set_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t mask); + +int dpni_get_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t *mask); + +int dpni_get_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t *status); + +int dpni_clear_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t irq_index, + uint32_t status); + +/** * struct dpni_attr - Structure representing DPNI attributes * @options: Any combination of the following options: * DPNI_OPT_TX_FRM_RELEASE diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h index 81226aa..1a48332 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h @@ -64,6 +64,13 @@ #define DPNI_CMDID_RESET DPNI_CMD(0x005) #define DPNI_CMDID_IS_ENABLED DPNI_CMD(0x006) +#define DPNI_CMDID_SET_IRQ_ENABLE DPNI_CMD(0x012) +#define DPNI_CMDID_GET_IRQ_ENABLE DPNI_CMD(0x013) +#define DPNI_CMDID_SET_IRQ_MASK DPNI_CMD(0x014) +#define DPNI_CMDID_GET_IRQ_MASK DPNI_CMD(0x015) +#define DPNI_CMDID_GET_IRQ_STATUS DPNI_CMD(0x016) +#define DPNI_CMDID_CLEAR_IRQ_STATUS DPNI_CMD(0x017) + #define DPNI_CMDID_SET_POOLS DPNI_CMD_V2(0x200) #define DPNI_CMDID_SET_ERRORS_BEHAVIOR DPNI_CMD(0x20B) @@ -169,6 +176,49 @@ struct dpni_rsp_is_enabled { uint8_t enabled; }; +struct dpni_cmd_set_irq_enable { + uint8_t enable; + uint8_t pad[3]; + uint8_t irq_index; +}; + +struct dpni_cmd_get_irq_enable { + uint32_t pad; + uint8_t irq_index; +}; + +struct dpni_rsp_get_irq_enable { + uint8_t enabled; +}; + +struct dpni_cmd_set_irq_mask { + uint32_t mask; + uint8_t irq_index; +}; + +struct dpni_cmd_get_irq_mask { + uint32_t pad; + uint8_t irq_index; +}; + +struct dpni_rsp_get_irq_mask { + uint32_t mask; +}; + +struct dpni_cmd_get_irq_status { + uint32_t status; + uint8_t irq_index; +}; + +struct dpni_rsp_get_irq_status { + uint32_t status; +}; + +struct dpni_cmd_clear_irq_status { + uint32_t status; + uint8_t irq_index; +}; + struct dpni_rsp_get_attr { /* response word 0 */ uint32_t options; From patchwork Fri Sep 8 08:45:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112041 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1247161ybm; Fri, 8 Sep 2017 01:50:21 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBqeEEjrBdYjeUYg3wJ5AGgNzNKTlbgqH7zH0TX634dJ1fAZXZWi+5SrR5HLUoOdwMUL41m X-Received: by 10.28.197.133 with SMTP id v127mr1250645wmf.52.1504860621809; Fri, 08 Sep 2017 01:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860621; cv=none; d=google.com; s=arc-20160816; b=JcpECQc7Dr9vz9NqOE7Jjam5GqBj8k/8qes/V/T1IVd42C421q4GN+AXlwfRH87CcW 02r0h2ij7VY2YAPCGSX7JqWpuJcYCd2TsLRfecOiA8g7Ght7knOB21sOG9EouYajB2gS ff+Zqv8qZVNNyPgPAxhHZfE4ZSM5xFx++LjkbG/3KyCp146eyH4TEDjJM4HCHLlmrTF4 +88Tf+R4xhLQAm5DUeOmTCOxiP5jZlU35wKOtv6eJxOnyVCviIJWkCz3T3dqHOzBcjZ9 2/1gkvdwlGp28rqdShbjDtw87oKbpnkm4XJlg498OJC9xZOfA5hkg83k0x8d56G+xKB9 J5hg== 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=Gf3qrkTqcK9dn9IFFIUwsHEGXnk9Gycdn0Ji/rPNqTk=; b=09VIRg8IOCCF97vkcCEFT3e2EB84Nc8nNCyP66LOIZaPmE4+sJWfJTy9zJWLHY8Io1 ZxpVDf+hg8TYzOv8UWViYI9xplRXunYlhVGlB6XRZukMqvuoCNLdGYKfThCBZWQ28s5r vi4duil96wGpiltCW/RK1dG/0UApg/Qii3Jrz+3K34DawOudhf5Htd0X4bWyGgzAxdww bDnyf3pqlObjlgBU2F6JsInBeFAp3IcJiReLqEQpm4C6elY05NSbyb7t0nQZpgARb0xS 7d7VsrgxPDIT017PxtIM7eOWE63zCRxH6TtBFo46yrUWkxtbCQC3XpS7z49v0xujJKNo pPXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id h191si1079560wma.203.2017.09.08.01.50.21; Fri, 08 Sep 2017 01:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 B321E19A37; Fri, 8 Sep 2017 10:46:32 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0041.outbound.protection.outlook.com [104.47.36.41]) by dpdk.org (Postfix) with ESMTP id D075919A1D for ; Fri, 8 Sep 2017 10:46:29 +0200 (CEST) Received: from BN3PR03CA0107.namprd03.prod.outlook.com (10.174.66.25) by MWHPR03MB3326.namprd03.prod.outlook.com (10.174.249.144) 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:25 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::157) by BN3PR03CA0107.outlook.office365.com (2603:10b6:400:4::25) 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:25 +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 BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) 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:25 +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 v888jmoo023063; Fri, 8 Sep 2017 01:46:23 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:15 +0530 Message-ID: <1504860327-18451-19-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: 131493339854960306; (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)(189002)(199003)(6916009)(2950100002)(50466002)(6666003)(77096006)(189998001)(5660300001)(5003940100001)(48376002)(97736004)(104016004)(68736007)(36756003)(54906002)(85426001)(8656003)(4326008)(110136004)(53936002)(8676002)(50226002)(81166006)(81156014)(356003)(8936002)(105606002)(305945005)(106466001)(47776003)(76176999)(2351001)(33646002)(50986999)(2906002)(86362001)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3326; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD046; 1:GeCSonXtrLft3WzCIwXYUKDrndfJnTUItQtTFFPXjE6MW2oplDADNUN7G6PnwWdpXrbfXIZCdw/32FgaxhUxGeEAu3O+ftyrMycabdNOAcxs+Bt6icTC70gKxOjXnNfZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39045b40-b984-4822-76b2-08d4f69616d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR03MB3326; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 3:m94ELT6CFTWs6ZyoYPu0qxresivUuzMb1c42I15cnjAfjiq9E1l5EwXhLGKLdYg42wo/SPW8lkjzexqhosq4GLKXB8CCuTV85P5tigQ+Y7QW23S0gkGCCsnnxd+09zDGFID2c04B5PwXDQy8N0OcIi7FQK0pXssUxytdExAgjRbMaTN2k6/DwDqn/Tg0PU5xN2R/cwRjnhKzDzFfalnvRK+hbgFtph7BpClK+8J+9tDGW6jt2/Kb4BGNFp/a3ItRozxfZEMyMocaZwb2Qpi42a7nm4Itgb8NjW7xplzWxEx9YpIEWQnF0ueVRHGeBGSbzsEKGuNc4bv3G7FAsdCV571BsNDygLkropHUitaivTo=; 25:CDoJK5VsR9Vx0Lg/kDKLBuGukIQkQ+dKN04DpVA32AhDskYWELK/iawTHZOSasoXS04aO9t+whYExjpfI1/nnGVCnwvgqIrVeNw5QkGjjottH+Ko6Z+YW3dLUX71E/gTfQmDb87Loj3tzmIMOmZQmrdOwUQGkIvp7DIi+b9gwh2h/GOjgfG+9FFm3xTl0SOhYqVmQEaeq6ITVCLFQvJmh4qM6w1vEWTQHFME9dAS9s7yFBOPhNE7qMqkFJPllNgEiBwf0QFiSodgpiQIeVxbMIVukxZXpYUqocSK+fk7Dzj1p4PzjqMc7hmhUhegk67cYr8HZqbUvkxQcLAZTKzSBA== X-MS-TrafficTypeDiagnostic: MWHPR03MB3326: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 31:c65WhERTFamf+M3+Ly+JM3qriuFzxIZlOoewKbWOYh/YX2yNO23H2PpDPY5zqn25Ih/rBUnGWMlvsQmyv1G7dyDLXTJvu6z/LG7golUBB2OEHLwXHlSSW4B++b2HrXQQfgbGpu/aSbEkzedQrs6EFKGidDZjZgg42Jx9MKz7jhOpmIbHr57W9YHxeVJoXxP1jsO65nhkD/eM2NqFa+OLEpVX0cbm/t4XqhTHiA0u/W4=; 4:1OmuQT2+29e7p6Vv04/In0ImtWuYDh3SkCrHvaqZxgpF2xBjpjMp3W/8C4Xb6guguqa/DWdil8rXoGarIbKXCHSUelE8vbBcrKiIQVv1qACWVLxdgyfMxlScpGz+Hk2/s6OiIG10VnPpwTy7Drs/n+3DR3OXgO6EWzw0GKA3WXfbeAqp0F2xZemkUDRwkC3Xd6Zb1L2DQdz/fUB0kmVCI/Z70ZLeahKvXqD1+lnWR2UAe9sbw5v9xo4YWmSMAEK6VE6OU2Tyx5VGqIJVTC72GBaYwWs+vstS0XbJJzJ+bZw= 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)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3326; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3326; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3326; 23:T1TVUFZZTxbaTGoF42LsJ8MGC0UqVtpkdk6zSeNli?= pigzjlYUy2SnZUk+jqcSz/TwyqzrkUdi+9Eb/o/WCZFmECGqPpaLCJ0zenZwl0BYi3/HzMeNuRyQqu+ewX+YKy2AISTuZBjM1nPKRPZ24UoPAQBZAoEtqOa5iL0Ye+/dtayjn+I2bHzmqCSjrI0dL1lOyQ+wRErbTwl0WKBKvTVknhNUwHHSeRSn+kJdmM1ybQvE4MaZiMezRlopdDbT31+43wAHANs4mRp8pB8Hq389Mwr+6knrXZeTN3y+tkevQqc4+Zp/pT+FjnD36XkLyXVH+F0gkNF6wlbzXo4fV+yuQahtEYJYd8kVWKQDojn7//+bO7nYiU97E8NYVTHD1wxrXoLMoGUn0JENkTZPbonpyPl7Kp/Fk4QkmIjIz5jnM6FmlyeQpkZT+YpDn1X1WBCkO0uLh4M0n5YntIVoV16i/sCmPADGB+7EFdOu1qKaVKSaAn0DdIAvgFc74o/10r06wMxpB3T+fqTdqLFtsQllin/Uwax3kD1qFRe4TilES1BRERcINUl7yMgDy+5tiqw6TA3SLLZxd3ZKZaBnPTnmirRW4MyooWsCv3QFPuL4qNzxkummsmOubOuAVRZNlRTLG+WZ7hWy2XF6YvOM0whkb597oYElVZ9k/Ob4UQlwqv332pccdvTF4N69xaHgNZKT/TqEql+WFnw9pz0Jc3EOPnxYCRQSa7MftV39OpH8lBZOffkaOc8SMYt3pOP2UicNKIZdEXaa4ehCs2UhAzKMnEna28EOIyXeGqAaCgCgaIlNSsJK39uYuDhuYrd4CJCPNvR+xZJ7cc85txfUTy96uxgZERzT/ObigplQWUD1ZBLhYUBON7ycRMsAuR/n0owNSiY8xXPnxo1un9Gyv2rai2rViwCLciDGUAOvtrwyOxSx0sVkccU8AreJL26cFYGr2ONiYP42+XDSQOINFLKQ5TroXig+cP3hGynYYZ+e6M1ONbpQ+W+G0AH1aVYbzXG8NYhKkLkRPNxwSbaYbKN1rfUJ7Sn6Bw07IGJK+s1MA7g2EMwwu08k7Nb35AuvvvAxcYt+igMLp0kugr4YpRE5r4UjEOHf92PaMt8JKPlKKc= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 6:rqcsj5bCQgrF9QkOeQq1PfOUj359cHeRv2jrKJDypZscH3JYtU4mucx9W3Kfj+23ZVU1a+0v2jnLrS8dkRQR+Mm3DIj06r+oSeHPOwQlZZSGfqXqBWLsH/I83ziXG5dZ/B+Ymlu+rJTCsR52r5sYeFFl+k3QisiVkn3VAV56FBV6lhIGMtEbxvw6V0W6Oy2i7WvmJVNBMf9KBX+WvKG2hloWiSb2FLXZz+7KLgZ4MFQd/5tA980v7GIuHY6Q4pZ0UVobJ5cgp7dltjGNMUtl/f5CvVb/EZpOrywdRcGHpOkNSYOMdtSWK0Rxh2+ZohQK4s8BVGwAeKiqf2jlLeysYQ==; 5:MNJuhlK9UZNF1M/I366022EAmBH8Oo14xfKZDeWKKGhRoO8h8af20cKnW7Xk6wsEecuXyJhTpfJZKn4cLEmomQ404YxoUa6zUr5z4ZCCAx2/8sy2HLKWD0oJduSGuy7liKqCnPkYqGbN+AP8WTy2xw==; 24:3zPv1DKr49p2jBEw5ZI3vldMChaHPclUp/MiPHEH5UKLnrjbH7oRFMIvwpkbn7dTg2mUhPG+rayKyrAMJt7j7kI7xM4o3K7HNGG5DECZ1xs=; 7:VPptUlTfTpFYNdBFy29EK/K2huB4qw+F/AscqQoDfE51MVBGszyiHiWh9HU4tg5N3X5N3hRMHcWbIICqbFZxUwCLH3ESk3juY7EhLwaQ3Lfd2iJK+CIyCU6s+h0QzJQ9Xw/0d+PjSzZG9aALqsqFjtfMp0s1bHdp/66F1EKCVGBOuSTS0vD3SM4ACb6HI6s2e13+zgM5XeEy0DHa6EOOkVJy0wvxFZCJcxqZQCeuzDE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:25.3400 (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: MWHPR03MB3326 Subject: [dpdk-dev] [PATCH v2 18/30] bus/fslmc: enable link status interrupt 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/bus/fslmc/fslmc_vfio.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index ab1df36..81f0779 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -464,6 +464,10 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev) } switch (dev->dev_type) { + case DPAA2_ETH: + rte_dpaa2_vfio_setup_intr(&dev->intr_handle, dev_fd, + device_info.num_irqs); + break; case DPAA2_CON: case DPAA2_IO: case DPAA2_CI: From patchwork Fri Sep 8 08:45:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112040 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1246967ybm; Fri, 8 Sep 2017 01:50:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAR1UKHn2Mi4PgYqKAgxF3nl6l8dJdAFeKUD05tXI4BrIBrM9CXtkO+oZaJoYAGWrNi15Nf X-Received: by 10.28.236.67 with SMTP id k64mr1241662wmh.146.1504860609991; Fri, 08 Sep 2017 01:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860609; cv=none; d=google.com; s=arc-20160816; b=xQqsLxbmXeaJVuZxPMYYgQ7zFnDNeNOk7kiGcxKgSTW/7aFQwVaJ7j+nAqpVK5bw1Z YFzVviSTWsDN0Mg1N+BfK2n8HtSkm4eKqqTLU4CwLQ6IdtWMAlM6C35gIRI5+sT7uE0j v2vq8eLWRnXpj4+Znh7Hb9SjbCKPhm9L3IuhByoHYXJJ1EsMemY/ozAGLt6OBEzRfOQL Zj8PkJ2IBsIte9hmunWmVoRzL9hvpdliz0NR68+mib1Z1NdQIPXJnNMv0kWsy8Su3bZ0 jMFHo+mPVdhEdwq2kvmSjSaHtsw/luV0j3+c4DzjYdis7FM/nn/oelUK1GX1c574qgWb oPTA== 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=BWaiFazhqzpQJPRIBukmB7YYHeZSUdxWqHUVLNomlMo=; b=uqEw4snXl9QdUc2MMXpFwrRXo+bfz57Al95HgcLqT6wLbKeViPSHGZTPGtGYSKgCBU aXk2QApQzpIwhgKbVKH6FMZxX/DyWxBgH6hK/2vQMC2KD14BZczWSOcbdfXotJWkJew8 /jFkj88ifHgumITTPHGSRFkdycz6hTN6sRsZR8sVYI1S8mQuM2E3+S6YENDOBLmyUBCH gZFUyQkHjKvXO29TVKL6hH1wqf/Kc9BLvqzFVZ/IeZey9pLbeZKemEFP/Z4NO9uI3vrm lQYw63ZUCNsQDyWnbhVIyqe8FoG23C1ZaE22Zamu7ycepp/09JBEX0j4aS6TSEA/egAG CSOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id f90si994810wmh.141.2017.09.08.01.50.09; Fri, 08 Sep 2017 01:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 985E619A33; Fri, 8 Sep 2017 10:46:30 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0071.outbound.protection.outlook.com [104.47.34.71]) by dpdk.org (Postfix) with ESMTP id F1D3119A2B for ; Fri, 8 Sep 2017 10:46:28 +0200 (CEST) Received: from CY4PR03CA0002.namprd03.prod.outlook.com (10.168.162.12) by CY1PR03MB2265.namprd03.prod.outlook.com (10.166.207.17) 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:27 +0000 Received: from BY2FFO11FD029.protection.gbl (2a01:111:f400:7c0c::176) by CY4PR03CA0002.outlook.office365.com (2603:10b6:903:33::12) 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:27 +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 BY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) 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:27 +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 v888jmop023063; Fri, 8 Sep 2017 01:46:25 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:16 +0530 Message-ID: <1504860327-18451-20-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: 131493339874461379; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(8936002)(498600001)(85426001)(81166006)(81156014)(50226002)(8656003)(68736007)(86362001)(50466002)(48376002)(4326008)(110136004)(8676002)(2906002)(189998001)(104016004)(356003)(305945005)(77096006)(53936002)(50986999)(5003940100001)(54906002)(5660300001)(36756003)(2351001)(106466001)(97736004)(47776003)(76176999)(6666003)(2950100002)(105606002)(6916009)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2265; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD029; 1:cG15ohLwfco1ae+BOp+3GQKxcY9Ya6llvNqNKLJMIM4h95IMg5mjfh+B+felTbdeJqL6A32LEm1+r6CjxaThZpEmAY6iD5ALTGvRuaU6vY1hmg0mDKIvmSCSWHU8zsdr MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3b063dd-ebab-438d-fbc3-08d4f69617ef 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:CY1PR03MB2265; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 3:wKCa64VMkPCybj4xqGwnSYRrM+wPk41z4MeF8IFUo/2EEHdXkISo50BP1fi1tfItd2WF/SmLnDz09pQYiEOt/WK+yXtqXpUDCNLhV+fMiof2fFcMagc/0CaJwM+l6+M4XmoNPXnHLjqFbJrOxkUjV83opHTgu15auRH2/9CxURGXIORLcG1kwslF9lXGlQzFhLGEE2ZPOE1Rq5S4IBH8cqLFT2rrCwEwMn53PK3uU+LiKHVn467C8fvCxeHNgD28fTiyuDHaZLAaf1i6U0ppVoMrkTV7AW64ovuCfUREyHC7Ohs9iJp5Q5EvvcOh4Y9SDbnGXS2fpasHEnfGiXVzAdxuy7LBKE6WK5FF/nFoelo=; 25:7uokYjifLhCHdz5Goa+sFCQSzkfK4iD4XZpsvPfTbUS37fzrhxMsVruqBkt1byOfadevPT2RquB+NjWxP+5XpdCcbmWiU56hx9f75cDdlinchXMFx54SaMVMiXFC6Y8EYkGBWovdTNo6N3HZDi9pK89RnclAOxaapvsb3wqwPymY43pIiThgQTc/dqBksJQA2QzAssZH6obcUxPQ+xZab2eFBt9SmvBeWivj4mz78X6BO1yqlX2EriIJlwhtY6uFmmOxNobS/QeKnFsb2q6JrrQkgd4wA4VfZFb1nLBDR9LBpw/xsuS29M8is9Xn+PnlMn6ZlZI7FcQx7Lr5WByg7Q== X-MS-TrafficTypeDiagnostic: CY1PR03MB2265: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 31:yDEjSHtvRkIu4MY7JqVW4wSJ3OenaGZgSQal/6WfaT0VicHdf6laDEHw5sViCjCD8B/XaSnQGo9w9T+YHxfovpzIed8F321ooJXbnTgzg6rgh3Q5SoOnpEcrlhy8D28oYcQ0ZviSYQhTCDdXEyf2FLRAcCWyZlAiRjGFTWqilKODCggwf0lRCZ4X5TbIIhu8BkI495u2NgvgiS5w1gpmBO2+NLXcTE8oILUue39vgtc=; 4:Oa9xSJLViZImDy7P8nzcPQKPT92fUzHP4sxNvn0Wd8py6vfIzk8A+4e54M/3nIuWAmL5VSeLax9iAVRchmiA58dgWboUMfLBO7ZXX0Mn9eDstqfex6EAr5hV7r+/NVOErbk0k5B9NaRCrPqfY/uGLUXwGoe00peVdPhcd8qBV6iM+TXrxnUIlXxL/Z14B/rblyXZgmRffyOcfZ77yAio+PcvJoYhAYarf7DB/PoFHTOvwgp3PA/ed/22RR9zZDyifnnFAZo9fb9p+yduJwvHeURZw/dSQ5uzzAkvixFNIIo= 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)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2265; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2265; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2265; 23:mPPD4bJUJlHGi/LQyKJ3R1w1UxAWO/6TfYE1EpeQN?= vWdsz8RXnD8rrjQ/bkupVZmJcbRS2/brsqDhFLzyLZ8t9E7uuY5YGvK0vn7PSTq5LTxK3G7BEkZOxsWj0LpO6taB59FzP7FV94tbhrw2YvxD+TZDgGEcT6HrAtqFYlklxMWw9DOAhDEe1HGQrmsrJw63jjuF+SJUBB+o8ZPQRBYFdYWRS3P4j1nJDoWuUWzxLAwoEagRY+VEYQohV+9qrRuFKhlqn3Zx+r671Kty18hfuPWe0Htzz7LE1ZOMWh8VgVSMEL++oRJ5neFKl1ZbeSMJ8OeJhU4v3jaD3xlai8l2l2Vch2/UN6pawOGV4rNyGAjI9hTxBChmdWpgPPuKgeZzeKJs8PkND18XrhuMoWtaoKhcKDd2Tv4DCiiO9/ETKmxJYU+4u1nrLaH9yTktmK14A0AR+NQKgADlcHv8SvYe40ymHH1w0VyiGtJ25HdwCoZEgrU31K5qPLZmZtSqsqBphX0hJh04YVAVqk+mpVm59olPhBK8S03e0XFsHR/sfasu1+LuLfs1ZIYKvyVONTKmY5mpTgCN/TZ0qnuIIFUuVLJ6JomU2oznUtssGnjmQmyIlCe/b5N0gbqPif05y4g0LI5xw0mBxxzCutgaLjMFbuK8O2ZhPr6LSFG2XOniKAHHeOZuEfvTF8eH/fxpUVEscyj0Ej/m3u6+qjRKOuM8NRBkt3/+XqKgE/QKvF8H83zOo0bWLl4kWQG82kfEnzLAaiqScrtj5e1Tv2TTtAALOllzhMbE2JzriPzJpahdO0l8WyKR5hgm2nvnoOEGijngiqdf+PCrDCGuf+dvJab05PyPTnZNJ+56U6a4WzKhwCwIzQRrz3pVdO4ARRD96azRQowG5SkcX1AsHaEN1sXwxtK422qI4o7c3vBJ9Qdpjo/YKSkBm+Stu2NBJCDR3Vkv/18wHPwK/++w4jkd2ZPWcZRlUuy9/5aw3g9AHfUiffkbw/1fjn5kfn6niTeBlQxQSe8mtMBapiahKevWPRIsyaVMwPnt6Jb1ZR0eefSNG/OKMdjx/S9u86E/H2IuIUuKxFrIiotsOlG2eNS7vNXtcc6qOZbyf6KUTg3PtiaCOw= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 6:S6WrqPq4S3/KsjSUhai025P7nX6dtT9O0It+oHJsU27vYGH6pIFKMEKZS/HK5R9FVdWiAu/wt3SpPUWT4ST3jll9kGZOdaWrtw1iCoJ3H0mKFnr7ajVMM7olZNkvcAoYaseOkKw/lQ92vTtHtQDH3jIkmF0uuw3MaHHK/iLjE7C0cTVGNsD1xmsXPz51vqHJDWq1lx/j/eP6m7C+JnKXG3bTPri4DcozA9zUVnfKCMIwfFZa6kpLwUK84UwY0/l3EpCZcHBtl+jRvgycEUSddIPwWJ4PAmZ+yJFFsppmIqIUNgoIT8WuuzXCU2MGo6p6lX5h21AMLBGX8u0HquM/9Q==; 5:n6lZvaei8hn99DxnyVhcRCozAB4SZctSQuT4TDChOi9+jb3MCgwYkG2UCg6poAnaCBPQ4mqXyArL0VWxDn93eiSVBaGKH2RhjTTJylWv1yZ7uFsSteTzZBy3V0HdSdXnM2wt2n4YsQi1RHPTHzfMVg==; 24:ElXtdPvncWRcfK9D8HuClLkhtX09QX0K/Fl19951YUZa7DvS5VBQSrLIchbxmx04y9jMicaMCCOxGc9OblZke+DWgWlqkTChyZkr+eYxwFk=; 7:FJr8J5/eh14aG3sLY9PlYBmdTdbkLE3fhzsoV0q47Djvz75yLEZygWNwd7XomHAcCNRZYgPbfDFcbCPe9t/AxAOUdri/5jrGb9oF0E5CZ7DMfkjR+4lQiSB3e7kA5AANgUSsHeiENnHX/1rqzZELCUiwsMWx5H8QGw6OJwmkfP+g7+M5FSozUpgmbuzSEa20iqqAxQLDUNkWjk1IwdGdR5+3f5hMdt9DAv8Bw8lZitM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:27.1341 (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: CY1PR03MB2265 Subject: [dpdk-dev] [PATCH v2 19/30] net/dpaa2: check physical link state on up cmd 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/dpaa2_ethdev.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 49dc42b..74a61b5 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -666,7 +666,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) return ret; } - /* Power up the phy. Needed to make the link go Up */ + /* Power up the phy. Needed to make the link go UP */ dpaa2_dev_set_link_up(dev); ret = dpni_get_qdid(dpni, CMD_PRI_LOW, priv->token, @@ -1137,8 +1137,6 @@ dpaa2_dev_link_update(struct rte_eth_dev *dev, struct rte_eth_link link, old; struct dpni_link_state state = {0}; - PMD_INIT_FUNC_TRACE(); - if (dpni == NULL) { RTE_LOG(ERR, PMD, "dpni is NULL\n"); return 0; @@ -1171,7 +1169,7 @@ dpaa2_dev_link_update(struct rte_eth_dev *dev, if (link.link_status) PMD_DRV_LOG(INFO, "Port %d Link is Up\n", dev->data->port_id); else - PMD_DRV_LOG(INFO, "Port %d Link is Down\n", dev->data->port_id); + PMD_DRV_LOG(INFO, "Port %d Link is Down", dev->data->port_id); return 0; } @@ -1186,8 +1184,7 @@ dpaa2_dev_set_link_up(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv; struct fsl_mc_io *dpni; int en = 0; - - PMD_INIT_FUNC_TRACE(); + struct dpni_link_state state = {0}; priv = dev->data->dev_private; dpni = (struct fsl_mc_io *)priv->hw; @@ -1213,11 +1210,21 @@ dpaa2_dev_set_link_up(struct rte_eth_dev *dev) return -EINVAL; } } + ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state); + if (ret < 0) { + RTE_LOG(ERR, PMD, "error: dpni_get_link_state %d\n", ret); + return -1; + } + /* changing tx burst function to start enqueues */ dev->tx_pkt_burst = dpaa2_dev_tx; - dev->data->dev_link.link_status = 1; + dev->data->dev_link.link_status = state.up; - PMD_DRV_LOG(INFO, "Port %d Link UP successful", dev->data->port_id); + if (state.up) + PMD_DRV_LOG(INFO, "Port %d Link is set as UP", + dev->data->port_id); + else + PMD_DRV_LOG(INFO, "Port %d Link is DOWN", dev->data->port_id); return ret; } 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+WGVWB5UJjsCUg2acQIXbbEKP12sD256t0sxS8mahR9chdJGN13IHXh9pq0cPROQfbmphc+J73/8Fd4qtLufMT+s/R7GSOzK0Q0UXqtRAomejmI72MZ0glyqNCNOLMw44shKnw6/PJDKz57NbcFIA+84QRaYp3TrF74NwKsS67EPhkyAjeBFUyG96A92xLdZALBEoIVpyc+F8/aNiQMJECXlWsJOpj35xFzLvA2x0zs+KnJtdwuCZC7wpd/PuysdrkBW9ehIIIymYzlxKo1YEECxG4pP8VNDyul+m6RC3vVxf57DMCvUlhRqOGhzjyF47czIYiGbWNWRZz7rCwJ4NaDAQs+nDewYeR/DKyM8HX/qODczSWyGbXGSHvnu9UxPCy/v5f2KIJXu/wExosJ8rCmPajMjRQvBNxVZ1BTkd8Rg5yYQ08g/63ehpIqOWL6L3H9UGuaAimWZ+WNJobNAlGSb5E1iCwK4= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 6:/sWH0D38hNyF39Lynx96Yorv7xBZoIKhgolQqDkoQeEJa7oPU+ol38jjxR/q5TOt/tzx82My/25BeKs3dO8YXWQYR59CvnG8c/nuq6nTqHq4imWtGCrps/Nh6pwy0z0G+JSdmlsDYJSWRaMePoX+rLhM1ciKZk6JV3zgqQAaq4a1GE+EZShpF54Lx87Wku09dlmZ9UC91ay6Ykai+vkEAWcu/hCFH17L6cxX3Dw9XdwWuboBHLxL+645T4L16gdtUTfyI5D3gNLx0V49Zd/2bDbU042GB1PCAmxQaLkBt681cfkk+/wiksooBCXX4KTfIdIFMNOyDAMbTxQZfNIwZw==; 5:uU0hbayB621eS+2PQQpbOSeCU2PsJFhqKYcY3wzIfRGqOglS89yoWdwfSrTdTV/bbOAQr+KlnBVN3p7iOI0Em9waLK6jnDdngvtSbHEGYkCA9QEORBewyTIHEk6aFB4XFTLyFZjSdZ2qKiBfH6/RQA==; 24:L6gNAAA2qAWq8bLNIBbP8ioXbWJ4KpkT8AbrUFe4DL6+cSkUTBcf7jGlP5SW8NLH4yOp/RGBzbLJoj5kIUlSJdpVn22zZvcEvHrY/Ks844s=; 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 From patchwork Fri Sep 8 08:45:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112043 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1247733ybm; Fri, 8 Sep 2017 01:50:51 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6I6/4s/NWH8kFD14gMffL+YzFs5yf5Q0aGwNPqzuR9nCXfbwMdO8HeNbKOPuTWAPqZsA0U X-Received: by 10.223.142.83 with SMTP id n77mr1399047wrb.108.1504860651205; Fri, 08 Sep 2017 01:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860651; cv=none; d=google.com; s=arc-20160816; b=no+WNEFnYgJbUCNsStbvlXVo8YJWunEEEErBaF3cbHEoEnKrnbxRVu4lsGk139rqg0 tZkeOOXIjiDwLKymanIgyyM9TyvVdgptet7EDWqHwzzrqucPUIy4AlKIBlZqkuDA0H15 si0hYEOUOgnpzbzcAsX/gS2+VtPdgdr9xZcNOGS35bH9Og/IdqkI94SOwiA7hSBj0OAw 4hPORypWj9TjovSYgTQRPEcYO7qBOzov4RJip6ejLQKqnVylWr6GdnOvnEr223VfCs5b IIe8ubDy4vqac3Y7QOH72ce579k40Gop/JoP9UKdQQ4Xt4iB/TXXxcbD3mEW2SspBa+7 9APQ== 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=NczOuX4CZ+UxxHQj9FocLrecBwPqIAgfUM/oMriNJqQ=; b=Af2tJ2mDb/gYZC5bZshcUkbSVzowmfx2W9+nbzklzm5/WtOaKn3PZoMw//eZkoczfQ wS5B3k0FiiZ5hM0EUWoVkEJntw2rtecdWcPUBZWHn5XGJsHIt7He4f5QEtwkHSiKGxlc JQhmIaT9w7ixnkbqdbji8AHFOVBcTHWEZ+SIgdDsUqrpy2AasvOKB6wklwm9iCWRrUs9 X8FTERqxKEM+TRw20MilYlhJSTCn0zMD9ur//MBc5hccw9B+25l0Xjcc6+DcRHNmJisV JlMeFCw+b+v9cmrUh9zwQQkMGxDKdy/vEzeyo87CnsdU6hoQsMnysBJUdarJOWHQM0B8 7t0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id x3si982904wmb.135.2017.09.08.01.50.50; Fri, 08 Sep 2017 01:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 9E9D519A47; Fri, 8 Sep 2017 10:46:35 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0052.outbound.protection.outlook.com [104.47.37.52]) by dpdk.org (Postfix) with ESMTP id 9942B19A3B for ; Fri, 8 Sep 2017 10:46:33 +0200 (CEST) Received: from BN6PR03CA0091.namprd03.prod.outlook.com (2603:10b6:405:6f::29) by MWHSPR01MB180.namprd03.prod.outlook.com (2603:10b6:301:7b::21) 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:32 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:120) by BN6PR03CA0091.outlook.office365.com (2603:10b6:405:6f::29) 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:31 +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 BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) 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:30 +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 v888jmor023063; Fri, 8 Sep 2017 01:46:28 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:18 +0530 Message-ID: <1504860327-18451-22-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: 131493339909196822; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(36756003)(97736004)(5660300001)(189998001)(54906002)(47776003)(53936002)(5003940100001)(68736007)(104016004)(85426001)(498600001)(50466002)(48376002)(110136004)(81156014)(81166006)(106466001)(77096006)(8676002)(105606002)(86362001)(356003)(2351001)(33646002)(8936002)(305945005)(50226002)(4326008)(2906002)(76176999)(8656003)(50986999)(6916009)(2950100002)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHSPR01MB180; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:D7xBKxYpZao86VjqY44RCNKz+7+S4kgzvBwZYSOnetJtYjcV0/h7FG86504XQBJ0IouTdu9xnTjQyJc6QNf9bmqHJZWSIy9IMbbAiBb1xFGWjsM+mYD7GU6pIJnwx+5b MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92461f0b-6b3c-4d6c-aab5-08d4f6961a12 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHSPR01MB180; X-Microsoft-Exchange-Diagnostics: 1; MWHSPR01MB180; 3:OhZ6GSJJYOqXEtS9yUoRCtsv7Xb35ScK7jBMKiBiCLYUiPCMYx6s1YyAfGxdy5LDAmQX1cv3y5z1ud9pp/qi/05OcDbEU+BRug9LZ4VaHkAs5NF5zQ3FkLMAdP6yxmC9BG9u/IsY3KnQEiCOmIZzN50Xtv4Oaj7tU/wyf6Y8MN2w5rGr9kk4G52IZwVWCpGYoMiNDI9FXFbYUHQ9OAeAeE1Ws2LG2YiAEaTEmmB0bsZpAIIt7GJNChyP7GNiBIgPAYsIKxd6DcvvINB+zJv4b2z7fLrcWy7fjD/IdjFFbzEhCNKvTjmOTFmAYMpln4z/cU5L2STe5mKMqwrukLCKDP/1BMfCGiUVQNKgB/e1C7M=; 25:EVfZ2X4QMdVtwqqffeOH8qtMgWxpspGvIMzeoRrVjvO9HvUknOJzkmeoQFWmtxFjcpbVYb3noEUESUORDZnasaDwfXP7YkgYJSXEe0JKSo4lAiaI4QGaoJY9RbrW/hgqYy5v9fmW3ctXNrL5tEgxbjujDJGuyIh7eHkl2PoA9Y/nHBoy+f+e5Bijpgth01f30NodwourVm/ntqI9k/pj/P8uhG1RtzKeByk0or1+69ow9dQVctrf88Pg8C5/hX/JT5rWcaItcsiPm9ILDBDrw8vREojS0uHyOmK/QjqAj4gRBiL6cOoqE5ddKWvsrTln/Wx2fI0IucJ7VsEyol7XSQ== X-MS-TrafficTypeDiagnostic: MWHSPR01MB180: X-Microsoft-Exchange-Diagnostics: 1; MWHSPR01MB180; 31:afD3bC4arYVvVRymAVK8xzXNXKHPrQ7oRDT8GEmsjmVYOVVrnECJz4Ft9j9VNfCPMp44HybmyclnvTHtvqRLHDVBN1ESROIocL8+cMJne1d2Nt7iRtWPcNvoKP80UA1vkMO6DqpqxZuqrqaYTMVr7OSZyDfmJ+yuTNtHQmrbMDr2AcUSNzfcxypxFLZxS+rxxGYReAlMuSjm7+jyvtNuopX7c3S+y3HIzDTWJPiu4uk=; 4:PvF7Qw/sWP27uQzSo2k4Lc329vBka77+idJHO/DAXvwlqxwijQ8M/KAYaANRYXKXBSnAoHSGcwqXaUsX2K9zxcBoz8VS6Toedh7AQUCWQpmOfCOcPmgAHAXdBWJfy3bvp/AtOyx2jraHBc5y2RoAMvW4jb/sqfkXyeLwShmg63tcLkXhL3lP88fLwSP74gsq9W1SoZjbQklAGSiFQ3KI0EBBxfdvL1jd54x5yPmPLwnG01m8Y+UxswPPQklrZHpW6MOy+a7V01Owz9fKYhdXr+ywyofMub/RyvnrhM2zQXA= 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)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123559100)(20161123563025)(20161123565025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHSPR01MB180; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHSPR01MB180; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHSPR01MB180; 23:6T5G/QiyjKEzfhnx3BlFdi1Q3mG6OF6DURRYckGIZ?= mtBx81MyhLF87pGaaVJ/d/QLA4y3XRpco3YUMct/MAmIUZC8X/gwwWX8x9OhflzahyQSxl3kTkr5bEhcJA+9lMtBK6EQ0YzFVdhVYxaUa9YNL7U2ErixgEWnp3AixGxDQ23FpMSNCQA60O81BhNhcNKFvzLKkrdmpLgJcH2Y4g0+BugcXeFxYfDQvbhUQTkz64AWQYnmFWxMpcACYgiTfIUJ/JIu0cAs6FFhca1tKg82Z7bnx85R8KPmarz/iJqTe5gfgKKWNYnUVVxjSzXkN/m6kklh8wmZ+1+wW8r4E325+vFh5OEeT7eIGmgixBLY8enoPgP2ZV/8aFpcVoMAIsxj/xYLLLaebod8OxTBy+Z8tAml+PzFAG+Eo56e8iiKWAI4ywtsifLLEfiJFdAgVYK5Zrqgec1a3kpRAKWasriRPPjXDh9bjTfVLi1jxOUQLXQiCgHL6uirYOyZX3Vukej9AaNkJSeWbaZAVaFbD/mg+IJN9jysouoVs/OL8CJpFNNNJvszZBzd/PuRrk/m8coLZd8dQDcczJ/1bwAsYQkgp22PESw+bnDou/GhmK27gBLhm2qPCvzuTlmldFIhFhwvFbrS6cXE5Ggt1f19kOwDtfXkM+cKAORIrPYb9oKCgvA2YeE39KKy5DiGf+6TORZIeQrf99mAKHtmCODT5B5my8ltYoXH0B/aC6Mc/pB+hsQ/RGX7hmuWGCvsYFpUMdqNunfuu2stVvEMNh6YhSvlTsfMxis7o4EI8pGNdtS/Hr8Pq9Cud9D1Wrmq0UsCdz+T1QAxlwQACNe6Q7oHJBz9eBvLSrXdhLuE4wGGVBtAFnf0QTO9bmxs8MKO/15RL3IWyvVzL/q813rJgQr+P2psLmJ4pYi30CqwriKSDkHUdOHAi+Z0Niy2UIwc2Z5asLWgu1gmjscd4GNebt9PwMoUGctp0XA5fLr3oNR7vjr80RABP83IxQCJL0XlbPvxk42ehcm0PUXatHEqZ6NWkR1FWi2iXjDcs9cd3nEOlmZV6YDzSWjbu25WEQ10V/OeBgCcA6VXKDTxQCTIIN8S1utXUE4m6t7TO3AjC9K94i660c= X-Microsoft-Exchange-Diagnostics: 1; MWHSPR01MB180; 6:JEtYgogfvMfdPynOeAuCW1+UNPBTwgqxdaEbGVGhaFDgZN7iF4DA/RDt9NbZCffdM8KuM630jYhZigCBomfqo1JzIeSg7Hu5PM42OpSmuXuOYkPk8e+fnTgzdpqJCuihsexfbpYmQgDgwQFrptajG6UJGk08DI+4Wqk7DydCS/9e69oi1id9Ejl2UDVfoZeh/zGXStHooVdVhU2ar3l9vXw7oeBiG6TzNG+wrdsFEUOoDGtMyA4Kamfjveve9Kh8gG/EOZt7/gFm4LdbWdwRHyAOYbL3YHIBuFeitPgqzB0bmmKPzGuKJem1tPmP/6mQJh4gKcRWsRmLs01F7w4HSQ==; 5:Yy8J87CPkrK8KoRH4mJPu77Zuo8ToFirSegA6zBIpIx6Iq6LaF6TbX7FZC19UKFsiAGVUPz1O3X3+aTJ77jrSPGhxU7W6ZCDylP+LvMfrYX/GU88KOis02h/SWszfUlspFjtHHAWlNufteX25jTLLw==; 24:SIIh4JjrBJC43k5E8pWqHNf1Icy4WArsWY1n3tqIAWupJNaQT0nOvnp/qD8+hDlbmiQEDjD9is1hLE/HJjbg3D6dI0irqSGvfPd3g1oFVxY=; 7:D/vpU6S9mCpAimDL2Beo9QH64UdekqzCJI4Klv31OuXYNOVq1cSiBzqQkfUfGd1rH10xJFoLp4+YhBEQqrtJLrXtX7MxKwZhWrykUesjeoBNIAliUCjgspiwztIMA9PRFnhaRbEeIkxUQ3DLdTFjjJMh8xq47c7MvrYFPFIGjTnRSxXSU7yZ3PVWT6uT1E32vpA7jucfFUEkCo6IHJHBmoz9Yr0b9SzNk0jp2AVYJhY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:30.7324 (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: MWHSPR01MB180 Subject: [dpdk-dev] [PATCH v2 21/30] net/dpaa2: increase the dist param to 64 bit 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 | 6 +++--- drivers/net/dpaa2/dpaa2_ethdev.h | 2 +- 2 files changed, 4 insertions(+), 4 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 7e5ce64..e3ab90a 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -51,12 +51,12 @@ static int dpaa2_distset_to_dpkg_profile_cfg( - uint32_t req_dist_set, + uint64_t req_dist_set, struct dpkg_profile_cfg *kg_cfg); int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, - uint32_t req_dist_set) + uint64_t req_dist_set) { struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; struct fsl_mc_io *dpni = priv->hw; @@ -148,7 +148,7 @@ int dpaa2_remove_flow_dist( static int dpaa2_distset_to_dpkg_profile_cfg( - uint32_t req_dist_set, + uint64_t req_dist_set, struct dpkg_profile_cfg *kg_cfg) { uint32_t loop = 0, i = 0, dist_field = 0; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 6ee1a9f..7b14ae0 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -93,7 +93,7 @@ struct dpaa2_dev_priv { }; int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, - uint32_t req_dist_set); + uint64_t req_dist_set); int dpaa2_remove_flow_dist(struct rte_eth_dev *eth_dev, uint8_t tc_index); From patchwork Fri Sep 8 08:45:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112044 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1247962ybm; Fri, 8 Sep 2017 01:51:05 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC2fqeioWhBLcrnGN1cf1mc4+R9R8AjQ9pUJcJ7CX+3vZ6zs14SvkeNxxtAUCx7jy92iLPP X-Received: by 10.28.238.218 with SMTP id j87mr1168248wmi.44.1504860665297; Fri, 08 Sep 2017 01:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860665; cv=none; d=google.com; s=arc-20160816; b=BhpCx3Q9O6NvQVw6jypK3gc3SuNVCDxnXtJsOD8/RiKMs6IOMzR49rzzI++U9u5w64 ru+pMAhufGjcg6Rt87YVTwh2PirAVLvzZZrPxSjX5Toli9uixXMmiB8pIJRmkcAY8AGU mP3z9AgsxAyl50XOcmoUEahLt9cs3Sw3UR/m2ezo2xi3262VYqbvDkP3LK+2HgZm468B DmFPJtnQXaSuDnpcrGsWwpuR4Vr/Yv6327tji8zxVjN3dFACEU2V3IdIXAG/DsgqzA4i mt7hTKn/L1v1StKeCMSRwkiEPdGN8AylgS7wfYk9XzEm8ADI3u7ixxIGnQ/t8jmsqLyS URIA== 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=NpjzicoBl8V4DcKnAzqHVTRA/YBmLBMp9D7Ij+nfnVU=; b=BZ9zUtzQT/7FdzXGgJP/D/WoK0HFh2GoNrUqPAJMWXzqNFRt9hNu59Mxgqfr6FDEDW V2ngfi+gjwA+g2OcPMnsalFrEIxExfh9AeYYLm8CRfS+vFkfXgyhC61jxqbsjzUS0r+E T8OaqN0RBVat0MDKonnYYnEe/Xe+sdJi27tab6ESzRco0q+RXHmD9EfO60IplWXOL9li sf4ujEfcPzfRgXupZ0mVisy61Ex8wNxQnxvINsXJ727qX5g3OXeln9aKThLAegMn8eIX zU3Qp/l6DnZnjZboFTtjkpva35a5SaM8FbuJELkWFLkpg5aVLbdptzMfrJtizX3x/63o YAUA== 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 x11si1021617wrg.101.2017.09.08.01.51.05; Fri, 08 Sep 2017 01:51:05 -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 68C6719A4E; Fri, 8 Sep 2017 10:46:37 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0052.outbound.protection.outlook.com [104.47.34.52]) by dpdk.org (Postfix) with ESMTP id B916519A46 for ; Fri, 8 Sep 2017 10:46:34 +0200 (CEST) Received: from MWHPR03CA0034.namprd03.prod.outlook.com (10.174.173.151) by CY1PR03MB2265.namprd03.prod.outlook.com (10.166.207.17) 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:33 +0000 Received: from BL2FFO11FD056.protection.gbl (2a01:111:f400:7c09::117) by MWHPR03CA0034.outlook.office365.com (2603:10b6:301:3b::23) 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:33 +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 BL2FFO11FD056.mail.protection.outlook.com (10.173.161.184) 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:32 +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 v888jmos023063; Fri, 8 Sep 2017 01:46:30 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:19 +0530 Message-ID: <1504860327-18451-23-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: 131493339928216408; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(8936002)(498600001)(85426001)(81166006)(81156014)(50226002)(8656003)(68736007)(86362001)(50466002)(48376002)(4326008)(110136004)(8676002)(2906002)(189998001)(104016004)(356003)(305945005)(77096006)(53936002)(50986999)(5003940100001)(54906002)(5660300001)(36756003)(2351001)(106466001)(97736004)(47776003)(76176999)(6666003)(2950100002)(105606002)(6916009)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2265; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD056; 1:43PK5b9D0aW/aVNsqxBZZw6fDfNkXCyGu430LHKkDlEMBft0KGHqzYzuk3mjj8j0kNDytXygFOLz6pAjlMKbJ3Hh01NN+ggWXOPidMOMBII7897Y9kSiyA5ReOAhzMwE MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82601a6b-5f99-4347-4358-08d4f6961b37 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:CY1PR03MB2265; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 3:Og3v0AvE+9UbwTpTDVKtC3zGNjxL3kwwOmjA08hYQZwoI6ltCY/dPtGoJrFdTgrp+1X5CoCX9yd7oYu8k206QnoWvWkpyEaeZuckGS4EOQkm6NLHx5cZJUPyq1xBsDGtX10g89KdSs8VSm1LsJGDzPlGiukmRRSnAQqrqDvQ0cZ0oY0rJvpD1Uepv9w7SRxDhoyhdupb60Dts72miJCkKGwLSZvQwmHdlhhVjXrn41Q+o0i1YWmoGAhucq6ErG7aUQBdAoNgBOyDUiSzjgHUwGMS3mIWHIlTaUB1f3V2XZwxcbnU+ryaYJpVw0gY33bUzgZSjJfdep6wy7TJ3u0iZBxkZvOXgJyynWU5TiSdQSg=; 25:FJzOXGIJQoR/m9sQe2qW+kcUrKyaVPvMji6PooBeqEH36rjtvjHxfmD+3f8KyqfmXgm9ueuiXtYwEawRKv4BHweBB0UDyKI5S/KnMD6nmViP+JgxeCrS7rAKeCwiptnzTKCJ4HB6dyAfFzGs3eun+TWH8VQDQTjjxlYwn8SWKGqzweNzasftF2vIBSGqkYj8ZvvfnAUmwZDpjDFWr6CRGghzUxhQiWfgZkDkvz+NdfgG9GqB6ctKthA/HPHGGMaIgWB7drBsZjvqosGc+aA2mKcGEFV6OHCRr6YCXSkdrp8UZ3fSp2jCtbUA4Y04unnvHFqxdnG1GoYxGv+WqNzEoA== X-MS-TrafficTypeDiagnostic: CY1PR03MB2265: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 31:XS3H3Kdsbdy+l1EtjKPtPcmSNUr9X+bI8m+goxfBqzLbIZs6pWFLHcselpQ6hBS5p9C4gIoKvEq/vU53ZQTnPT3CMyQTd6I16XCqjvZCTG6yQmfLOGBauItFF82YAHTY9Ml7yoyBN+7LpOgBRD3ozLDHrbQ+BW2+KcMshWQd/TEYnSWqL+qMuXBQEro0DRk55xFXhSuuuCZZjzZecr5OY3RwaVpkbQTcfOyI/EhJaUA=; 4:tvWes/RdR8n8BRPqJ/k1uRMDVRAkh1wx6TBd3bS2suhpRZlrRItmYoypOPur2epdRD/bge4fpnvkAYXnjSewwgzCY7MSAJyz9Do+yaZa0yEDdLW1DchcSZPDKiKP+yo1Gg8driAKB21RKvRprTtslDeV7Q06uEFoSn5xym5NUjAhaRJGYahoDqq9IqdfJUKJHqAoBNXHLUwKrh8WLUQiRQcjhslQfYTHW5IXUY+0TOyVQ9MvTNgJzDLG9UiyJ695f4b45cntcj8wlMDmDPncp7NEr4zH+wTgTLEMzy4js9g= 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)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2265; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2265; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2265; 23:oixdna4JuI3ES2M3O6Hmzf3GE65nCMGXlAZeZ+gO6?= EYg87LUfSqTFdo59vlSh6jMG3pCqiCwi9OJOaI92/OHFqcX+No2EmZskUhbJmM4VKeCugGDvrHXd8M6d+Rg9vrfGciqTAZ5oG7de5GMO7x/J0o0M+84GHDcgtV3lnFusRP3pTvdafDGR2lknBHx+a40Pjr9yKfqPlJkdlGLqfAT+UhseQyBtglv+Yt6lnf8cSBftyv8temAkEcV9Ocsw7xtkz1Jr+yjJYLuPjdCpTmfKJmgGrNTEVKGood6dZZR8nq42NnB+hCPxBOwMarHGJt0siF8i9xPAbqPM51INj62QcpYw5PdbirQDhQ32MSoK/FgMc61yPCsFabAfVo9v8BEKbNQN4Qs3PJC/WPC6bo/txCulO1KVeyiDbPcQ+WWemfDIM9hZJ2X4CBzb9193dxS9dVOrHUHFXtymQeFMjYztW5TDmes+F2hq9ysFdz5hlPFobuTNiLysvgaTTvj3qQM9RblpF2JNEJ0ineMXt7+vhpBREH9wU5bTPmVI4oOe9fsjL5CsZc0ZA894mo7bcO1VXacUPAdLVQF9U4nuhuXa67vGJ5uzTIXAuGx1sFKHYaCBHMmmbhbtczGj8lCAfo8Nfq+j/NFixHYKE1IWRaPYPbr/LrdztvCZJYLFGk687j531JL/VnRwcX111bvjdnCx/mH3FMH58L7u+kXO2f4sUfT+aOKc/nUgguUZhjt8OIXOhV6Hq/hmyPE1zk1OiQPABTxj15vi35g1z9V35bwhA3y0tY9YQIe1WsZPVgWPFQWB9br/2ywjZoGEzfKqxykTLJYqbZB82/sW2zEwr8VLlFfN9sfN0jHDee/thaUGvDS9rx1gqfzQzRkF6QmgsAljEqLUjmCYT1+WbHKyg4GExNH6QG+XKIAflDdSN9MJgDwMzkHm70SX3qENBUPUQx4i2mTmei1nSV5Pomq2HbEjF+TBQd16WEw11cHoCQh4KVekFGcbqLJHUArjhkxvPyyX5fjQ+P6RuWLaYUmWnvnh0XEuZBHE6xHSqAlyW1rriCj5nWB1bSbZtSpy0P3OGVk7KUjzgIa06WU3TBgQXSfYvKc/U3TYed9bkSa85Pg0Bg= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 6:WDpwxWYrwWAWPc76P9G7uhDepmm/5pxU5Z+JHJlMbeDi8x7sWxjxEMd8zXOscl6ZdlPOB4xN+MXwvAcj3e81IpoJRGgj1fptmFwxsQfIFzm02uM09XiAgLetJ6pm1HIO7VrGUIIz6VcwF0Nn6BaURdZ0kzSNCipD35irgkQ6RNHwVaHHjkIKPHVE0oE2muU/aNxWLga1rYOrBHk+P6L1DarLHk2LDdM9RiRwzsdY6wULIAHZK2bDIHOhb57Z8iZIxZ/8Uhuf6PN9j87BiED0lQg2glc3GQ3EpHdgLeKVmX9S4DqBDUpeVR4hsIVK4JNELpMWmGEGWLBJTZj6OtUb8A==; 5:V76ixVsPu+ggb/90Jllq5eFv35XTl+vGSsNrvFpnvzhJAWAsXRCa0Y8dyfxW5FkwflRFwrXugM6Hk2b3wZ4CdDtGYfMN5OEqWhGWrx6vJLUc8GoENso4zoEbXubII5atxoOs4CPdIqsd5bysReOhFA==; 24:fUM+Mw8ANoVfkUEkQQVQl/FiDfYESG1kwMcOwkCpdqHimNNfoUimlPtHYBogsD/7+4JyOw174qdYoyxDJwxKWnmbg9mVUvpQBB6G89K5sME=; 7:srWjYIgHeQUZ0c7vHo7KQy49Iu/KsE74CFV5bQ33yqjR18cy0YFUWZf82yvqClhYtmBW6EtonKLeC119JYXhQk2U2csz12OMzAosAG5Ga8tuBtBQQPJh+tIe1/emkFM94bGXVmyzfgjNabd78AbmTD/T62AJsFAl8688O6TPnlbUS+UCrpci2B0tcD6FHelGqSZq/H7dRFOSzsnBUVbDJNtb2SaVjFByqXivaHS4w8A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:32.6500 (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: CY1PR03MB2265 Subject: [dpdk-dev] [PATCH v2 22/30] net/dpaa2: remove RSS restriction with num of queues 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" DPAA2 HW does not have such restrictions. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 11 ----------- 1 file changed, 11 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 74a61b5..0fe7a13 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -326,18 +326,7 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) } } - /* Check for correct configuration */ - if (eth_conf->rxmode.mq_mode != ETH_MQ_RX_RSS && - data->nb_rx_queues > 1) { - PMD_INIT_LOG(ERR, "Distribution is not enabled, " - "but Rx queues more than 1\n"); - return -1; - } - if (eth_conf->rxmode.mq_mode == ETH_MQ_RX_RSS) { - /* Return in case number of Rx queues is 1 */ - if (data->nb_rx_queues == 1) - return 0; ret = dpaa2_setup_flow_dist(dev, eth_conf->rx_adv_conf.rss_conf.rss_hf); if (ret) { From patchwork Fri Sep 8 08:45:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112045 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1248192ybm; Fri, 8 Sep 2017 01:51:17 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Tl8RviTgZXpmIiuf3/XV2b615cQVw7eTVIDU//abROeR3Iu60qNiIJyC5sD8m+oOErLyB X-Received: by 10.223.195.108 with SMTP id e41mr1614801wrg.51.1504860676987; Fri, 08 Sep 2017 01:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860676; cv=none; d=google.com; s=arc-20160816; b=uDzzStH/NDDJelGrml4f4Q1ZlfVVE1yQXrPZaNpHvWHxgIZdfHJjbPAnHxKdCR1Pk4 4n0R0LDR31tsi5Hx38qgoSlqmBVGUU1SBTwdOyrNR+V8XJ3fdWucL2u0n6MNtZBPKizf t1DsKbRFMGM/CHA8gYeIF31FDz8z61SSGlTY+Y9n86WxzNDO/HH9Dw0E1EIN8d7i6FRf d8FwnKD+DgO/5nLCxk5XjtctX04TFQ5yXwQ1wF1nQYUFYuvZnyRkWtFtF+6joAU1AIKq I2AyPLcd0B8DPIGBZRiGUsBGHkqqFpwC2lWQyC4NxpRyrKLQwfuQPza9evw4U4MQrZhb 7opw== 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=8m6aFAzclzjtobpr5THOWwT/wVmuyd1bEHEeTiUgnnc=; b=UXftjA+6JLUxMxWqDX2b3QPKkkEpwadb8STbvSkQIMWZ11ur9TRTcAh3fPFpQMKTNV R9Vh9oHZsNnz4lwwXVr4p1p1gkqpcgg9E8ozV4nvwOxC/cCuWngozNZ3E88xFHpS2RbT i8b7zBJCtCQyr8l/h7SUiVZKhGAUm06UhSt0cjv8k1fjPl/t6fJjwTMsXIULEA/jS332 IaJmjd6fFGMuJlEz1+UGxszluDPZNgAMFmU8g9J4dY32nd9QlQn75UqjoxMdPPxNFW3m hAE/bxHQDnEV15S8szjfyNBFvq2ULvwAoTWb59QDWF+78SjGQjznRx0xTD3SNbIEOAK7 NQNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id g126si1016567wme.50.2017.09.08.01.51.16; Fri, 08 Sep 2017 01:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 8F0DD19A52; Fri, 8 Sep 2017 10:46:38 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0059.outbound.protection.outlook.com [104.47.37.59]) by dpdk.org (Postfix) with ESMTP id 47B1519A4B for ; Fri, 8 Sep 2017 10:46:36 +0200 (CEST) Received: from BN6PR03CA0068.namprd03.prod.outlook.com (10.173.137.30) by SN2PR03MB2270.namprd03.prod.outlook.com (10.166.210.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:35 +0000 Received: from BN1BFFO11FD048.protection.gbl (2a01:111:f400:7c10::1:139) by BN6PR03CA0068.outlook.office365.com (2603:10b6:404:4c::30) 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:34 +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 BN1BFFO11FD048.mail.protection.outlook.com (10.58.145.3) 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:34 +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 v888jmot023063; Fri, 8 Sep 2017 01:46:32 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:20 +0530 Message-ID: <1504860327-18451-24-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: 131493339946516661; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(189998001)(2950100002)(97736004)(6916009)(48376002)(6666003)(2906002)(356003)(104016004)(86362001)(77096006)(8656003)(305945005)(85426001)(81156014)(53936002)(2351001)(5003940100001)(5660300001)(68736007)(106466001)(54906002)(47776003)(33646002)(8936002)(81166006)(498600001)(8676002)(50986999)(36756003)(50466002)(110136004)(76176999)(50226002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2270; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD048; 1:GbBqFdfhypjDH2q7szHHvXBstIyLrWTONw57OgMgXzIBcx9OxbCPYfof9vcrWvPuUh7tzgZw/FxbVR9ubkDsn8a/yQsZLULEVExywc419/RTRA8Alhx/3fRv/I/x/1Mt MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8bf60953-0364-490a-80b5-08d4f6961c4e 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:SN2PR03MB2270; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 3:IDxJoIjggMO9aLPqN7rhG/pBkyQXBP9D0vTUhYVg/B+N3Yb6/BMWzdp+aBC+0OOxTg7QD3FKb4JcgDjtQqjOgQM8AeFbT06AQLsEjgEHsjfkxz1PmsvAUP/uUNQvspS0ohvde37DoX+2hIJ5NgdKC7R88d8IE/1UuBCjB4AlWXVsLtiDyIKtof9yt9GI7lLkBm/7xoQXEo6bbOJuM5LbaIxb3qSPPgTzB/X5VY0Bva9TMC3E3u+KRWnZxHTvQ8sfWQdvZRGW8eKeZyaV6+SNGb+weZhUx1+tQzPVLwPnOu52jZwkRonByu3BP5HhjkXGG4jRoRPc52WGstlN9HgPSEwUPGEaQpjWAhbSmaYBOIY=; 25:UEPtieLr0jrbcSUE4oOsWsvb1vbvpBjJEnuZ5i6nty21MxqxAZwBj+p1gpFDs8Gmbjteg5NElBmcWw3DLWdHJFCqA10a6lqWuIIQCLnH41hP5IFlw4uFz5qWPZZ39eY/Q7MNAk46zvGliTBnOa8LPrJPQFEEi0piwYHSSqzQb62ZEUxHEml5TQzHiTLrQbfzNzwq3TXxxNm/eElGRoLTG0oGEEH9G2ui6ntIvOfnOhzGnhzscAiGTgrbwjigyi6x0rS24A5DG1bbh/FqaNLkFXeE6eegrze4rkp1LxAgNrN+V3+Jzry8yJLF0S3DnI9R1juW4wrttaxpP757SZ8I0g== X-MS-TrafficTypeDiagnostic: SN2PR03MB2270: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 31:rrP8VIf4gZcoICdjTmSyqEv77D0jATZr2gvl0k+EapPDEPoADCOL8cOs4hp649dhVICyhj7Ls/6joTBzeoymxK/k7V9mKt0AZ6qiLp24oXJ4iulKnMF9kbH+jpyFt+kITc31h3fbu5bP//hzXFk75gY85eNPty6glm0uPd6GUoY74nvTTQhs2KYpOgcebIcELUb0ZqZdIO+gpKfuX5Cu6tBVe9qU9TrSlwVLODJF3f4=; 4:SccftqYfpgokOomFw6EG9MwwJBYDf3BggdIoao7mgKtWLkDKLv6Ai0mIQ7MhzpoLdPYgYegBmHTTonH5Q1cIW7Nx+IHmDeAjWdnjFU9MJwUAG6lbWDC/5Jbnb0yDtO2IBldLFo+6XPkfYCIMCb61dmsFldsrPGM99Lk6G/uQkZcQiJEV1viKO8vdWOPGCMsjsQ/eYfSRaSWJTk+zB5HgW0cPkZ52aHjHuLJNPXre7jT97DXVyx6Ve5pfbx3YE41Y9p8lAZe8O7v+Q6sVf9QFnKrBIF0c2oItvJhgB9vzGhk= 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)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2270; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2270; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2270; 23:tIwyZYq+FsHtAsmOMRN3IBBx11TfkHFsnoGcGCPyA?= 1IAghCHOa7eQxKMzrCB117TmYVvK7vty65+XxPRWH6qkt1zswqxwNGCy0CClAdgq/DnPbTqJ6jLTYRw/xZ1aAZr63zMUENw72XroBcmmFe2nRTcXtzKeeIV1730OFoOdNZNmR44xlwYVpyHGm3IVzxXp4K0P8bMSLr2zsP+QS5a4IL75rHwLZq4Oj92nuSxTZ+XwwEqjbsOw5hxUOki2WpDHNVHWv6rd6PpWpNSkLs4HjvWQk3hVG762SEC/Q7pJ279rrlLAk9GIixDWhxeZUaJpN5xzeFncH55K2XVFBQFF8i+0NEJsU9qY9+XHR0fpzN1tqSdlehdrEDOaXrScM+EwmHDPJuaqQn50hKAg8euhk/R+g4KT2AFsWhoL4gHb5jmVefUgEW47seeuV8a+FEZ7injUrW58FlMVQe6c2wZz9BrdQhdUu4HvVF0ekDT4ND+fb8JK9lt0UsyyKVlRYCCyIvUAR3yYl+FbUOWGrFjcgyVara2YGCHLqirxhiWvUNp1oG7mW1mM9N9dlLavvFEtudAj05nq0WP/EaAUfRIK3rg1hXyD5Hs455F4Wp8o2p0VA/OdYsSuum98hxDlPraujKbHNsbB0K2uDe5qJmsWNu5g1N2M/Y+/4NqK51Wwp4328AO0kjAKX6sEzws7P6k5eFgGwcEQyOBKqnzB0WVgB11qlZzJrNEiTkXaRW/MKDWaxIO3VlHZDlrIzEahcGpmBNIoLSdr9fnbYa62ZCjcYFAIeRyP9SvZ4deMFweDSfHI5tbU+ZI0s9LcrYmAGYUo8VcbuZg5zl0rcBv2yQSI3zobZ0wThmPhXzyLLe0RzYUPwU4SaKc+fjVvFVHiFQZuhsQ/7e6xtW/vB7NwpfiByp6CxzV2chujbaoLMqODh3l0qOqr7HRl5L5A26Ofy+FfG/FtCCtyC1Esn0IxSVuXs0i2mce0RRlVmOUAgqy8+aOjgc24haGqs8JnAE+qh81LAo6PeTqaiXbcGQxwHzW6WiUga+CKiSXuiMv7h2GXg2RzpceEr3l5XDS/9XMc9eSSABoXMk+RzpTtjp3jcs0Tzh5QCUmwFiKaNVqIyGM/dA= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 6:RqMm1iX/sRBG5OmqHtZyUhf7O6R4fPUhDOgM80LPqcrNDgETV30HZ2S4gywPMpc11nBj/oIUNR90poGE0whgfvNo++L6yIwo7X6oEEeSi2U4SHUatJCb1bNEDi3ATp+65jcYeOkEI8zowXeKrNl3TSoc6ZvreNXk9IrSQWavCd/31MQFHkIivZLcvqu4U9vSywxuBX4aeNhSwtbe2dqpQoh0ov+etIPJAbRXHoRavNBJj5vzPSpf1cWas7lzy+W0aHowhGaato2/eW1oz8atYQLV3Nw7ZyVJp0Os+XYowZTmoJRILU7yHzMsu068Ets0yx/E5ujJej/FngVOXgHDPQ==; 5:AFN5HeNsCfzjtDpAnGrxR2E2LmIRqnXdyWN9Yw1F49eIpV7ecaUOSKoNdPkREv4amfvh7/yESSm7DIhnh/N/oqK6IoKwG8skySEJtEe77Py41toIkj8VO5UJUCLJYnUPxPN7SrT9vQ09Xbd0AWBATg==; 24:rc4tXMbFjJsM2Ia9EJVlsC+rgDbCKC+KJ0dW0m8FcTQ9bSAVr1rveyjFcCsAzMX1ADu7xXDk5THb/C02qb1NfEgCScmpbxpH4AFXbbKUQFE=; 7:49A6StGTKUg/P8iIpvMAHYKCuLkvKA+7g26IPI17i33HwLOaRs/kImaxUbj2EMrSe5hdaAwMbtmfG3BF4SHUMaUuO9TcOsS/AKf4xcxIlAWRcPwY/ruNSl/vgsdQF321tZTEWpCbJ8wiZo+C3TMtj/GNKy8YQcOYFLCBi13fvFsqz8v1aTwXDPTpiMdO+DlzDBdHI92jNs7+O1H4ciFRLhgQ54pTjJXJ5cRD+DCzm1Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:34.4800 (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: SN2PR03MB2270 Subject: [dpdk-dev] [PATCH v2 23/30] net/dpaa2: add support for RSS hash update and get 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/dpaa2_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 0fe7a13..aebcc71 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1418,6 +1418,46 @@ dpaa2_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) return ret; } +static int +dpaa2_dev_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct rte_eth_dev_data *data = dev->data; + struct rte_eth_conf *eth_conf = &data->dev_conf; + int ret; + + PMD_INIT_FUNC_TRACE(); + + if (rss_conf->rss_hf) { + ret = dpaa2_setup_flow_dist(dev, rss_conf->rss_hf); + if (ret) { + PMD_INIT_LOG(ERR, "unable to set flow dist"); + return ret; + } + } else { + ret = dpaa2_remove_flow_dist(dev, 0); + if (ret) { + PMD_INIT_LOG(ERR, "unable to remove flow dist"); + return ret; + } + } + eth_conf->rx_adv_conf.rss_conf.rss_hf = rss_conf->rss_hf; + return 0; +} + +static int +dpaa2_dev_rss_hash_conf_get(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct rte_eth_dev_data *data = dev->data; + struct rte_eth_conf *eth_conf = &data->dev_conf; + + /* dpaa2 does not support rss_key, so length should be 0*/ + rss_conf->rss_key_len = 0; + rss_conf->rss_hf = eth_conf->rx_adv_conf.rss_conf.rss_hf; + return 0; +} + static struct eth_dev_ops dpaa2_ethdev_ops = { .dev_configure = dpaa2_eth_dev_configure, .dev_start = dpaa2_dev_start, @@ -1447,6 +1487,8 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .mac_addr_add = dpaa2_dev_add_mac_addr, .mac_addr_remove = dpaa2_dev_remove_mac_addr, .mac_addr_set = dpaa2_dev_set_mac_addr, + .rss_hash_update = dpaa2_dev_rss_hash_update, + .rss_hash_conf_get = dpaa2_dev_rss_hash_conf_get, }; static int From patchwork Fri Sep 8 08:45:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112046 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1248418ybm; Fri, 8 Sep 2017 01:51:30 -0700 (PDT) X-Google-Smtp-Source: ADKCNb43t2YBYrWl/LwPrREqti9xkoDzz2JoEhq7mGNWi6bUP/6BuJJXnZGIHfmghiSyUF19yltT X-Received: by 10.223.198.134 with SMTP id j6mr1300520wrg.277.1504860690313; Fri, 08 Sep 2017 01:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860690; cv=none; d=google.com; s=arc-20160816; b=ISAJm2M4EBkgZd9qLtUxHrNtFmFqfbH0GfszCp7121lg5NfPUq52UOrsdxLiCHnM36 b6TUoSIXB0+sfXQE/HCeMn8Mzpw7WVUEqEURJg2IL3/TFlaFPHUwcu53A0UpTAyNfCQq d4A7BfulwiAWpFJKI1LqyeS1mV/SkP9erW3A7LXCuUKsBDd8XlWhn8Ar0ohq2LdYyq7d XGa59Ehhgm1v2GHxCifQml04ib8iSIJVQr6Z3MMUyBebuI17ECOZvvvdNsKAC3e3W2xe RjRfrXkZmWZxJ7ickdAzEjlnIbVBFWqNuj7zLN28zd4TaBMP1snVfGuKHijUiNd/dEb4 zCng== 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=qbIR7g1ccVoPqdt9sZJ8KDPhM0NtCbS9szpMXPAzNvk=; b=drti0kr4IipG5id0MXnbjMI6+VpmvKFE2czI8dTq+iPNdWD4jVkj3YyzuL/3s3Qhvb ze2+FSmzWCQsBwAPQMBWdC2Tqg7ihpfUd/JwYCa1xz6MsOuM5X20weAUi6etqZLJyvxx 2Ig/Q3YlakQcXeCD1ohWjWtJh+hJjyDItmoYVP/O2Zkm+fEJWvFzb5XssH72izIQ8lm6 BHN3NdaXZuir8C/hvUQ1grxM6aK9zp7KKHB0sb6I7ogQyfQbrGH2wPoUc4aYCocQJByR JzhefU9ApBxPKLxwLzIimJowwbyHtf29mT1Xd91RAFHFhRT6GfHZziw91XYPbW5I7O0p NBjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id j34si1089040wre.302.2017.09.08.01.51.30; Fri, 08 Sep 2017 01:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 8674A19A5C; Fri, 8 Sep 2017 10:46:40 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0081.outbound.protection.outlook.com [104.47.34.81]) by dpdk.org (Postfix) with ESMTP id 280CE19A3B for ; Fri, 8 Sep 2017 10:46:38 +0200 (CEST) Received: from BN6PR03CA0068.namprd03.prod.outlook.com (10.173.137.30) by CY1PR03MB2265.namprd03.prod.outlook.com (10.166.207.17) 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:36 +0000 Received: from BN1BFFO11FD022.protection.gbl (2a01:111:f400:7c10::1:160) by BN6PR03CA0068.outlook.office365.com (2603:10b6:404:4c::30) 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:36 +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 BN1BFFO11FD022.mail.protection.outlook.com (10.58.144.85) 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:36 +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 v888jmou023063; Fri, 8 Sep 2017 01:46:34 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:21 +0530 Message-ID: <1504860327-18451-25-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: 131493339967532444; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(8936002)(498600001)(85426001)(81166006)(81156014)(50226002)(8656003)(68736007)(86362001)(50466002)(48376002)(4326008)(110136004)(8676002)(2906002)(189998001)(104016004)(356003)(305945005)(77096006)(53936002)(50986999)(5003940100001)(54906002)(5660300001)(36756003)(2351001)(106466001)(97736004)(47776003)(76176999)(6666003)(2950100002)(105606002)(6916009)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2265; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD022; 1:VhQxpIMLFDdSTM8wVsZg7nS5MeuXbdX84l7MorUauUzEt+wil1wP8nVe4A66XBpmvSuYNQLxsZBQVjwdX3zd/kvkvMFVv254ukVQQWuHY80pl5kRdN1gFo/rPPR9vJ2d MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8886f094-31b7-4a46-cc3b-08d4f6961d8c 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:CY1PR03MB2265; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 3:mCmoRSTnCn+J4n/sM7GVxGnM5a/uSJ7qlC+TmEZS4vCbc5ItjKTIHphDnZr24aoMkuD5/QDj1AazC6RGNJTXUavvo3XuYHAiWVRtZrICbW4UYq02LWzPtd1mNxwK9G1FTM9+6R5NB7GxV5vX3CSs4LxI5Vabfqxyr6DYJZ+l7ZtY+zILGOGBOXkn00CMhlcTpJ7KN2RshWSetQEdExbJ0PLdeWgQ9rH++AhZxRiWdNbf7IYfwrkGbG/ijfIDqtpUl0cx1OiqS4Qnkh0gNaNm3R/sb9gZL8C2owF04XGP45/Q92bgXixtbyUg5kFrAfVDL9Ghl0i0ZWw3YgnOCO29BggUcw+cddkmWgoeNxlvcSQ=; 25:j5/D8QMG1ildl7/rbJwSlsTBKmqZlF54tlr4Jr52UNnf3dkHDG502q9n4m8FFYghsr3su2gKi71sFWcpBjajBKUbNcg+xO6d7z38NbF0+9gWGjCMyMY4ML/Xst16pHXxS1kD56Io0fRLyhb72P3GypX6fOX6vdxmfgDXXZIxEfUe8Xy6jt4vcHORo42zpeskpsohyMFhCCtop5UfNe8nFvdRIeQs0/FaTWouM7Qet6EUvDTRM4TpaxcKoSBVva/MEs0McWsTzBLJ8WseCVxLmPw6cFCQq8a6WY1CA4WOkjeJERy68vwemvdCz4FincwQ6mvqWz1ASb4V5Z5hq3qIuQ== X-MS-TrafficTypeDiagnostic: CY1PR03MB2265: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 31:aJdllHsIXAjsNfwmB+6jkMBOtTAmp50v7ohjTBOX1RBO6Tywixfk4XH+mO8xOXjPXFFp+KuHEnXHgIYoJnqA76QG+Fw6QrpejTYujODLg29DTz11Q60SBl0dVXxyZnQck6WktO+JZbJ5MrxxyrM7F8OTSqqRuKCX2eb1B93NiEaSRjnPyo8XSPq/qAkgyvXU4bK3Pd9/51g55kyNgnfFWxQNcbP3vpZ8pHAswMfDG08=; 4:SH1egQ07QM6jtckjf+iYlgIUNvZ1yaZcKaIVztuhUiKkWwiUdnJtmXB4xbmPMJ0L9kg6ZKoxdWoXz4kZjoFs/eaYA+WSEJFnLEkXRAsTp4oXRIwBJkD6Rzf+IyOi8GAeZbI3c+7m0hUQRRHOOQvOTUjmLB4mG4iwRG9DjvUTb5O+K2a1N5FgWJx129BVsW7e3rr3BPO+U53ovB63/7APpmTchcH6BDKzHPYACfx3SvU7CmPps1V5jhM62zZw6c06QrHGnUC8+1p45d98foIB9lIx7xZHDNQAbX98b26fXnQ= 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)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2265; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2265; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2265; 23:lvsI6DcVKujy3VfWK0gkEurxglZLJT7AXiNRgP4AH?= /BHwC40keznsRj8U+Fb8jwtyeIXAtZHUGGy0CcdrCym/85KXnk6veDwJjgbQSnDNqHbHUCdldrxBOO2MY1eBxVLdHeiJBF6BUMb5NWabelXwT7sAd+0T3f2tKpAD+K9E/HjmFRajYAawYVsixw5lm9nuvwaYEgFCNy518vvF3UvVpFxqcX5L/TgooyL0TbeTijnUdveyJhvf0xtkGN1QvlzShhg7de1L/43arJsO73Z6+Fz1JnCzMKMr2+D9sW2jSQOk9lRpOG2TPR6KViq7V8ujX87mjoeP03iV8pDHEKE38XjFGysWv17erjr8grYDINhB8b3F6H4idSCm9TkQvY+D52SJpyX5DPV/s8x6kYGvAkkP+ptlym41OU3Wyko9DZbteatBChPqUKyYeDmxNN0n9jxv7Sk/vSDAIZL6+shFP6fXviEp9GnW9RY+Amm/zCawOAnTNt+O3CwNO1IT86loxdsY6FCPon+MoSP2IKNQato/CELtaEllaUMUips0pwpLInD2TjdDjpPrjpnh9uhC+qk803QT2Jl9Obo+ayOZnSMmv3ja5tR5lWFgP1hofthADaLtQqxcM2LWqW8yZbASfHM8lK+LyC3k+s0ajdMIcDiYQD9Q5vPGa8sIS12uqb/Fvt855NRaqx1QLI10wiGeVphzkx8FfV7HUnCxutzIgZBL4Px8Jqt2DtoFMNb6aXlzPiAZv4EBjY8XOKxdWP7VKkc/D6TEB0lJH/aQ2k9f4fzyRLWHeL9qLnfS0t8TVKjHltzmUfDbHSGrdgN2GbrzlHLQH2eSQLzv7PO2/fhWxV7xPdY2hS4CTjOlRgw3c/uhhzTMFqrRyGSg5s+DEkYb3IRlEWgJ/jXWJZk13zmuG+gKEe5azp6aa8yzvtUvph58+VWRiteg2w+qWRT4g+xkP5N0Iv8QTDoYGcRSNIBBAk8eHl8Nq3HKoKDn/4uG7LPi1knjv6NSA3nycZ2eNZTS4rqgEKSI2HkehPlTbR288+qvogkBK4Z+9q1FgRtSzBSFppcWO1vWQKY0HWNWbFP1J502k7jJHJTDTjC1AJoFWpqPZlqBkjPPT/nNfUVGiQ= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 6:rW9BZ4YAC+HyG+rhZpWUV2moX5kK2YrjsZBDasCg+9aFTkT62ogqRdm4IlRLr93eI7SpuSO6evvC/DtD26j7bkxvTLs5PTJxihSZFsXQPu0OReIq8kUs6pguNzhEmh1QDatLSClZHl4E6RXZssrJZYDPsU+0P6TN3tDyQko2zNoLLbKHOxa6N0zgGUzRALjdrsqGt+0h2XVJH3Wq5Oo3qCnVd9hPvPQHKFW8nr7YHOEGWKnE1Z1IL654hCmHgfZlPeA1bGUXTMcYthnSPll90OZaHVVXmHEKZ9uh1qU+PZyCq+Gyh9hLuajyCDk0M0+GHGa0DZisEwrDJoiWEhOc3Q==; 5:tvJueL00rRAoLplWtxEtkSnnytDPV2aRo9CtNAMMmqZEYbUhcL3zHy9sP79Fh2Nivwg84iPnoVUGjHDDPB6198eYVqnDH22eaWR2ZqrDxXA2YsrF96tF2oHiCwF2xjl+4J7ERSiBd5hTZZ2dixibLw==; 24:J2U+diXd+xIJPrPki7I6ZWWyVCxdYNpnkzXcd0eYZTkql3hqO03HC2R/p5VMk75oNPk5PbJ+xCmp9i06cN+OCJsf8MAEpM7ACxgY5/ozQ2k=; 7:FUwcFM0shpr57Kr0GDcciDTIt8I3XcS6QoDa1yZTCglroqZQcW2OGwy+mOCqGVgFUXdbuzyj78bsUIpuHYf8UhA5vYFWDEsvipj7XsdlpqAT36XduXBBBkhWl2QvySB5GLpwNTJcaXEItgrlaD1jqn3PtJijEMy18nDjX6OaQOvnq4sf65bsoghfDuzh8Cr5ovS40Pdy+LnU8pdCEXj1de1SBTDPGBCMhqT73xhCzNE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:36.5660 (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: CY1PR03MB2265 Subject: [dpdk-dev] [PATCH v2 24/30] bus/dpaa2: add support for hw extra stats API 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/bus/dpaa/base/fman/fman_hw.c | 30 ++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_fman.h | 3 +++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 3 files changed, 34 insertions(+) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index be59858..90ded59 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -234,6 +234,36 @@ fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats) } void +fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n) +{ + struct __fman_if *m = container_of(p, struct __fman_if, __if); + struct memac_regs *regs = m->ccsr_map; + int i; + uint64_t base_offset = offsetof(struct memac_regs, reoct_l); + + for (i = 0; i < n; i++) + value[i] = ((u64)in_be32((char *)regs + + base_offset + 8 * i + 4)) << 32 | + ((u64)in_be32((char *)regs + + base_offset + 8 * i)); +} + +void +fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n) +{ + struct __fman_if *m = container_of(p, struct __fman_if, __if); + struct memac_regs *regs = m->ccsr_map; + int i; + uint64_t base_offset = offsetof(struct memac_regs, reoct_l); + + for (i = 0; i < n; i++) + value[i] = ((u64)in_be32((char *)regs + + base_offset + 8 * i + 4)) << 32 | + ((u64)in_be32((char *)regs + + base_offset + 8 * i)); +} + +void fman_if_stats_reset(struct fman_if *p) { struct __fman_if *m = container_of(p, struct __fman_if, __if); diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index 421a581..9eeb3cd 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -87,6 +87,9 @@ void fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats); /* Reset the FMAN statistics */ void fman_if_stats_reset(struct fman_if *p); +/* Get all of the FMAN statistics */ +void fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n); + /* Set ignore pause option for a specific interface */ void fman_if_set_rx_ignore_pause_frames(struct fman_if *p, bool enable); diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index f231231..a8ac56d 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -30,6 +30,7 @@ DPDK_17.11 { fman_if_set_maxfrm; fman_if_set_mcast_filter_table; fman_if_stats_get; + fman_if_stats_get_all; fman_if_stats_reset; netcfg_acquire; netcfg_release; From patchwork Fri Sep 8 08:45:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112047 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1248582ybm; Fri, 8 Sep 2017 01:51:40 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDyaPYxM3gG/lYPut/GfF0z1ho4k5n9YqZjxqMw8LOyg4WIOUUo8XBAY2dq1OyMgjW3Ebkq X-Received: by 10.28.238.73 with SMTP id m70mr1016400wmh.112.1504860700266; Fri, 08 Sep 2017 01:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860700; cv=none; d=google.com; s=arc-20160816; b=kkX8arCLYQB4EvUPGe2aAXvmDEbObqDT4R/NBKgZSkPshDcC+smk2s6plCQ7uHROdg MLG3ahvOaL+xKHOzPMycsTXbL8sYSmPEK3aeynTy8p5NanCkno1HTYKDQU36No8jf4lI yNRwERM4281HfesWyuSWbjDdYRSamy0KuGPLU6Ez41mNPXug81sCKIBiAUJvhI7ME4Bm m23pzyI00VzU2K2EftR5yvww94OOguggjiylJ+91VA4TEDGssdh9EgnIxMKFwXQ0F4N8 RsbfQ8Wiqu5LJ6ziPhHCJnAfyBtkBQv7N9TVbM5I288NAYA3y4KovLBA7rg9Pl8K6xmd DTag== 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=tfWQZj6Oa3GX62rS0k0owQ96fmQIecBjO9MaCGgtzgw=; b=aWXW5IUlPBn0TyMaTt/jcvlcPqaAf7DoLpj2wIGD0pL6CA/LomhV3KtLjGPZenjZzt Hg0FzjPGxlKgcYPpudbHaih+eTGef8sw35vsR/eoWzHC4cvcdWP9+ywfXVJ+A0bv4i7s LdoGQZTgdJiLcbWLqtXc7qlzFN1/ySjFgWprSEVn46R2lAuaoOymoqxTpM7also+e9cV i2ZiY+CRCwfan2FPiTCuu1OZovP6fgBK9QXTpdxBNUXbkWv94HivN2E28EJ4heKjzh1D +VIGsDT6Gw2Q+kIwpL12Tv8Qw8qb13AHvrT1j3thRgzk2fz5udycTvh1f9Srf/g8RcOW oRNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id a203si1012647wmd.173.2017.09.08.01.51.40; Fri, 08 Sep 2017 01:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 78BCF19A60; Fri, 8 Sep 2017 10:46:42 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0070.outbound.protection.outlook.com [104.47.37.70]) by dpdk.org (Postfix) with ESMTP id 15E8819A5B for ; Fri, 8 Sep 2017 10:46:40 +0200 (CEST) Received: from BN3PR03CA0089.namprd03.prod.outlook.com (2a01:111:e400:7a4d::49) by SN2PR03MB2270.namprd03.prod.outlook.com (2603:10b6:804:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:38 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::192) by BN3PR03CA0089.outlook.office365.com (2a01:111:e400:7a4d::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Fri, 8 Sep 2017 08:46:38 +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 BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) 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: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 v888jmov023063; Fri, 8 Sep 2017 01:46:36 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:22 +0530 Message-ID: <1504860327-18451-26-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: 131493339983904097; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(189998001)(2950100002)(97736004)(6916009)(48376002)(6666003)(2906002)(356003)(104016004)(86362001)(77096006)(8656003)(305945005)(85426001)(81156014)(53936002)(2351001)(5003940100001)(5660300001)(68736007)(106466001)(54906002)(47776003)(33646002)(8936002)(81166006)(498600001)(8676002)(50986999)(36756003)(50466002)(110136004)(76176999)(50226002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2270; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD008; 1:ixAxy+uvxHHEm/MQphvBHCXnP14/RwmJdRY5HBsGFUTFZr3gQ7eyd8u63CYgTGlqxqfvpsjkV1GrxVkjSptyr81mD6uP0lfnwDE5u1aeUksqdWvt/u5aKRuV0Xe8e12E MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43d306d8-d90f-4235-fd61-08d4f6961e88 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:SN2PR03MB2270; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 3:QzqILNLCHOy+S+VR+3zGjlUz/aJzeNc9EgBG8kw37Daj9ljoFbaAvgHl0ZDPgt2/m6p1quA2ZhPKXj8lydq5wDR0aCW3k0La11DvAdvZdd2DRIfeEB7WwR09Ou0hVyHV3Nuh/YLnZ040NuBkUxgZajddszE1MaW+Jo+pKLukMC7dtMUDuCShrUaH/Nn5ZUOOdGpVk8kvoTPmC+frIONM0HFtPGt6W3aa6zFjawlZ1fwr4Q5GIc3YWOgW+T17ip+Hl2hQaLqlKtYyQT2tRFnvbSOev/PtMFaAvAfwk2v3a5n+S/+PMipUXTxo9DBvaE9lfctVCuTZti9pg0xuO4/DNxqiEBcoegYbCa8PuL1qwRQ=; 25:i5gkMBRLMIkLEwIl2ykHG+6VYJ+Q11dsZgRLNmDy9ObMW8xexlAK6E5pgoBzznGbJsw4PvqxxRJZ/6rDx4HDkTHYZ89ktx+LSrzn1bHshdtpj37Izousj7kOATemSixi8GRxOFQ4JK411pqNOe0tl0bWR/tktkxCa+gOz2dqMGSPB9Gr1jiVjNoN7SNoX2LtLru2W5Txp7Sj+GurXAtFp9oCYepo2Fg3qpIpIqFYTZWyL1gvZaSaOYU4LN1KatMjOWBPGkxRDvrkXXtUGoQo4GiYoi+09GqFDpSgkeaj/fuWLoZtqtSqaIHQog+ct3uq6tfj+c/YeZRzNWdpp4e/TA== X-MS-TrafficTypeDiagnostic: SN2PR03MB2270: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 31:kiKKjSXQpx81kqIhB0sAOjcmeM1yT8ku/Yv7ydSs6R5FVIrBrfuISLrPIMgO2V/QC7WocE7zdcRaza3BOodZWfbav6cDF+R9U9FOyLtD+5UpZKdRe1f70odtI+7COlqmd1ckG3weFKRyCyI08abMpriTmrHWZ9s65py3TWOmGKXUHf8kSZw7YHRq+Jk73GxeDCDkgQxcfTRwFgWBBNrr/uae7DyGyvnZDpnKHlPPreo=; 4:0EjHuePWst0Gh0PusDNiAGMZnFLetCpPW9HG73hdivAOxuW7qHPgBKOQNqWaYSK/IuFYMfY4ZHNO8btyfpEl7TW3hVEtJl1FWyV7ouWtSP8z/jKjxt7jN7rhS95E6hd6304MQRws3tYFULcZMVZDH7bqmATb5rfkB8BnMfNsQ0YvTiMtgl8iYtPO48EHBK2zyeKX61DaPtW6TnQhz7Ku0xMRcOd70BCBD7/1zt8cr2H8MvT3VLJ8yfUJ5wPebraAmRmI3ykGG+QdKfwML9vs96MD5ZmTa6Udwnc5a9xKK7c= 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)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2270; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2270; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2270; 23:21C6Hm6r7oq17ckgEkAe03A60OV/+eZxU6KjwTRgH?= 123t3qsgjWoesdgsJ8gp2XsHGUcE5D79jFBMu7OMZvqwPCgX19OeuIDTZ5zUqGkBAKtsC+RBOal4b6tInpqyz1j4hcB/4hfVgp05CREpGPLqCwsqBOW7Anv7jRCXq1+vRGVxYRkAiW3z5/7EHmrJhnWyXKGIQqfvIG4m2m6CpNI0k5o9hNx9HA9KP4QvDLRKAED+TS/cTORMXpTL3kf6jaVkvXeH68U4QlIU/UsaRGmFFbLNbUrsFP7dBRE/2rReF04yaqgjpINKeWmhy/A865MvHNn5anlS6uS/hJYi7UdOucXlVIB9mxiUgw68otYuzba+UxFm5heGC0kpWbCTILpTJyh08kgRgvWz+tOclEsdtfZKmYD+dI4VxEQVVXm8cmektcAQm+JqmgP5O2Abb4VjYYZm545BfIBrmyeAz5IveGMCFKSXf4TYVaZeaz4qRVALNguCSo9WAJ799yn4BUbQ/nIgsOhZekR+NcuwzLcCBwYJOKvhjdVABRIj7jWxJJXSIORCQRaYzVWREzb9IqPm+ZyPhy0VCKFo3xJeaeLKCWzN2cELhnVaIfGj7JrWFBCuM+25EuKUBEyRUMCZLuKHVLg44908+XvrOqrA7YhuDjNSYSZVl8eL2IX4ck3Kb7AbARLQnL0hFWdEaaJTTSp38/eFaYXF5SD9lyRhsueXZxIlTZ2tYKoag8Uib8Q+33K9Sq26H8Xl3ssfXlSUHLlgcqjp+45j6/vHNM7lPkAueKMcMzrINWQqZBxK4k/rNhL9l66cfwjk+qsFryflqmpa0HUe4pAcdWGgFn3JuRpCSYm9Fzf6DrUP2kr8AL9xE3SBNSy2e3eeVutcSV/9iQsw4lw92G5ZHnN09S6nuB0QY1rhDY0rge+PRPY+ZCVKey6BibPL68TQy0n372hHHeuU8FXEJA+aC8TO3OvIcPbQriSJqfjBiWBlTElikYQj/xW4UjUCWMi2FlHDw8qEcrvdf+uSUvN4dJcQIIypKK98NDb3xZHO5qJY2jLS4GuWYeHrpeM6G+HnO/cpkDm7G1mkzMlbMKpjs+3p1B/wvsX+9srDRicvLfb23do12RC9oI= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 6:gchzwOL5Xm5EDRkaGTEDgyQSNznb8Wy0v9OoU5zVdICV7+KOVH4wa5Bv5JTHAcPgA3kksFkNHmrhM9b4+uKXef/s0mrMhIp2zLbElqzX88u9XyU82wduXLXo/GFgqT9PUz161h8ahqFyIwEz5kwGx6aml1Edx+gSsL00n74epnGusIApb9POjSowCyvDQ7I/ubmuhEUId/2GABy0wI4Go876dwJowe4HOXjX3LJOVuq5mmOF9u7zGSlfMOv+y6oClFR3Wu8WyYSucCUOeWCWZhJpapz10+Vfl79FUE9rGjPPUrlhG2CLDCiVHX16IjlXCITG+ZWYDjtDjeM/9TA2/Q==; 5:R86Cg6ffR6imYyH+ckHYhUw/p9JhctD33t9B9HxDXzYNVTuP3aO7PjK8Xskiez3nIBs/5S6hdJSYDIS6J5lyC7nTJnJZeodD6s9ZXvl5FcU+v9Y7MopA89YFMlAK+b6vVdT0RI1E3WkxBsTGfwraAA==; 24:U0yhaNH0q3Q5XyOd5bXvVrm0vRwuu55hQ7JPLxPMK7+N8vndbYCkbcIsM9Jf9y2Mn84s23DTFb4GZtqsT826+f+JsETiYbB2lL9GIV3OVxA=; 7:O3MUnXiid++MIiDnkSWZpQqzSXg7Gm7t10uPkZdHutFJfz48SG/NMEWN+vPmf6TM/hOzUwje+8UoaHrgyS+fooq0VbefzJrPdAftPMachh9Jd+h45Qa5WQ+UzalxkqwKoZGYuojNCguOE8Txml9xtyHMDaipmh028ICd1PWOr1HvFWfQhzxRdEoZKqjQdvoe9ENnisYX2YnVO7BBroXRf9gnAd22MD5/JMtALuP2pHA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:38.2032 (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: SN2PR03MB2270 Subject: [dpdk-dev] [PATCH v2 25/30] net/dpaa2: add support for extra stats 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 --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 143 ++++++++++++++++++++++++++++++ drivers/net/dpaa/dpaa_ethdev.h | 40 +++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 174 ++++++++++++++++++++++++++++++++++++- 4 files changed, 356 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index ba4321c..6ebbab4 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -21,6 +21,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Basic stats = Y +Extended stats = Y FW version = Y Linux VFIO = Y ARMv8 = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index e94cf7c..82a87f6 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -78,6 +78,40 @@ static int is_global_init; static struct rte_dpaa_driver rte_dpaa_pmd; +struct rte_dpaa_xstats_name_off { + char name[RTE_ETH_XSTATS_NAME_SIZE]; + uint32_t offset; +}; + +static const struct rte_dpaa_xstats_name_off dpaa_xstats_strings[] = { + {"rx_align_err", + offsetof(struct dpaa_if_stats, raln)}, + {"rx_valid_pause", + offsetof(struct dpaa_if_stats, rxpf)}, + {"rx_fcs_err", + offsetof(struct dpaa_if_stats, rfcs)}, + {"rx_vlan_frame", + offsetof(struct dpaa_if_stats, rvlan)}, + {"rx_frame_err", + offsetof(struct dpaa_if_stats, rerr)}, + {"rx_drop_err", + offsetof(struct dpaa_if_stats, rdrp)}, + {"rx_undersized", + offsetof(struct dpaa_if_stats, rund)}, + {"rx_oversize_err", + offsetof(struct dpaa_if_stats, rovr)}, + {"rx_fragment_pkt", + offsetof(struct dpaa_if_stats, rfrg)}, + {"tx_valid_pause", + offsetof(struct dpaa_if_stats, txpf)}, + {"tx_fcs_err", + offsetof(struct dpaa_if_stats, terr)}, + {"tx_vlan_frame", + offsetof(struct dpaa_if_stats, tvlan)}, + {"rx_undersized", + offsetof(struct dpaa_if_stats, tund)}, +}; + static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { @@ -271,6 +305,110 @@ static void dpaa_eth_stats_reset(struct rte_eth_dev *dev) fman_if_stats_reset(dpaa_intf->fif); } +static int +dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, + unsigned int n) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + unsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings); + uint64_t values[sizeof(struct dpaa_if_stats) / 8]; + + if (xstats == NULL) + return 0; + + if (n < num) + return num; + + fman_if_stats_get_all(dpaa_intf->fif, values, + sizeof(struct dpaa_if_stats) / 8); + + for (i = 0; i < num; i++) { + xstats[i].id = i; + xstats[i].value = values[dpaa_xstats_strings[i].offset / 8]; + } + return i; +} + +static int +dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev, + struct rte_eth_xstat_name *xstats_names, + __rte_unused unsigned int limit) +{ + unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings); + + if (xstats_names != NULL) + for (i = 0; i < stat_cnt; i++) + snprintf(xstats_names[i].name, + sizeof(xstats_names[i].name), + "%s", + dpaa_xstats_strings[i].name); + + return stat_cnt; +} + +static int +dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, + uint64_t *values, unsigned int n) +{ + unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings); + uint64_t values_copy[sizeof(struct dpaa_if_stats) / 8]; + + if (!ids) { + struct dpaa_if *dpaa_intf = dev->data->dev_private; + + if (n < stat_cnt) + return stat_cnt; + + if (!values) + return 0; + + fman_if_stats_get_all(dpaa_intf->fif, values_copy, + sizeof(struct dpaa_if_stats)); + + for (i = 0; i < stat_cnt; i++) + values[i] = + values_copy[dpaa_xstats_strings[i].offset / 8]; + + return stat_cnt; + } + + dpaa_xstats_get_by_id(dev, NULL, values_copy, stat_cnt); + + for (i = 0; i < n; i++) { + if (ids[i] >= stat_cnt) { + DPAA_PMD_ERR("id value isn't valid"); + return -1; + } + values[i] = values_copy[ids[i]]; + } + return n; +} + +static int +dpaa_xstats_get_names_by_id( + struct rte_eth_dev *dev, + struct rte_eth_xstat_name *xstats_names, + const uint64_t *ids, + unsigned int limit) +{ + unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings); + struct rte_eth_xstat_name xstats_names_copy[stat_cnt]; + + if (!ids) + return dpaa_xstats_get_names(dev, xstats_names, limit); + + dpaa_xstats_get_names(dev, xstats_names_copy, limit); + + for (i = 0; i < limit; i++) { + if (ids[i] >= stat_cnt) { + DPAA_PMD_ERR("id value isn't valid"); + return -1; + } + strcpy(xstats_names[i].name, xstats_names_copy[ids[i]].name); + } + return limit; +} + static void dpaa_eth_promiscuous_enable(struct rte_eth_dev *dev) { struct dpaa_if *dpaa_intf = dev->data->dev_private; @@ -538,6 +676,11 @@ static struct eth_dev_ops dpaa_devops = { .link_update = dpaa_eth_link_update, .stats_get = dpaa_eth_stats_get, + .xstats_get = dpaa_dev_xstats_get, + .xstats_get_by_id = dpaa_xstats_get_by_id, + .xstats_get_names_by_id = dpaa_xstats_get_names_by_id, + .xstats_get_names = dpaa_xstats_get_names, + .xstats_reset = dpaa_eth_stats_reset, .stats_reset = dpaa_eth_stats_reset, .promiscuous_enable = dpaa_eth_promiscuous_enable, .promiscuous_disable = dpaa_eth_promiscuous_disable, diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index e1e062e..3f06d63 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -134,4 +134,44 @@ struct dpaa_if { struct rte_eth_fc_conf *fc_conf; }; +struct dpaa_if_stats { + /* Rx Statistics Counter */ + uint64_t reoct; /** #include "dpaa2_ethdev.h" +struct rte_dpaa2_xstats_name_off { + char name[RTE_ETH_XSTATS_NAME_SIZE]; + uint8_t page_id; /* dpni statistics page id */ + uint8_t stats_id; /* stats id in the given page */ +}; + +static const struct rte_dpaa2_xstats_name_off dpaa2_xstats_strings[] = { + {"ingress_multicast_frames", 0, 2}, + {"ingress_multicast_bytes", 0, 3}, + {"ingress_broadcast_frames", 0, 4}, + {"ingress_broadcast_bytes", 0, 5}, + {"egress_multicast_frames", 1, 2}, + {"egress_multicast_bytes", 1, 3}, + {"egress_broadcast_frames", 1, 4}, + {"egress_broadcast_bytes", 1, 5}, + {"ingress_filtered_frames", 2, 0}, + {"ingress_discarded_frames", 2, 1}, + {"ingress_nobuffer_discards", 2, 2}, + {"egress_discarded_frames", 2, 3}, + {"egress_confirmed_frames", 2, 4}, +}; + static struct rte_dpaa2_driver rte_dpaa2_pmd; static int dpaa2_dev_uninit(struct rte_eth_dev *eth_dev); static int dpaa2_dev_link_update(struct rte_eth_dev *dev, @@ -1090,8 +1112,151 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev, return; }; -static -void dpaa2_dev_stats_reset(struct rte_eth_dev *dev) +static int +dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, + unsigned int n) +{ + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + int32_t retcode; + union dpni_statistics value[3] = {}; + unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings); + + if (xstats == NULL) + return 0; + + if (n < num) + return num; + + /* Get Counters from page_0*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 0, 0, &value[0]); + if (retcode) + goto err; + + /* Get Counters from page_1*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 1, 0, &value[1]); + if (retcode) + goto err; + + /* Get Counters from page_2*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 2, 0, &value[2]); + if (retcode) + goto err; + + for (i = 0; i < num; i++) { + xstats[i].id = i; + xstats[i].value = value[dpaa2_xstats_strings[i].page_id]. + raw.counter[dpaa2_xstats_strings[i].stats_id]; + } + return i; +err: + RTE_LOG(ERR, PMD, "Error in obtaining extended stats (%d)\n", retcode); + return retcode; +} + +static int +dpaa2_xstats_get_names(__rte_unused struct rte_eth_dev *dev, + struct rte_eth_xstat_name *xstats_names, + __rte_unused unsigned int limit) +{ + unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings); + + if (xstats_names != NULL) + for (i = 0; i < stat_cnt; i++) + snprintf(xstats_names[i].name, + sizeof(xstats_names[i].name), + "%s", + dpaa2_xstats_strings[i].name); + + return stat_cnt; +} + +static int +dpaa2_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, + uint64_t *values, unsigned int n) +{ + unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings); + uint64_t values_copy[stat_cnt]; + + if (!ids) { + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + int32_t retcode; + union dpni_statistics value[3] = {}; + + if (n < stat_cnt) + return stat_cnt; + + if (!values) + return 0; + + /* Get Counters from page_0*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 0, 0, &value[0]); + if (retcode) + return 0; + + /* Get Counters from page_1*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 1, 0, &value[1]); + if (retcode) + return 0; + + /* Get Counters from page_2*/ + retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, + 2, 0, &value[2]); + if (retcode) + return 0; + + for (i = 0; i < stat_cnt; i++) { + values[i] = value[dpaa2_xstats_strings[i].page_id]. + raw.counter[dpaa2_xstats_strings[i].stats_id]; + } + return stat_cnt; + } + + dpaa2_xstats_get_by_id(dev, NULL, values_copy, stat_cnt); + + for (i = 0; i < n; i++) { + if (ids[i] >= stat_cnt) { + PMD_INIT_LOG(ERR, "id value isn't valid"); + return -1; + } + values[i] = values_copy[ids[i]]; + } + return n; +} + +static int +dpaa2_xstats_get_names_by_id( + struct rte_eth_dev *dev, + struct rte_eth_xstat_name *xstats_names, + const uint64_t *ids, + unsigned int limit) +{ + unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings); + struct rte_eth_xstat_name xstats_names_copy[stat_cnt]; + + if (!ids) + return dpaa2_xstats_get_names(dev, xstats_names, limit); + + dpaa2_xstats_get_names(dev, xstats_names_copy, limit); + + for (i = 0; i < limit; i++) { + if (ids[i] >= stat_cnt) { + PMD_INIT_LOG(ERR, "id value isn't valid"); + return -1; + } + strcpy(xstats_names[i].name, xstats_names_copy[ids[i]].name); + } + return limit; +} + +static void +dpaa2_dev_stats_reset(struct rte_eth_dev *dev) { struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; @@ -1471,7 +1636,12 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .dev_set_link_down = dpaa2_dev_set_link_down, .link_update = dpaa2_dev_link_update, .stats_get = dpaa2_dev_stats_get, + .xstats_get = dpaa2_dev_xstats_get, + .xstats_get_by_id = dpaa2_xstats_get_by_id, + .xstats_get_names_by_id = dpaa2_xstats_get_names_by_id, + .xstats_get_names = dpaa2_xstats_get_names, .stats_reset = dpaa2_dev_stats_reset, + .xstats_reset = dpaa2_dev_stats_reset, .fw_version_get = dpaa2_fw_version_get, .dev_infos_get = dpaa2_dev_info_get, .dev_supported_ptypes_get = dpaa2_supported_ptypes_get, From patchwork Fri Sep 8 08:45:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112048 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1248806ybm; Fri, 8 Sep 2017 01:51:51 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4ozhHnHG+y9jRhR9L/KFQULVtzaLce4/2t4le7K+yWWyHnWsW73o4+8krIJB2/UNZ5tzqw X-Received: by 10.223.193.140 with SMTP id x12mr1347925wre.155.1504860711533; Fri, 08 Sep 2017 01:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860711; cv=none; d=google.com; s=arc-20160816; b=rekwPQIatE048FhFvMYAKIqj2NKZxSUyDIfSFRbkeVN+92q1wqHITRfeCL3Mk3XpHO SysDaPs+iECT3s+sphyIlF2AjUYBJxeeIXYd5dFtgBHmVqFxHfm6ZJ5o+Z8xFum0H8CV 0AIzARAJOeHorYA/eufyTRJ7A3OlQUaOEgCE//SeF8uG00AFGWHu+atlZGJvqEcvq3sh lih4cJ9dI4jDcBIdZ2LV7tgq4kYzzLpneIsSQrVPybLejEBpd/T8kPfDX8Wjz+NPsX/E KMOT3zfo2Qs6oyg4JaGEGaLFB7AkLe5zWyFeBPABSNTl++LzAPfOI/5PNv+aEAEl6NgV nnJQ== 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=drStGw3HNy3QTBgOsIZosheiqQFFRc87nTC9O0Ee5OY=; b=NyUH4LkHJt94e9/UgXvBJq6IPkmcxgzUDpBoJoECgRMXHRC8ISda8JBl0gB26azQyS lJQBHsxmKu1KXD3YSL+G0Q/XSZV/QIudHidOyt+QpvgvBzrbQUCxn4E/eSFLTB1og4Un zs/GPxvyOPJ2bfuopRkaanuxj3F4HEwxCysPI+jk5cl4sX9eSaOYTANbc3H1f/5bhCxU EpR6o+/ZIcdO7M0akZhGipsKrKAvH3hRpJSmjjqUYUopGqZXcwybLsntkmbo5A69Jzhc ImBgNdM3zTyIWdqQ1tPc6lLlvZ3CJAfWnqMm9WR1Zo1LOG7iwuIm7N2Ih/aLGu3KELB4 aOVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id w16si1061087wrg.297.2017.09.08.01.51.51; Fri, 08 Sep 2017 01:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 5D15C19A67; Fri, 8 Sep 2017 10:46:44 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0088.outbound.protection.outlook.com [104.47.38.88]) by dpdk.org (Postfix) with ESMTP id 8D59A19A63 for ; Fri, 8 Sep 2017 10:46:42 +0200 (CEST) Received: from MWHPR03CA0004.namprd03.prod.outlook.com (10.175.133.142) 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:41 +0000 Received: from BN1BFFO11FD018.protection.gbl (2a01:111:f400:7c10::1:191) by MWHPR03CA0004.outlook.office365.com (2603:10b6:300:117::14) 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:40 +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 BN1BFFO11FD018.mail.protection.outlook.com (10.58.144.81) 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:39 +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 v888jmow023063; Fri, 8 Sep 2017 01:46:38 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:23 +0530 Message-ID: <1504860327-18451-27-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: 131493340001464472; (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)(5890100001)(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; BN1BFFO11FD018; 1:BoaSl0F8XUvr5aeHNo0+ML9AYHfYUKj2sH8cM0Rg2T/SCb0ncvNOlQyQ4i6NLIZOxNVkmy1vTlZhr8eqAMBMauAsSi6bBKivHAB7SuYieZmxBJGX6f6UXYsl5atQ4C7b MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e8c7192-d84c-4d3c-e598-08d4f6961f81 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:546V6fEJHShTvbGzxcDKhEshba+ubhMqyiqjIbdqNALT42hK//TqJP0MINuXr41ACjwNjaDcLWPA99Bfbw6XJxZSxeh+d/3ISMF7Exk6kfdZIJ/tCIDk56DyEWZ9IOHQ69T1yi0tiZWcfNoXKev76+IQ4Svbpqq8xhLuHP8mAoSdMl3/abHFhPjkBun+30m6jXii06X/LET+2aOvuVmeLzGReVJLbDtbDZK8vyIh1WYy7vRvyVIQ3pJyj7DXkyd+NBMtHsXCfyIdo8/Gh7L3fQ91i1K9Zm8V95fiLsNj3R87xE/6u9VXvvVxtli2gf7mqMxwI4o0oErMxFk5oeC6mUbze1CkjQv5uYW5bQT0Bx4=; 25:J2njDEhBwTZThYGPnKXqqSKz4K95UwtPBiUtBrNzkVxxiEo3cKeS9qrWiqaNZKFfteWD70toWDWXD2Esr5o4Q/Rzwb6HC6boK7JLiqu4aA5JrLTR2SHZjb3Osy1BVHN+iN9Ntpzvr1iS5LlC3cK6nV1cDxccms9ZuBfv/eKB0dX/2bzu5c593mN3jBIEr6mdBMdJFSAJxpkYV3Eb6R11Up7L+uO8OsN3REzXKcSs9VtCL+1Xi5KQ3HFh4ZwnvwJBY4NpyPxHcDmDu/Jxyo5cj3kTloUKh74klyOOX/FVaTZwOlkjNQ1WY5WWlcKELiRaKQrX1RnHEbTRjZQHUwObfQ== X-MS-TrafficTypeDiagnostic: CY4PR03MB3320: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 31:61X0KYDm86FZB+5RIpCO+80QKJrJ7yB4hIhc+r1wqMnSD2TQWYjRUS8VR+MgnfmNQNfXxAti3cqRkEbB0KavR60r2vGYpWMXtLCsuoYFGkCPXX4uv/vZeMhczv7Otng2kemGSJ4iOpIJ4fo26rDemY6DGx5WbM1ohIwqMhp557dh1nksP0Dy8ItGuXSIlbkuyo26n99bPvTymPzOC6pJLiPgrhlhorF3eQSw9KC50X8=; 4:y3pob+nzrgvDkVkwQWPBQEwVJHzPxbmWc3ta62sqFKXxdUTMc4xtXqV5qbkL7Ix0+nzffrkPh2cYmU5a9La0LyolQyLQubaNqoXNxOSDfyHGJqIwsMyupSYY3q8hnBUfh82ltGK/x12teAmF9XGpK7Hhus0OApshiHl5Ow4959mj00yIXDT8fBSNfXVdrcaQQjO2abFfWqgHD2moE1dcPy1JaJbaJKKzGAlDJTfTPgeuzB+h6qIfHsgazinp9rmtwNFFE3XIiO2J7VpjqXiQbBtCUD2lE6qEC8I98UN/B6Q= 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:ArsPk7TwrJqa2gH7yUSxrit5NfKYfJ3dnoevTsrZV?= nNyF+9g3g/4Og4udxanK2s+uH9r+K1mT96aASl1BmXFdSczcd32+VIWvdRd2keiI2k/O2JrtdHu3uXEFfr+mjnJ1126XxkZfte//HGL/QKGYtZY8ydqdbZlMQAgBGC7oe4Wzuj2ZJEZpEjNH5j/9ufdbwU5Tr1OSR6Jg2cySCqqXGEdMQudZlHddMK8d7R+ZmclfJMxndEAMZwRzXxZ/2f2h9ycBBmLigmqGen1ievY4d1r9msEapJRgHQMecDVFTN9hCvEqTa9vTBJNg6k6emtFTMbnj8CCQDo9v9Jxy9GSyjF5RWwcMDkRgPA/fWF2Enlt9SCNvFOWKP22loNQDOxWtyzwGAXQtU6JE6peYCEYLd/euqNs2CNoVOz7ntaV/IJE/2NLZazuOqozX0dLSZNFP9WeKCl5XxE4g6din7XlK2Tzpo8hbOCqluR8+VVKlpUcPSLXz1QmZyizO6uVq1+Kx5+U6ObT9ClSGsSgH2vKgFA3U/wAlDPu2rdZziUTLWOctQWMjraEGB63OjKzUeos0lcjmRfSTOXiUqNkgnkskPsSY64oUgzTdRsykuHzUXr+PqqKJGukHKj1SdPbPQBP7O+5RILSOXsBD89Ck1Kpq2l8nZYpnShP9sqW88hvSV3jbaBq0m9/7WHXqXC7Dxu60YiV5FFxr48+P58jg5aE/Tmrx161493bZKNDKm75hLA3dceeoQaqKriqqnHHo8JXSjT8DLI6sRobbXK/U/XkN51c9ZBxkxl0AsRdVD5HmpBrGFgvCkIOm3KEBKthbzSCrFzGPcwd5EOeoQiSSfvfhFh3NAK5c3IvBkUJS6ijYwKUrnvl2zjqEPvVunHuKCSpnvhaZi9MJ3xF5gjAg29Zt70Q2N6NOMzKqEvdPqEMw/zDQeSXrBJ5WOpqnRvsjhPu+CDA2+Me5IB0NX7bNLVGPb60EaTWqNWulBKnRrkxpCT0B1To3NEDw+YcKdiMvpIz2lTAqe4Kao70VQeiHJ7lc+Jvx7JCXatv6K6YkH++mRMPJ58e7sJfxLlxwgK5TIf5Cme05cXLF5KLSKRnbRum63XhOljtXQh5kdN4DYnPVIcnBRbcxGnTh1LTyWFTqJE X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 6:VS6Du8jNRx8HbnU3ULvcJfLz1PqS8PgVd1/nNAMhl/FFWSD7T7k/ePozUlHMFUWMKtBI4rDcHTes1lioKuWYgFL2GVRiiyEis6mS81wi36D4/rYgslasf7PbTETtJwedzvhDqqh9IMaSZydnlFYuHhQM3iXRR5N+g7qSpIaKLpRUwmY443h4bw1X6C3QnxGdkgPTSEhb1DPhhXcqJRPgZ6psyKSP9PF3KdficlbeLT/twAYwbHmuyq7RNjSiciulwlX2KTeecVdKaQlCZ2R81WXymFZ/bry8R67Feu79OElm+rJ0poN3PQkm2MGdPvB82cq7yjHOUedPtKNsaH64Sg==; 5:rlUhUWYS0FVUjQPKyVf2YoEu8hlKNz3WoGKYr+8C3W+/g9nvezSrMzcQZSjRVQfVqvkSjMYuJrsFp70ofsxfu+wU0do4NJcq0sg8WDfaTgyyJc6qPpT+jgkSZrfMGT40H7kMQIgGYP5sAFfJly0agA==; 24:4dMsG2Pj7ho0D2XkxObWh/qc99WLFXLeiISKqWJ55yNlJlsTeUY7DbqXNFO6bBbMUvotlIFo2BOZ9OEDQq04ypqer2msDT5gmR/+3nOYUg4=; 7:a0/yASXk0v1pp5oCIqXncgh5pmGkY7uQV0SI/GfwzUBcvUsyMg0JNuVM9KtSqrKLRehCdaBG73qYFrg40inLajKtDPO78ypbPk83E0/PZIGAQT9Z9L/qOp9W10kPMVwsZSeXlvA/kqGVOSOjj1BqFWwrmXEeOuL6eoLONxpzOaZCxqnxzZbtxyXH38ABqAgeXUxoRGpXqiDGCFZKdMvE4ryUXWPjQmH5a73pDDjbU5I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:39.8500 (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 26/30] net/dpaa2: fix the Tx handling of non HW pool bufs 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" The current code is sending 8 packet in each internal loop. In some of the conditions, mbuf is being allocated or freed. In case of error, the code is returning without taking care of such buffer. It is better to send already prepared buffer and err for the current failure only. Fixes: 9e5f3e6d3658 ("net/dpaa2: handle non-hardware backed buffer pool") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_rxtx.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 75a06f5..8611d2e 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -350,7 +350,6 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, if (rte_dpaa2_mbuf_alloc_bulk( rte_dpaa2_bpid_info[bpid].bp_list->mp, &mb, 1)) { PMD_TX_LOG(WARNING, "Unable to allocated DPAA2 buffer"); - rte_pktmbuf_free(mbuf); return -1; } m = (struct rte_mbuf *)mb; @@ -382,8 +381,6 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size, DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); - /*free the original packet */ - rte_pktmbuf_free(mbuf); return 0; } @@ -582,7 +579,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) /* Not a hw_pkt pool allocated frame */ if (!mp) { PMD_TX_LOG(ERR, "err: no bpool attached"); - goto skip_tx; + goto send_n_return; } if (mp->ops_index != priv->bp_list->dpaa2_ops_index) { PMD_TX_LOG(ERR, "non hw offload bufffer "); @@ -595,24 +592,25 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) PMD_TX_LOG(ERR, "err: no bpool attached"); num_tx = 0; - goto skip_tx; + goto send_n_return; } if (unlikely((*bufs)->nb_segs > 1)) { PMD_TX_LOG(ERR, "S/G support not added" " for non hw offload buffer"); - goto skip_tx; + goto send_n_return; } if (eth_copy_mbuf_to_fd(*bufs, &fd_arr[loop], bpid)) { - bufs++; - continue; + goto send_n_return; } + /* free the original packet */ + rte_pktmbuf_free(*bufs); } else { bpid = mempool_to_bpid(mp); if (unlikely((*bufs)->nb_segs > 1)) { if (eth_mbuf_to_sg_fd(*bufs, &fd_arr[loop], bpid)) - goto skip_tx; + goto send_n_return; } else { eth_mbuf_to_fd(*bufs, &fd_arr[loop], bpid); @@ -630,6 +628,20 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) dpaa2_q->tx_pkts += frames_to_send; nb_pkts -= frames_to_send; } + return num_tx; + +send_n_return: + /* send any already prepared fd */ + if (loop) { + unsigned int i = 0; + + while (i < loop) { + i += qbman_swp_enqueue_multiple(swp, &eqdesc, + &fd_arr[i], loop - i); + } + num_tx += loop; + dpaa2_q->tx_pkts += loop; + } skip_tx: return num_tx; } From patchwork Fri Sep 8 08:45:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112049 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1249141ybm; Fri, 8 Sep 2017 01:52:07 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Y/ijlJ+Vs4pYrTE9CJR7p8NwR0wWA3n5sDbQTX6ZGgmeLAuFA7boe/lrh2bKcieiBIqqH X-Received: by 10.223.130.116 with SMTP id 107mr1351457wrb.240.1504860727184; Fri, 08 Sep 2017 01:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860727; cv=none; d=google.com; s=arc-20160816; b=snmrfy8HxuibFvXfqg/b3x6ej9d3JL4bI8EXj7Wm9Dctwfvi2XKFO9TRKgWDC8SdWq rI1OXl+QqCxtjPi8uG8H+Z36y9ByN0VVWRiz8PV6AyiADAAIjPxugOK2Ra2URmdyukfA LpSIHT40gNvPRm9FvSBX/vwG6Rr67nCs/tvC5bFbnlkwyOPSVYWtKv/dpDOxd54tHyQU lqLqjZ3m4fwZp6D1WhcpBrU+7xGF8hxXfYiLTxIo3xo73h0r9Ep2tyuiQVJTH0gFn4jG nDlU2KUhxb8eV1iOp8KZteLy60vUrT1D2r7ulI1zY+2q99B7Mu5jR3uWVqlB8cuCzpW1 RscQ== 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=RoVAPsZSUXqHu3rGqd/InzYkwehR6V1qLqYKBR0Of9Q=; b=WHRFk+eKeNQWcUI0xouSMiqs03SfMYZcVmgy+nUx107PREc1VTRXgiO3wyqfbW/qJp Frul20j5qIDHxicvN9c5B0xlsQd19an9H9FXdf2g3N3PEBRxUbDyQ7LcFSZK5VhMpvqz AQOT+NtSqb6lb75Wl9k+m2+u8QTFmXP3IlUF1UQLXQFGiCNaHyThKtH7FyDJVaD/UOqZ pBddAFLjsGpuUSvy0CSS2U2ATl4n4erV4cNuP5Zu4p2oxNFvzKpblXBtvyQHWhnrh7Xw aCOZdNL8oQ3pOl3E4skLIL84ibQNetipBekviVfW+OmJ4Gg1mLYYzNOQFGDaJ3CaJQyO vvAQ== 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 a66si991606wma.270.2017.09.08.01.52.06; Fri, 08 Sep 2017 01:52:07 -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 AFE8019A6F; Fri, 8 Sep 2017 10:46:46 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0083.outbound.protection.outlook.com [104.47.37.83]) by dpdk.org (Postfix) with ESMTP id 5F36719A68 for ; Fri, 8 Sep 2017 10:46:44 +0200 (CEST) Received: from BN3PR03CA0107.namprd03.prod.outlook.com (10.174.66.25) by BN3PR03MB2258.namprd03.prod.outlook.com (10.166.74.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:42 +0000 Received: from BY2FFO11FD016.protection.gbl (2a01:111:f400:7c0c::114) by BN3PR03CA0107.outlook.office365.com (2603:10b6:400:4::25) 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:42 +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 BY2FFO11FD016.mail.protection.outlook.com (10.1.14.148) 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:41 +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 v888jmox023063; Fri, 8 Sep 2017 01:46:39 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:24 +0530 Message-ID: <1504860327-18451-28-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: 131493340022008071; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(33646002)(6916009)(5003940100001)(110136004)(2950100002)(6666003)(68736007)(8936002)(47776003)(5660300001)(50466002)(54906002)(48376002)(50226002)(305945005)(4326008)(77096006)(53936002)(356003)(81156014)(81166006)(8676002)(104016004)(36756003)(498600001)(85426001)(97736004)(2351001)(86362001)(76176999)(106466001)(8656003)(50986999)(189998001)(105606002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2258; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD016; 1:uFxXrO/7XXTj0oi0O4uV1Vqjx9cE5Zagol7IrapfmIvPBLAcYFIo08W6LNN1Vp6mRAoKwdKzAVPCxseTrX9wWqTsniPz/1LQ9MA/hqTp9LwrjlAYpOi/AIO1ETQtYSD9 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c454eba4-ae52-4295-5dff-08d4f69620bb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN3PR03MB2258; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2258; 3:s/DKRwEiLpfrOkmJdfu7B73/PpCTbW3QMtYZzDcaz2O10Ti2MQvXJx/c0CopCp5utv6Fn2sLhXtWEw2CXywMXZJpcEdzyVeDexPI5BGBJToG5VYnJaUuGLq5k+8lVDQ7F5PwK2DF+JTbgYR+U445HHF8L/14M5+VMqOELSlewl/81L2WHGab/9aPWt1f3cnrqhJwlMy+8f7RwbXMhauTNgmYyL8Q6WBNBz+SW50BiclOW50+drrDwqjr7fyqmDf7YABuQ+N8BEUaa35OVKDd6BcNyb7b6bNeJfRP1pLNgyUd9Os0NFDdrkh2JAdOBrOzFVs0wpgp0uJHHQJFFWgm1MpoSD4g1vgo4bzVhPUC+ss=; 25:igYXD/DnW93PHWlFIhP7EDYq4J3ZfNn2ZS+MB620zTtNHmC52vW59mBqPeO1YzRHIFJk7BQ8tNYVOI2ICvP6zNhOiPDXUXWlW2RRgzpr5VmCaMZqbNydTY055dnCwmCQUlfkXnkWH48CtFSQ0XirHGttBmPeWUlXOUMXKzddp+opM7X4YnoJW2UcIfSzwevhsZ+MGoHajykrqdfd7rXd72BGRyJUClGXWA3k1wDN6V/2FeVoipSfdUfvUe6SEGBAFslKKrkDAUIgv3K0VrpiUIGWOiWqn8ypOuV6j189uCs5BtQUTg7xTIsG59T9Hujvkv/QVidr3v3V2hWSMABs+Q== X-MS-TrafficTypeDiagnostic: BN3PR03MB2258: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2258; 31:EPVjvyBbVk3bDVymQitlxq0z1o9sEo4YyfzpWxI8fiaxLQl+f40Dx1GkOEmFn60B6uzS3F9++IJ72pvhcQ5UUVVSCyjGz6nBWmTP1QL/JHdWhIkHKrPaJs2K9WkQzBnrjpceWgvPmJLxUUIqpW5FEHQKhmGjulfFkwQpLep0YPHbI22BnH4gFL7/5/wuWc9eCZ1A/K6ANAuL0wthVErmlHhttjzqBiGX+HVO9so47Mo=; 4:9rGcFMLPMty4WvAOOWWOOZhDbp4Y1IyJN1o2Kq0O24Pai/8EcqOpgRSjDU8/H8dDzUU4CA2tqPTtON8FRDS5itQ66vsNtTro7eMdNtHw9Mzx4HimzQXx5QD+JhYTv9A0Pg+3o0M7V3aZC7L0h5doYirCKi33GMfvVptvKKr1crIlaPwB8ELRpyZrvv2nKnEqp+ygLpXOr4YJda9dcRN0Jp0J7j+Mtzn9Uz4ZV9fR9D1TKeAzicG90zUp95GZdszwQU91JNaUQf69VE1Io8WXh4YCwbM6Z4SAvyWNLRNUdXs= 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)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123561025)(20161123556025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2258; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2258; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2258; 23:frmmX/i9TP+GPw7LXkfu67+InUJtCeh2l5+Oqin+X?= DjiHaepoetIOWPmLP4TaGlPWAKNynaI1hqMElxSoWS+CabIxHqEGVErS4SeZFBZVHHKIb4KIet2jrovtBV1d7Kxn2pqEYiQ1b/KWS6wCu+uRpNxwhjmKNtB3IAeTaA0yIB72ON8FaOIgGD9+jjCOtvk6g+8cTiH7i/VArcCTRvR5c4IXS3R4EkHQUqjSyscQq0Tg+5SR7CZhubMdH3SJRbujRapqV91fYmqLhf/jsW4XpAUjPIHjC5m7joC44OP3dfGniKfkxdrVFBx/AgcdNZoZcvAkvV0A1rMyqzcHWYmQo5cvbduZ0cXYoPhtpeRK+4hFLRETN0qecV55/vwunOpl5KwjfCODELhnK+O4z9VzOkkBh781bOhvjLJt5X8GszeVmt6eYWg1yPQWXbf/dYwbwukT45jC2bpGnpfDvoIsnXSJKZy5F0eM4Dd+JCIN4WggcuCjxjhZ9wUZYnyKEn+/vJeLieigPdHThN6+mYR6/OQ1fLyOOyKiXYBiafitEm2wUgVsjgLo3+lrUsdN5gaK8AroZhI1atRaQgRxpUFfKWbRSHK5mx4xJ9C3jZfBsaAKaI9WfBgwQsFjSg4BA6ondFq0zr0CgksWx4qY6vjQ6l2z7yxqTxr/FTb/inZgF/fmKkebOGtb20IsxzxssO4EPOw53osgJfAXoQRoT5+DnYUh8FNDB9a9JBFYOTWXOIAnYFxrFtw+8L4NFvC72Po5TsgLWj6AXC1natEakHWbENetW8OZuD5V3M47eCLRNnP4mdKToJtfQXViLBiuEzYd7AEOk7yGRK89TxkxAyCiqyWxNcgrjiACjq6gW5N5yufFNuxkBvhxDXIUYfkUkexUXC6MSDaHd8pxQZ0DO7kQ++5R4GLoEZAuJcN6opfkrjZgB4Nu+7eVDiaOVPyvyYgzWXsbutrqcj7h5fiM2OqUqfz7bCN1jG2knhxjJHeggEBZ00GJ5W/0Yd6BhMDzQsRoBO+/RFi/ntjEjJuW0JMtHOlJrm0jG0sgdfnSxuc6IXnW91/fgb/PXWJG5Wow4b5T4Z6YHOpf6wgA8EMdDGGCKI4cMRiv+0GeoIw5U1GLQw= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2258; 6:ur8JDgYZmoXQhbzl2cKDnusSsO6ghhxQpZ/VQvPzkpgJVRQkGfXiKyVI0uh9qzeM3KwS7zutf5I/hcqSms3zPrJJ3CM0TZ5R4E+y2t26/7/8uN3SWvo/7rl86gYv9KJTTZo1Avd/VHNGZ42BkjgvbScWCTcOUZPAyS3tJAG/s+N8RpI2J703cU5zpKHCdREc/TeZGaKzLPPUybUmczyd1/y3CQ9U3hgex1ZtOSFu5uzAZ0H2WdWPKG/0Nqss4MhKJot1Nym78cBH52/eELoHnt5yRjWS6DWSBbSKO/dNXY+HDIwcgQZmxuFbwnN751rzaKput207R2rA5v9470sr+g==; 5:S1vfHznADt9mosAozWRT9eLfPrOyvdr/y4Eu7cIzd5mQ1XfD8s/pr/mxUG/X2SYlvd4bM/pyRpkrrMp6NyQoeTmdgpCnLQpZti3KqGb3JFHxOcu1sXnAVxEtgmThgwLW8lpTsibMSQ/p+nXhfMpvFA==; 24:i6v+dYu7y8EDyjPnt2b0aFvKw0oWnDpXIzkM2qNPP7nVxTw2qxT7h5VypBFalRTztZ8d6b4S8nspyx7ySd7fqGr3MbroCM5on63io7/HGBA=; 7:UYmzTI6Ehf4woBUjnaZjPsMw0pEluEWY8NUbHmBKucrMjw4WvhLpr4bKrI8NeqUNmehYcwJC58umODID+ahoxR7jGpk8RnXZeZXwDaF40VkWv2ZbTtBrKXhnd2dtP9v2wOOEiwf3J4+ytAayQc1+V4hqTgv3KTkM6tyApCnJsvd3TGILiCemFlHbHrm79L7elXeaS7wSg5VTBuDhocGGv8SldfCZKX4Ep7S6oimaAU0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:41.8264 (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: BN3PR03MB2258 Subject: [dpdk-dev] [PATCH v2 27/30] net/dpaa2: log that VLAN extend offload not supported 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/dpaa2_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index a274e12..589ae6b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -182,6 +182,12 @@ dpaa2_vlan_offload_set(struct rte_eth_dev *dev, int mask) RTE_LOG(ERR, PMD, "Unable to set vlan filter = %d\n", ret); } + + if (mask & ETH_VLAN_EXTEND_MASK) { + if (dev->data->dev_conf.rxmode.hw_vlan_extend) + RTE_LOG(INFO, PMD, + "VLAN extend offload not supported\n"); + } } static int From patchwork Fri Sep 8 08:45:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112050 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1249354ybm; Fri, 8 Sep 2017 01:52:17 -0700 (PDT) X-Google-Smtp-Source: AOwi7QChm7eFp3DamAPEaWhQSsauY1ePctD+xqLeBPoTfbVUsa9Si0LLSkK7bRIQjifIhwaMuC7l X-Received: by 10.28.230.72 with SMTP id d69mr1322662wmh.70.1504860737362; Fri, 08 Sep 2017 01:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860737; cv=none; d=google.com; s=arc-20160816; b=rioqP0udj9ZN4P8vxVy9kB7uyqfVxOgenEQdwGI6c6oAaCsrxF4V8JbPg55evQU0c/ lWxxrZk1MDaHT/OtoCEMcy9bnYTx3+oBwczQ4A2yoI52rAr+0aeTr3/ApfwVaJfv+MIF WYg9g6XyOY0nkquI+t/0PvuA0PzzfUPepmyVkIAHOyLXEE/Qx+wyaUqRLRIrWK765EW3 gVRWlyEhmX7FrbCoAhuTE0md1oWQAx/0UvusvWMX+YQ3+tgXgfhPqDeI3+68f5swRNO+ SWGIJgIZlhjraMfP/FIftAIoD2F5ZA00lu5R6rK4VrqR7WDcJClS2Jj1AicdfXju0r15 jP7w== 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=DdfjkNQpSvAntb5SoVxtX1C0UeQ1e8AuL21MU8cj1VA=; b=Bum2Aqg/V8g3piNSvuQPzQW6J5R8H0F7a2iregjTRiYnzzl8g/QdO1PFkOVkHf6SRZ q8em6SXIl06ju9aXnkJ3MCSWDz0GqgHbCbj6eAQ+Z/OyfdeIECYM7BTFuS3R2GFgSWV+ 5U7qkITovl0F0mW+KsMgraiwLGPBiVLBdSi0Asb8Zv62xTtXvcIJAE0hi11ig+Q+v0U4 mQvY7DNn8VZYR2hiZI02M/RieaSpOyo7ZGuDW08qvZgQMpikMEZyLOE5w7EYaqm/ryar K1x4M/1ryaC/nIZORy1p7iCM6ZTJDDk+efml9qHE835DaYQUbqGP/DAL1xI3KQJTj6p7 eW0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id g74si1110514wmi.79.2017.09.08.01.52.17; Fri, 08 Sep 2017 01:52:17 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 95F81199F4; Fri, 8 Sep 2017 10:46:49 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0061.outbound.protection.outlook.com [104.47.32.61]) by dpdk.org (Postfix) with ESMTP id 39CCF19A0B for ; Fri, 8 Sep 2017 10:46:46 +0200 (CEST) Received: from BN3PR03CA0111.namprd03.prod.outlook.com (10.174.66.29) by CO2PR03MB2264.namprd03.prod.outlook.com (10.166.92.145) 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:44 +0000 Received: from BL2FFO11FD055.protection.gbl (2a01:111:f400:7c09::190) by BN3PR03CA0111.outlook.office365.com (2603:10b6:400:4::29) 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:44 +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 BL2FFO11FD055.mail.protection.outlook.com (10.173.161.183) 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:43 +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 v888jmp0023063; Fri, 8 Sep 2017 01:46:41 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:25 +0530 Message-ID: <1504860327-18451-29-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: 131493340040969427; (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)(189002)(45074003)(199003)(498600001)(47776003)(189998001)(6666003)(68736007)(85426001)(53936002)(54906002)(77096006)(110136004)(36756003)(6916009)(86362001)(4326008)(8936002)(50226002)(2950100002)(81166006)(81156014)(5003940100001)(2906002)(76176999)(50986999)(8656003)(97736004)(104016004)(33646002)(8676002)(5660300001)(305945005)(2351001)(105606002)(50466002)(48376002)(356003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2264; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD055; 1:8IQ3CTkzWlC7K/SDjSpDWskwXD5VHCQ+jDgxuN/5wGn1pSomrQEpqgQGch2eCqHCfuRDUuTWh8PTF7N93i6wJoeZ5MLQW1/ONsUWeh04Ic0asWfF8lFSjm7uh1MNvKLp MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70c4f42e-aa14-4f00-fa19-08d4f69621ea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CO2PR03MB2264; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 3:UOxnVSjhkkpfEoy5qpDKVeCbce7QJg7JbX0RkR7VTSUblJpmYKemNhCTr5gJ8/5XuEaf6NAhmyYnyV7XdBAS3EUjZyOqM941J4i8bouYpD/SG0z9vobcsSDO0PfxLhDBYqGH3jzStjpvCzihFvreDbJjeQj2sGopu4IVnU9Y2bkTrxD7YsF/gW/C5mMXJNlOdtsHR7NTKvMwKuUw5d3YFlriHf5Ae5qYgv6AX3IOWJjgftwJrOgyIpyJ1EGUMaxzyAPiO9ZvfBeZv9c+yYWqL05IRIzYJOQAMP7l1AlctkNC3d0hSrbN0HW+oj2VrRoKv2cce1z4yW9BzveuP49DARGn4XfA3tAr0fhBalm6gcI=; 25:5q7oCCyYOSGrfVrT2X3LLauUt0JGmM2ei8hlD8nrBmzOgq0VI5Fg3AN/Mm5lPndL/o+uv9Rd4SAdRQWRK2iCbrBcFET60WaGmRi74Y13MfHzF6DeqgsAEPJ1a57y3cTd8WLWreym48FWlu7Hj9P/ABMPw12MXcF/xcZItVZQVLYyU5lJ/okka7aKCZmBBdt5VUfz1drDbTnBmRNhILVkx6YqFHhPulHC2Ats8OTMroY1laOT7qjPsqocZw/08j4HlH0pCxdmHVJS691kkqyaLbFrLlV4NUswXlkbQZRq+YwOGjlU+5isZRahEqZ334cywUnXAqeFcvDzK4kCSPL8kA== X-MS-TrafficTypeDiagnostic: CO2PR03MB2264: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 31:q//NPayc7qFY3Ye+KgdlPPATzGwPoFp9kFsTw62A/yKVx5PhwDlGirJfmh7FnY3jK4gejHpDvfT9XMsMj1Hdij+a6CDUBUqn/uLnnwlGxkUI7LrzqotsZpEROXMwYG5s7oIpnCNJtAM0ksSAUhomkiXNGxHm0e7R548zaD7arCfP8+b3/k+s55sb/YhJQ41/5D8tuKK3SYuY58o0w/QCZdNf+F/SE1VLAW1I4Hrk/Vg=; 4:mnZ/Q+gRNerCylM3sA0IgCY/Szs382QlQZt4K+IsyHIQokdOEB16Uylbi6pGjUdo5p+gA+OTEntyKQNvtqc/syd+c1gls0MMFN4uBHD0hwAEUkMPfqROqI4EpDOpISPqnq1A4QO5WlISLQEyXQ4/iqSMLiryiiZV52x2QneGXsL8wrbIF20FyBpAODfYDlpvIEBETih8XDRP+VxvnGlLQhik6it928Z9dm5t3ZMY+ha8WOC42MgVdmNG32Ha5sgx6llBjuU6+yKT7hAUocYe0RNvMGu1W0aC6JWRGbUr2k0= 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)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2264; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2264; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2264; 23:jgiAnYlA+SJ0yQPzwml6G09BtLJ9ezwbaLhtyficH?= aYHtyQOjZiR31cw4QdoHL4S2aloHFL+C6CJ0dwbI4XjQBqU6X+vR34LHKT5wE37k1Y/zi3u8HXhdpJ/uns+/rjmp80oEdRBpeXYjvPSvRvcHzKvKEajDu/Bs4Z03SHJBQ+4HK8twDHSbuGtED8PVnwR3QE/AoOVLOo+QM0KlHnkOzCgY7lymnOjcoh7+sVBSDKEpD9N+ZvBkyfse2qZy3hI8lyng+bmm2Gy7T5qKIb6O9O7EuQfB/qEaRN4ICARnsF0gNTjgh5Df4jVWpMvZ3wrR4TAVlDDXhDsbTpnoVzxcIsMZ796dGaByT10yedvMwTx2TwQnPT3lxeSTTPVQzClDxC2fO6xGWZ8r5Gv3hBAyWnTjL2oUfn/r2i8/3m0MENrcCYAdzLn2OwZF8IGU4Gywc/tOK4NY8Wek20SDkjNKwOOQJTrWmjnhB9JGnfc3bn3vQda+OZZ0nUAvrtSH84xLSVE+j/ZjkcCBk/B0B3boKLvuCWOUWS2TxbttlI0jMXCg0J543h6Lpv+Q9kd4qq5CKHvN/5TvMuL6ClikcgJQzqMbytE8TIwWMm/N0+2cCxlb2En2DuxTvLQU2c4GOnVEAnyap5E23JTSKAvungD3R+0eruqFBvhG/s6fpffUv6/PFzXCuXgeSzbb/K5zLLDAfm7Pihtm9/OiwvHvJ1Rz8Q6ZgJvHWk/DH9gcmsnMOH6t6cZSHyaBBVQPIZAryjlqo14m0Nna67eLljU2fq8icrEi5QMfJb0ovJfVj6bEJaFu1PTko8NrRZh18Z2RU7WJMR7lxQW/GJn2JLVWyMLeYJKhQVm6OdB3YYw4WOt8iMwLmzih3+aP8Mu9b1lrNbiNe3xdD39CXnSN8zeM6ZtDWLSxq1P681cX02xaNudrOjxxRHuXJ/I7sBZwiUW0XWAEuLN8xieFdYKfj1Ho9bqGkULPnaKhO4UJa5TTXaL35Efrk+/aO3YKbjS0LKWMqeo7tZri8Lo8X7P0EC1vMgkXKntkOMmNU/NLOc/ORPzwKIDqeA9OcmS5euht5gEja+bmtaI/li2vPpLCnqlV+q40uiY57lVKYZSlwZO54V/naW45vDAjAsq7O3pGd15TZEx X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 6:IgGQhlgr5shl/3oQrQE1kw3j61snZeP8cvnotGtFNFsPp8v3tIZR3BDDssBu0FGFTPTc5chtwch33H+MnpWoWhjx3k+HeOblE/Bpq/anQlFPFyHcek/T1kxsLk9SklECN1cRvoBVLSHtBJ1Jy7eJSIYbwcA2iy/7i4YJTr3q+jfartcxcAOm2mRGPOHt+Fly6Wh9adFvTBdizA7ihBdTXnmhPqYdqlRVQJ4n25sIV6JFUi5ZEJLdjUemvflFuGo/sFhRvdK78c1hu5+zNVbkEHN85HgjypBelj8Q3yENMCFVbrdRy/mKdYaO1C0gGUbgRoIlgGjbkiC7qcxetodr3w==; 5:nonunu924EyrftngeTcNmUtHYc8/yo/PzzD95xDtMZIc7DlYJvI05lKwYicDK7uh82gml7Ihw7XKsTTqZzyWock0XGbiACDQnBQLh1KMXT7uP11VczfdnvoA+zCLRP1UG3+b2CGSgozlg/VxaUJjFg==; 24:NlhmUZ74FX/BGNv4EyS08cBvcna9rtcbCr3wEnztM/CGR3H27nprfc1GQlrudbUg4DE44iUzo31wH48HiFnfmrhNybWAgC0SWJGpYmfML7A=; 7:SvKk9c5Py1q9shBbdzOFih0MuohMpj7cP/S2+ajBW04dkYBsNcOvsJf8hllaa1WEgE3qS/pT8a1DZjEY+gV+66bxc+oUi160/l880H+o34dJIvuPKorOkpgvvSiJpHYrck/eKs0nJh+k8zjhdl3QPC/WU5uJznNe+V9DwxOm1ddvyfEj6UDfolDyVN5oUn9D6xkIhPrFWgUQdrayS1w7WjHYLFGtP7BjZT5EfG0qlKk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:43.9097 (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: CO2PR03MB2264 Subject: [dpdk-dev] [PATCH v2 28/30] net/dpaa2: checksum support as per user config 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" Instead of enabling the RX checksum by default, make it enable only with user ethernet configuration Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 65 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 30 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 589ae6b..4e833db 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -334,8 +334,10 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) static int dpaa2_eth_dev_configure(struct rte_eth_dev *dev) { - struct rte_eth_dev_data *data = dev->data; - struct rte_eth_conf *eth_conf = &data->dev_conf; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = priv->hw; + struct rte_eth_conf *eth_conf = &dev->data->dev_conf; + int rx_ip_csum_offload = false; int ret; PMD_INIT_FUNC_TRACE(); @@ -364,6 +366,37 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) } } + if (eth_conf->rxmode.hw_ip_checksum) + rx_ip_csum_offload = true; + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_RX_L3_CSUM, rx_ip_csum_offload); + if (ret) { + PMD_INIT_LOG(ERR, "Error to set RX l3 csum:Error = %d\n", ret); + return ret; + } + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_RX_L4_CSUM, rx_ip_csum_offload); + if (ret) { + PMD_INIT_LOG(ERR, "Error to get RX l4 csum:Error = %d\n", ret); + return ret; + } + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_TX_L3_CSUM, true); + if (ret) { + PMD_INIT_LOG(ERR, "Error to set TX l3 csum:Error = %d\n", ret); + return ret; + } + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_TX_L4_CSUM, true); + if (ret) { + PMD_INIT_LOG(ERR, "Error to get TX l4 csum:Error = %d\n", ret); + return ret; + } + /* update the current status */ dpaa2_dev_link_update(dev, 0); @@ -707,34 +740,6 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_RX_L3_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to set RX l3 csum:Error = %d\n", ret); - return ret; - } - - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_RX_L4_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to get RX l4 csum:Error = %d\n", ret); - return ret; - } - - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_TX_L3_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to set TX l3 csum:Error = %d\n", ret); - return ret; - } - - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_TX_L4_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to get TX l4 csum:Error = %d\n", ret); - return ret; - } - /*checksum errors, send them to normal path and set it in annotation */ err_cfg.errors = DPNI_ERROR_L3CE | DPNI_ERROR_L4CE; From patchwork Fri Sep 8 08:45:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112051 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1249582ybm; Fri, 8 Sep 2017 01:52:28 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7T38hYVJ8NQtqYwU0C2W9AjPX8Fh+m7dKb1aLwmivIYBVlJS72NmWVc65vrkx+cx9f9+Rh X-Received: by 10.223.128.202 with SMTP id 68mr1384326wrl.308.1504860748487; Fri, 08 Sep 2017 01:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860748; cv=none; d=google.com; s=arc-20160816; b=e+1F59XASlKoIA+6FQ8Is1qzbWQlXBJC3++VldvH6TXX6BZHam0eMujijQpfQ3Mitl No6DeBvE/oRuU5AXD9SHbaurBLxrehC/kE6KBEXL8H8CdURpWaEZeqb+iX8Vo//Mr/sg RpeLzJobdfOPWdi89cHFg+GsZV2Mdy/g4kFU6nvXossguqUXqvdj+2kLchkqe2trOnwJ /omJJB2+dHAD0k7uIqIlqXQcTgzCwIQbX9MAmdoirdPZPyvKLOk7WTy/0RgokyIxfNB+ 3FDcI3q3am5BzKqXKU0twx9jnX8pLbaUZmP8mslVel2C+Gg+Idm+LO163Zu4TkJlt1gW GdKw== 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=gYqKCPb4kfKw6Bwi4FXrthvdJ+R6iB3i4GKKv14g9sU=; b=A20eBPqpCe14TzErwny96BY82zXVLXITAK2SDFwfhPUHh1xeNv+OZ6+j8bwceaFV6C wVlsxQ+0srgcB/AAvjwEwbJVzAaHS6e3o6nBlsVQd45JZQVFU7dLPk2u2nCaQ0gRumWW T+fvf3xkivAgAUXniMZnMn95utkOXeEo5LOdsJEt/niwyRw4nQqwwMT9bvZXb1X/4IXc oSgGEQ96In2AQHkdJPTy6TClRaRe6UjCmN7Rpm2UlMTah3LlZULAqNekfkrTOv2qmxLO 2alGJRxcBYt2RjGRBkXEZOef9ItMf8IDmFJv0263d1KIxn725NvjUMZ+m1oBBOI2XlrO vCSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id x7si1150163wrb.444.2017.09.08.01.52.28; Fri, 08 Sep 2017 01:52:28 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 A9B2C19A76; Fri, 8 Sep 2017 10:46:50 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0085.outbound.protection.outlook.com [104.47.36.85]) by dpdk.org (Postfix) with ESMTP id BBB34199C0 for ; Fri, 8 Sep 2017 10:46:47 +0200 (CEST) Received: from BN6PR03CA0069.namprd03.prod.outlook.com (10.173.137.31) by DM5PR03MB3322.namprd03.prod.outlook.com (10.174.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:46 +0000 Received: from BL2FFO11OLC016.protection.gbl (2a01:111:f400:7c09::124) by BN6PR03CA0069.outlook.office365.com (2603:10b6:404:4c::31) 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:45 +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 BL2FFO11OLC016.mail.protection.outlook.com (10.173.160.82) 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:45 +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 v888jmp1023063; Fri, 8 Sep 2017 01:46:43 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:26 +0530 Message-ID: <1504860327-18451-30-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: 131493340054375047; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(5660300001)(54906002)(4326008)(110136004)(50226002)(2950100002)(6916009)(104016004)(8656003)(498600001)(81166006)(8936002)(8676002)(5003940100001)(81156014)(77096006)(189998001)(2906002)(6666003)(53936002)(97736004)(68736007)(50466002)(76176999)(105606002)(47776003)(106466001)(50986999)(85426001)(48376002)(33646002)(2351001)(356003)(305945005)(86362001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3322; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC016; 1:FHXMkavKHpJ2IMYZBWz8ikXAuJgzM3Lkn/r985lfKbNCRE1l6LZCePa+Rpns3Jx03/2EWAANhrOyLiHvcC2ZvZd7oATReBQgYyUJx0/h6fYF4j5XBrjGNxp2Q9UI3lwZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30a1cdd1-d3e7-4916-e92b-08d4f69622b9 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:DM5PR03MB3322; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 3:HVbv+xUo70O+oeruYM+F8inZz2NTu/F6Ek8gMsDI5lnrJ/rUX3dc4E9yvvOJYwQ3WeahP323uRmpWcjKaQURtwVrUhwLLiXJteXk40C2WECw8Zlwpn6D02XQTGW2S6MG4MczjxGltsG6tbUNGzRVRQJZB7y2lFERDdIki3UNR4QZiahO+hMyBlRzqK2vr66FDBSAfC8IxBhhiMnKNLJTghq98r55XbW2m1J4yO4fwiEN2zRbQNuOCs4kANAcZpsEFzS+ON2xg6ds5p77NpVxotvSnQGERE33ICEyBeiGuydadp87jwx/AfdVTbH28LxDQv3wR5WJUOhv6wgeFYwMy2BTqs/Mk9sq7YU4mtGN4NA=; 25:BtBuuuM9CWnR5MA3L/n9xup5rf7R1AVKIehmGdSgI5qgjA8Vc4bGDbzseCL+Cuxj7mQ1wSGso55cjgehlQxFj8B+U8z6GerJUnASajPPVsje0dzgNlLiG2jUGYmwhr6FvTXDPnB4cEt3IFNM2BEnkPT/2fRUzwcpb8HmPq0Eb4/IazbnPzs8dDNg9MP4MHpIRAEe1goLSlgE1FlwEDJHaZr+jSMIrEVyMiDOcfPTIkrcFF0cNblS4Z+/9AYEVsnATMUzSgMTMqIoG3yY8VvldH965Bc8c4hFMtcBkuHZjJXZuMq+v/P63v11Lx/iWFn0WOH/zjROayYRRk+fFp32dQ== X-MS-TrafficTypeDiagnostic: DM5PR03MB3322: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 31:t/OYPgEdW/jjQd2X1G2yex1B0mOf2XizYUiJSDcMk0vt0x4qFxVxacg6E7jPt2ezz/eH/G0Vd2x9wIcXonCiDnxbz/UGwJVsmFbdRgRGSXek8LjcAHB5hbAa94VMseolToJiAqZIw6Dj+6AuHGnlS9HKEnOexROqPR0xNrC0qrQ4EjhAO1c49JTSxCDqlyS3DtzsPmAw3YKuQ1jxPOqs4Cl8wye249TQv2mlKHK2hkg=; 4:AAKM89A8dNweEraZ2/ao8vOkZ/RYNv/m3KEDv4CrbwsfTxg88JsI7iU/41gywpTK1idIAOu0ms3XkYzJ6BYv6dkse+ErceTciaiqvIvbUZdR+oudC3FC3MbzSGhnI2cnsOZzdA8hx5BLTeEpcstC2hLcQOD01qWHBpMJow7997ciDwdPIgJWMlg7i7cf3CYxKZhuG6rka8nyOC0zkhyvjQNMODS0JNTd88OWDoJ/1S8h3qXVlz0Ck0TpxaxrtNz0MGIJlSSQWrX6TNggVIzOViM1vGCWrPzF8exRr5GkoqY= 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)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(20161123561025)(20161123559100)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3322; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3322; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3322; 23:5GaxtPINH4UoshReJa7pYCgPz9HlgHJ1UycZYKOLX?= a7NZRzR+RoS1GUHuUUn0lAvGcc5yp+KyszD/XjpXHGtlK9EAfGrljHlMBNl6Z40ZN1j/DtTTCO8nGZt4CjTZNF1OlCmWC6vgQQI82naCWhldxxoAfqrHJ1jaFy1ow97LbNENMUMWaG6WJYeCzPhfgQr4OJ7cN3DTn7aWmHOo6kESc8tq5t99/CPEkzNjRdFlu4INWXEB3vUMY68/hwW4iFejPDNa760zVhEiOKvILoPB0UJ5eXjcBjMMvb+pQ/dHI0VLh/wrcoL0LuikXknO5xzOsiahbUC8dqp6bH4/TNVrlKJFOINeQDYnHhjMg8fMwLKHrYwcttI1QAp7YDeR85GpDUI9wsUKwy9KdNFZLwwgDuGdszRVu39UYsvBB2gEcSV4sbidab70mZWdUwj1lgLwkIHLhDCBmir4BPqx/Ig1yfvVp+m2bRRheLX0eKFFmc6o5T48l8nqwKlMTjU3v3OeBYb96n+WNZGJOGQH9KS2R4wQZrqph8ZmUUYXmDKunFeXgHeTjaThMTRedLfuolIgnCq3FSKM63E29a+1MIHBvALs2CFxJsNaVzy3l5LXVJ0m22iS9VDhzLFuPhYbI06/7ddkn+LC3yiow82cg5mm7r6ZftPjn+EpwZUP7+2gEvTblCvgq3UbkyJ2vQRbFC4vxWgQNKdr29q0PGdgt8rVhrCrMT4jJ51j1pXsNR1bMuuc3+dS2goJP1L844eGXlIAxjjnlzekg5tXc9PRirwj6FNn7JSlcJWMUjbmuss4f0J0Dce9dbk1+1rCeVOPJM9IZ0zlN2kBaGSFy9KTBAAui6QUee0FPUJ9cLcbm5kKY9tcpBYERTpOFdh2n2Ltr/aZqNo0n+/8rZmms84V3AkRPiZOj3noTvlb5MXm/TQQ1jUn3FY3Wv8fcdROOJXb5AFpWMmvnjAC5SNCEb1yC0uIUdjIMLyG9ErrYkYqCtAPjQtVLNitsibbvQ8FQWBuZYviisorMV3vCKY29f47bUbLcVW7p9FyvqMgvUfom6epqrtHjOQLFeG3pAwrHcXhYRB8EfjnK4rCXzlJgpUb7aWQGqdSricIRDILvNuB7gkNhc= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 6:gDm0pAy27R4Sw/XfZg3NPWdya7xMZoFfNZ53Neiqd9BShq8GIRSqrlopS9b3Qpm9ESgW/8DO/YMl/3w88WCnhs3QcOpR9C1D6AtQ5xc1M1nRLLPl5PGsWMX6faR3lwotn8+uMs/yteDWE2Dr+gXNT/nZDEzV15C9ecIkjhls5M8Fd2W6Xp3jXD/qdAuioHmI17GnNX9Y2HwBRv6rHADPjlkF4JhPxj59K+s7i5wDR3u6CvLucje+30oFcIstKJO4robzbnGJ6xsVZmJ3xQANm+1pWHB5VPr39XYS41t7+C/psON55AzQ5QRv10u3t5g4Cs1rbRReY7mZUjbnU75Q3A==; 5:zRt6pubFSKXtwMX5PI5hlEsfKLGBR3PH63AZc5Ew2nHdX5MMyW7AzUV1nghcmIZkTIQgjfat52HQhUc+dcMbU/qeKDGeq4+1xbfqVHMn4Wqm988ZVX8OU4J5w+NnIxuyXPzM8I2jCfnvA+NN4GXzeQ==; 24:4DeRHV08bbGTdiINqH7/j/QI2q4kMK92SLFYHdmG2bjY7CG5za17kqg67kba5FLjT/K8AVe+pKQExC1f3/XCQfJ7+nq7Ut8HkMM7qx1Qgek=; 7:KZfboLQd3ABL4OgIra++9pJQrBcJoW74tj1U8FLhOPkpQ4NTEMkcCLlLTZNvuxeB9aIQutu72LHpffPLKsdrNPoKaTcGm7y+d9j/1bNWpnYK6VD9VLnb2JX2VW6TU/BjjnMHH7zGFwsjPJxAwNZtousB5Ummia95kS9M70VBxaOi9Rwhpsyr/79jdeMPQ7rRZd5c5AhdeW+1mnapRGC/qMrIJMx9vyAycTmPgCAESqo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:45.2659 (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: DM5PR03MB3322 Subject: [dpdk-dev] [PATCH v2 29/30] net/dpaa2: improve debug messaging 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/dpaa2_ethdev.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 4e833db..333e4e6 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -426,8 +426,8 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, PMD_INIT_FUNC_TRACE(); - PMD_INIT_LOG(DEBUG, "dev =%p, queue =%d, pool = %p, conf =%p", - dev, rx_queue_id, mb_pool, rx_conf); + PMD_DRV_LOG(DEBUG, "dev =%p, queue =%d, pool = %p, conf =%p", + dev, rx_queue_id, mb_pool, rx_conf); if (!priv->bp_list || priv->bp_list->mp != mb_pool) { bpid = mempool_to_bpid(mb_pool); @@ -476,8 +476,8 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, taildrop.threshold = CONG_THRESHOLD_RX_Q; taildrop.units = DPNI_CONGESTION_UNIT_BYTES; taildrop.oal = CONG_RX_OAL; - PMD_INIT_LOG(DEBUG, "Enabling Early Drop on queue = %d", - rx_queue_id); + PMD_DRV_LOG(DEBUG, "Enabling Early Drop on queue = %d", + rx_queue_id); ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token, DPNI_CP_QUEUE, DPNI_QUEUE_RX, dpaa2_q->tc_index, flow_id, &taildrop); @@ -983,7 +983,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) PMD_DRV_LOG(ERR, "setting the max frame length failed"); return -1; } - PMD_DRV_LOG(INFO, "MTU is configured %d for the device\n", mtu); + PMD_DRV_LOG(INFO, "MTU is configured %d for the device", mtu); return 0; } @@ -1738,7 +1738,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->nb_tx_queues = attr.num_tx_tcs; PMD_DRV_LOG(DEBUG, "RX-TC= %d, nb_rx_queues= %d, nb_tx_queues=%d", - priv->num_tc, priv->nb_rx_queues, priv->nb_tx_queues); + priv->num_rx_tc, priv->nb_rx_queues, priv->nb_tx_queues); priv->hw = dpni_dev; priv->hw_id = hw_id; @@ -1805,6 +1805,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) eth_dev->tx_pkt_burst = dpaa2_dev_tx; rte_fslmc_vfio_dmamap(); + RTE_LOG(INFO, PMD, "%s: netdev created\n", eth_dev->data->name); return 0; init_err: dpaa2_dev_uninit(eth_dev); @@ -1865,6 +1866,7 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = NULL; eth_dev->tx_pkt_burst = NULL; + RTE_LOG(INFO, PMD, "%s: netdev created\n", eth_dev->data->name); return 0; } From patchwork Fri Sep 8 08:45:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112052 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1249810ybm; Fri, 8 Sep 2017 01:52:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBX2uh4FHRsoR1qzcanBX3YC37zOPG/oICjP1nIju4rsu/7NQmlvwQATeZjnzNuOTFI2+xt X-Received: by 10.28.63.131 with SMTP id m125mr1122079wma.19.1504860762560; Fri, 08 Sep 2017 01:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860762; cv=none; d=google.com; s=arc-20160816; b=xnp9qE1KaW+b27MNHHmh1CGlkIY426T5uETut3z7M8U/zH3K5wBi9rj2407HRJythR ESWzsnNWUfkmkI7+sqr+jhgiOGEfwNPaKJ5+LXgTbGUp7bgBntrJIUniN50Cv6aVhfut QvM9Ib5+mx9l8o998psnw0HMrVvwWc5fxoNPfuRqmwd94YWmY3It+RcYxk10t7G3a3VU 60GTb8O/OekL0VcKUv6zMbQpvlRFW/rMX8392tiDQdr5Jvbqs3QTFJ+IxqdsV9cO0Q/6 cIYr9pBhAzF+Id9fCm6ERjYMML0Dn9ryeVLfOHdeybD59SupXDTfoGFCtYD708Lj3RlN jirw== 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=Pg5sRcw/34wsDmYtgyTEjL8hEMdb4thhhmKk5hTCmek=; b=0bzPDg0Y8sGy1KtAh7649NMepDCj6NBp68if23smp9sSZfdT+VlRydc4hCJVmXr+YM jcNQCWCUm1eMeWCscF8JKPcCjkDN4il3zjEDXpmLWOlYSCyf+2KNOcSngXUuoEOu5cC7 eDyjJ8TKOCG9TxXrCpPtp2yNRbbxLlPwm6nsShgeSYx162ymL74xaGXtJfvnwf7hvoLW boXpvthAoPmkUAj6vJrWsT2lbz6k4gjW25OrPo28gC4E4vkZdd19n7dQPXFsTeL1EmTD vXlzAzckX1gaogJl5sbg95AFyuULoExjXPW5ZLJSNbNuwf3OBfu3wWDMU/GZDQK27fol bNoA== 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 v24si1080677wra.381.2017.09.08.01.52.42; Fri, 08 Sep 2017 01:52:42 -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 A2A7819A7B; Fri, 8 Sep 2017 10:46:52 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0079.outbound.protection.outlook.com [104.47.38.79]) by dpdk.org (Postfix) with ESMTP id 9D82B19A1E for ; Fri, 8 Sep 2017 10:46:49 +0200 (CEST) Received: from CY4PR03CA0074.namprd03.prod.outlook.com (2603:10b6:910:4d::15) by SN2PR03MB2269.namprd03.prod.outlook.com (2603:10b6:804:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Fri, 8 Sep 2017 08:46:48 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::136) by CY4PR03CA0074.outlook.office365.com (2603:10b6:910:4d::15) 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:47 +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 BL2FFO11FD033.mail.protection.outlook.com (10.173.161.129) 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:47 +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 v888jmp2023063; Fri, 8 Sep 2017 01:46:45 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:27 +0530 Message-ID: <1504860327-18451-31-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: 131493340071869308; (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)(86362001)(47776003)(5003940100001)(48376002)(50466002)(76176999)(5660300001)(36756003)(106466001)(50986999)(2351001)(33646002)(189998001)(6666003)(2950100002)(68736007)(81166006)(81156014)(105606002)(54906002)(8676002)(8936002)(50226002)(77096006)(4326008)(85426001)(356003)(2906002)(110136004)(305945005)(8656003)(498600001)(104016004)(53936002)(97736004)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2269; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:ijHrtEQAC8OJyv+E6QIUTaiv6kFGhpXTyAdau/Dd3wuc2yvFtKMfeJtC9Wg5wNDZ1N4esV4FvdrI8N8ufGw2UKZWpPPko7mU+i6Qb1bmU4HeQ4U1X7n882A8KAWUc0pY MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c308273b-0412-4bec-3b7c-08d4f69623c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR03MB2269; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 3:zKCeE9b208eGSkBUWOlJuzdIB2CRqdhHRX29MFNSBch1//hPvuhTsVUd9D8VTiSnFUhsWc0wSm44hgFD19j1lVWu8As43gOv8skSro5XwJVSqUTmBNEsDmLBn/ZMccYuQZcajSPTW2mGA8ZJLZ/MG8a1Rucw4KN/BfoNvOusWzgMxTNVbJgNyWIQuHre97q3x/Sv/b9IniYM5kgckJQ60et8A20sXmDBqiiSp+1Ru6EyeVjWi7eYK8DtQOGtElT/6Z1cEYAB9VxQr23lSCuZmDmVmkTBvitgfqn6qSbtDM9BoF8axnsnCbjCvYFaXjdjsa4xDPhCO6HGhvi79mWNVEHFfQNMbD7eY0wg76w8Je8=; 25:JOGV98rmjts1GS/sl08mWYP2eWjPFLn4xzhcRHJgyjLTZ93cL6Hyyir2iRVRw7nGTcyfsRzQpgy7vm2OLpylA9vtFeXV5EHMaW1ViKb8p6IEmZYtoA9v+4cgPGuWa3QFbE69vZLbCWDA3CKPV3sz0GYsLR+Ye9Vujxzvx9WPzGMIBwm3kG/sr5gQaP4QXUm5DyOvpoBz/K4Tpy9tNunLLvV+Mn1eF6xw4ZAACBIw6iCAXL/KTNJC03rLSajxSqt9l5yiRWMZ8tfG+UPimcI/teJiqjGHhZTDEhOfyLxrNuouxuhFEDAcKlPPONTM5FVVb3NykbPVs5rh4mEpE2bbaA== X-MS-TrafficTypeDiagnostic: SN2PR03MB2269: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 31:YwZqssBWekL1pbJKM4YH0WOHnLdb+q2bpFG/vizVJ2kDhWwXb9TQlviimIf+MCwyCa1uYKo/0Fow/JRHHn1eVqkPS/kzRpFBsRsals0TaLYOGV7/7f5v+JHv2gVBHjeNESMM+38Oo+hlASzWNfN2Owemp0jQ9iylTfosjDGQwT2BurVtCzJAwYjA0NKOcR8JDbRcoVZHYBzZlPvcFLFlHD9qRJ8TRBy7tvNEF9wt54I=; 4:MAUswm/CpW2eU1Lv+2Gaejjl3V2ltQJA4U4QAl66j6BJi6I8txmQvdAaH8xebNQMt/GvGmAjqsfwqhjpFaOIImoHoTCwvDRjztzzr1cNpFD/E9kI3TOWq8aFiQrFHQQVcFT1Zxu18yjtVK3L7RmWLjd9nA3yr+SekNVqRUUKH2P0PCdcjglKNBubySPK+yJb7JP8sMQqxgijWcPp6RUdNgKUioFBPiZ/NFU3CVOOLHMKbiOl0Eb4C6wiEkn6BhyiV9FPThphUnm1LaRt8HYn38Qff36dGNV115DybkxiN6G+juoMZWQftNZpfvdUk+aeBTeczk0C3Ehxc+ChmWuwRQ== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); 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)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123563025)(20161123556025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2269; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2269; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2269; 23:XcR7MB5wS9XfgBzPftR9ZYsHFrrET5WK2Y99MtxUv?= euO2pDd1eV3QhEuMu0aGeQVLe7n9EF5MusV+XH57xHBznjrD0/Z4VwQmYUR/RmydNWe8vqNvkcaDuJfUk+d5KF/4RzrktSw51bkT04vUgOwb8RDoKKMrW3KaQLkAttdcirJX2dQeFhhiv8yBaSsB6Zo9aQ+GoVvkN0IP4IKC6otIWId+hId300LDqLSh0B4sT+8A7w5iQaO4zWJ1lvD4KyInTisBbAKd9EqOgy8V1a7Bf1QI01v/DeF32SKB9Aga+Hna7neJDxP658S4dnnC2xJOG+7Lp9G8oMvo7sQ+POuRV33MmyEvYnqcwlEh+f/IAGJXwbKgM9lqnKDauF6DzCugcTYlWt+PwMLpxSYcFJphYQJElTBoOiGcLEqk6BN9qZZKa4ePBq06wz9R+4CUcmZq1iY/0ABomjsvVrip7lZeyoKVzlxX44wJkAbdkxIWa5un59UQFLPWdwZe5shMuU9dOqjGp0OiXSN8zWPEjH4Nu2pvF2gGLABKzPiyT10ZMk+Ep52BS61QzP+Ys/v2YwoakDhmYLaj8TJe5Lf3DF3POWQmQHS9Iofl73geihb5mcLOKvq/X/3kYZBFls7dwuV4zmfFMb2u+5bcaAA2HAL9Rh9LCEjHyDmaO0MwZwRGo4jzVp0Os9Pma+qeTKU+OyCnsd5mSbkV2bqI8ZX37HbcDhD84ZhPaHoda9mzEUqcEVvjUsPzjWZFDNwP6SaUasSFJ27mM7x128S/pO1ZSUxWCgp+DAJ8Gphu9sxtW2wjfio26OtpgqswQpWAnBmJzb1UHM9aZrz4sdGaFrUgifpkloAPyR40CXKiYJOmMeLNsiwAq7UCHq/TW6o/Pg2wIo0LEc59/tM43g6ufRMuEWQoN1SMurDxaxWuKp0PlEtGsdSz+u9w5BdPttoCzyst/lOQFDUcWAxgGSnyKJS8BnCbJWfbM2gSOGMFMAzgkNzFNSlHIYKoACBO9VH+CmAgk50FfnfH7aJOA7KK3VuMZvc/vucf5OA+QCTNPWCtYMMgVhr+5xmwkZKl7f0zJ1aadNWr9ZhoRx1/CzMdHx0xo12MLMTo2JtloMdtJue760myc8= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 6:NUc9XohidbQBqeVp8UFlfAjzfn4EPy7YJsW5TPtgKVL7/fD41Yg1rL14PpHw//36yhT+ZefgnPkUsfAxLtBpju37v1+nnmZfS2rfSAT4LQVfve0TXBbl00wneRqmtsLig29XS8E9P6M0PY9NSahYn5er2UKQQPVqxnF7t+z37W66Bv7dkppgdCcR02vsl/7uvsZq2Qj/VF6XAFfD99EB8gE6eZ3foruzGNVetJHKoGgIO5bZ99LeuRz3dpOcNaDPel23zLf9ZFURw6fiUCxrRQUHm/f98qWl+9qP7z3QG/vqdyglhJOIwQHRB5UrI5sHlkxoJsCkYB5LRlA+aAch7A==; 5:iMtH0F+TCa8u0VZBfO9G1E+3KihGJ5DB4/oqfsBoUoXy3WF6FkSqqKDaVsAZ9fLPwpkbw7D7PHvum08cjVICznJjjX94t6+0GO3UbB5hBLHmvoXOEbj8YmdAKaKi/0EoCJfO4t+NKUgAf6i3pBac5A==; 24:G5S3Po//TUZFPWGUKUIKM1RIAMLuTbsX1+VRQSIwyPNMjRN9wnY3kQoGeYaTOuc+RCwnXLXKTghc5dm9ou5SLgH8CO4afuCeZxf/DuKrkeU=; 7:64RM2XlP+upcuz9Hvytt5oeshXUV951jx6nX2U08gk9xmqv46vRCDS4w/V35fyG1QVHcJ7BZ2XeCV4KFOkL50y1vbg3+LOdpqZwb6L9ma6vHKWQLHyP2mHRMSrEQ9roRaQ7euKdflELQMZ7o51i8xjuq2LIjNUrGdxQp+lcIV3TGqwi5NGvGKwyNHvns3EbWgum8AZNBz3GQ6ZESoYi346YvdY0y+6hG1cYbWHuNcnY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:47.0309 (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: SN2PR03MB2269 Subject: [dpdk-dev] [PATCH v2 30/30] bus/dpaa2: improve debug log messages 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" enable the printing of objects during debuging. use RTE_LOG to avoid function name printing for object name. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index 7e96115..334e1f5 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -98,7 +98,7 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused, TAILQ_INSERT_TAIL(&dpbp_dev_list, dpbp_node, next); - PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpbp.%d]", dpbp_id); + RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id); return 0; } diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c index b60a745..ae189c7 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c @@ -140,7 +140,7 @@ rte_dpaa2_create_dpci_device(int vdev_fd __rte_unused, TAILQ_INSERT_TAIL(&dpci_dev_list, dpci_node, next); - PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpci.%d]", dpci_id); + RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpci.%d]\n", dpci_id); return 0; } diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index ff41ce4..f00070f 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -210,7 +210,7 @@ configure_dpio_qbman_swp(struct dpaa2_dpio_dev *dpio_dev) return -1; } - PMD_DRV_LOG(DEBUG, "\t Allocated DPIO Portal[%p]", dpio_dev->dpio); + PMD_DRV_LOG(DEBUG, "Allocated DPIO Portal[%p]", dpio_dev->dpio); dpio_dev->dpio->regs = dpio_dev->mc_portal; if (dpio_open(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->hw_id, &dpio_dev->token)) { @@ -242,8 +242,6 @@ configure_dpio_qbman_swp(struct dpaa2_dpio_dev *dpio_dev) return -1; } - PMD_INIT_LOG(DEBUG, "Qbman Portal ID %d", attr.qbman_portal_id); - /* Configure & setup SW portal */ p_des.block = NULL; p_des.idx = attr.qbman_portal_id; @@ -502,7 +500,7 @@ dpaa2_create_dpio_device(int vdev_fd, } TAILQ_INSERT_TAIL(&dpio_dev_list, dpio_dev, next); - PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpio.%d]", object_id); + RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpio.%d]\n", object_id); return 0; }