From patchwork Fri Aug 25 10:49: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: 110983 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp808561qge; Fri, 25 Aug 2017 03:50:14 -0700 (PDT) X-Received: by 10.223.130.49 with SMTP id 46mr6994511wrb.109.1503658214486; Fri, 25 Aug 2017 03:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658214; cv=none; d=google.com; s=arc-20160816; b=ILgvTGGObWZDoRf2HblqH4bpCeJVSDPI5cf0ID5mpqTzSxS7seHGmtdIA8gG35mfcR qVl3CUnO/8AV/0Dn799TipOqjWQwJFoURxFvCHiMgOCELNY8mqrkwmDprOJxrxMXOqCf QPLQ3RcooM71y4EHjpHrHP3FfPIHiJiZn72jQtsla9quUAvDq2LY4bnQlcquXCYof7Yp ubI+QZc9s1zefguuLrklMVLtbWLD0bCQR6f/NDbFsFz8rmJrWPAy4Xxo9dRDvE08XBit O1uOpOtKWLqzX7o2SeIQACv5MiAooZDoMrjZKHcGiLeqT5OO/Il1Hmx40KQN/+GAEE9N 29Lw== 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=dWXW9QIqhpYPa3Q7WiIGL/Jki2E5nppzCOjwre+jAwAA+mYT2JNCgSSrxEChCMd6Mg hoq18a873nCNvX30SnrH3DIXq1aMRqliIRPiuYlTi9oPPeeexl1HcspaVRfM0Wk2vTLa Yl+bdaEDyv4iSh2fkn/DwBNG5mxbVHvHA2asf9EmzxfpyuRdKIFjJ4Ar/3iRHz8L6r8+ 1cFAIB/BB9oSc7UlrLfJVvyLrZxA+4k9Pa7alMZ7dpGYv/dD5mKJ2z8yhRG82c6nekPb 0EHKemFbZhW6wbblATEDi89IRQ3sPyGWdtmZlTrNbIj2FdgbHHQGecsO3lrsOAnWoa3c gMZA== 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 o81si1003391wmb.201.2017.08.25.03.50.14; Fri, 25 Aug 2017 03:50:14 -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 095BA7D96; Fri, 25 Aug 2017 12:50:09 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0066.outbound.protection.outlook.com [104.47.36.66]) by dpdk.org (Postfix) with ESMTP id 9DB847D82 for ; Fri, 25 Aug 2017 12:50:05 +0200 (CEST) Received: from DM5PR03CA0059.namprd03.prod.outlook.com (10.174.189.176) by BY2PR03MB554.namprd03.prod.outlook.com (10.141.141.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:03 +0000 Received: from BN1BFFO11FD040.protection.gbl (2a01:111:f400:7c10::1:135) by DM5PR03CA0059.outlook.office365.com (2603:10b6:4:3b::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BN1BFFO11FD040.mail.protection.outlook.com (10.58.144.103) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:03 +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 v7PAnw65032070; Fri, 25 Aug 2017 03:50:01 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:17 +0530 Message-ID: <1503658183-4078-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318033632530; (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)(50226002)(54906002)(81156014)(81166006)(8676002)(77096006)(47776003)(6666003)(48376002)(6916009)(50466002)(85426001)(2906002)(2950100002)(5660300001)(8656003)(97736004)(104016004)(8936002)(86362001)(36756003)(68736007)(498600001)(626005)(53936002)(4326008)(33646002)(189998001)(356003)(5003940100001)(50986999)(305945005)(106466001)(76176999)(2351001)(110136004)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB554; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD040; 1:MsRl1LIvlYzKUHZ92DwxvbVEjoDALGAXKd5xuvoLlNiWAXqfpcVrr7bhl1hAB10P12NZd9f4FDg4AgE1kkPoDM3B+gPhcy4BXsU97WkcadmTRTDR7hHv/eOOgFecHvp5 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca295ee6-a832-4563-4bb5-08d4eba70a73 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:BY2PR03MB554; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB554; 3:hAu3Z084NspSD1RINX2JD3fGXP8NJE6qTd2xWS9ZmXqvQZqHJ3Rg94HLMVN175F5QDRN0SYE7Rvw258M1SISv+01qppgLC5J+JhMrI5CWLaTs3UqJ0P0S6LnXWgmV2+uIzbaCpDIe50YjGSaFKr37o6EKF/379P4IB9EYTKsPZQyx0/0PWxA/ofH5B0ndEhVojNp6JRtMRwygtJK5LV3RQqxoFT0zVi24mBmdncDQE2TGxIuW8mgJNu+AbdWNwR+eZzlgwLUbuOHO+dOITswhY0SwyKnWQBDI6ktTGzoFp7r2FjZWnt7IG94yqFwtk2oKUuAGmWmNKsi1JiWvZ+MSsNk9qkUX4HUiut0fZicnYY=; 25:9sHaXSTmTT2wMnKHw+/F2seCSYVuADpkq/UJ0doddVzcKWCWA1BRWhgmpEYEYRN/Cd7xw2LvkOOxfmYTSjd5FX7948uVV0O8LMyzv7VXfvwZSMjhsEUkvkGr2dC6qjix5P7uAyWFYok8NPnktXby2rsA3PNHK3veShq8yJPy9Zest6uKr+XSRvF0d8qndr1VSJV0+kavQ6o+nFH1ZggaDmNZ3ZGeamXqk0l2XLxmvYVsxnGU51IGFZhHowX4OBG7JFNPJd50NC+MCIlByyuIbfKP0dN048e22ddB5nS339CC/dsC6cEbPhafQi3YE3wiitFPTlD+0YXZCT5+5wweyw== X-MS-TrafficTypeDiagnostic: BY2PR03MB554: X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB554; 31:fqEdJHt7DwCM8taZSKh6NF3AKQ9bGRyMczMQHPgpogMn/q0Pm9wmKLWb7uNwPWuFWIITTIP3IcQ1BamobAeNWK0VPFcWJmXLmX1WBogQUedGd07lnZo58uRXGfLlHhL/RmWC+Q3zTtfOGT2WuZ4RDattQeNsUb7wTfu9JpsdBIJJrRr/YMwI98lJFC4kLmRrjM0mhOem9lk2JmPJspM5R/6eGaY7Cw6JQ55Gvex4McM=; 4:L8cOVzDmRreOcR817EEEF/cDUnOL9OjR9tuOujVlcOYmhH0ez0SeUnMvDtcX/fFllxUs7rquEOeNjngh8E3O+Z4mp7oFd8Cmfh5Mee7PdmdmrNz8aZ8KevIEnnPWS5uYrKhumYfvA4cXq00EAuCGnYICj0q9Zs75faKhmKd5meF2faaDW/QvGoNt6hYEiQ2mnVjtNi323NSQhFRUyon+Ha8YYsRRTOra2DQs4EsrFcKN+XwAsqTaJwy2aDCT+9PlbFLEjES3GSebnqGSUrz1CTjkZSEXiZNJ1TfyD88tuxPwWjQgzl+7NjDqx4gYGyZNrrXOQ0igYWqG57yNcJlxow== 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)(601004)(2401047)(8121501046)(13018025)(13016025)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559100)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR03MB554; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR03MB554; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB554; 23:zV33QeGYLRoQ1BqRKLks/pnzgGKgbuTdte59suY3bG?= k+izJUZgz3YYaG4F35kiFp4p22/6cNjPPURO7zzMydjaRKkV2mWtZuTGqYaBv9KwFDrx4TYro/v1VEMi5R9Nl15+pfWYR81G7p26k5IOv5zCbN6ds2QSe0CMWMZswoOY2bF8drenaiolz4fwTikKNGpooL4bS9jk9BCuImNRW4Ffn2JJnpHcAVi9BhHztrywe5UEZZN5Z3uLhm+xU7Znorf6ttxDFDVuZshZareXbyML8zeeTEPfmODLHEJA+tOay2y+U3d9sbXf80YjBxZC+mI7/alGbyHvonZify5Yky7xTEO8zdbgHjRBJloK1nA+inuF7ll4avedFrOW36qrItkdJnL70rz0gBzgldhiWnBplnCDxjfvQuNRFARjiNaQuGa3Aytxtb+9XyMIsO57rFWwjEnAGZlRZxczOJB+q6+x0ZTjaJ835bl9gUA8Wko0P9yNWQFQjIhToR3JiNvS06m5TFxeDHijqZq8Ps6FTEIXrrjCTrOuFWIGyOF+rgoMDhvrVpNi4feUne7XX3fN2O2pb+bM6YZJWbXmCBshbTkUQ62eKUfpPgGKY23YPO/erB0HdnMkbstkXZ0j08USxgXJxQPhvjN1PnBIuudrpf9IszbtmduGez+wAFKIN1uOoJh4LC4wLPeVu7EOIxiWLS97RikaMMO7t2cuJtAmKzjcMNi6gyq/ByUM6bW+F0d4yx7WHUvnj2PPJHsFWhP5SNopbyhHjpLswQr6sGxKv0hlu0QS3KPaefERCqShTlBfy0GZgYV1XrpN0cwQ2GntQXciEhMjAG7TkUeUCH64oaxQyC3QMhgl97SsaDQuLGeUkNkdBA/JJXrP+JXspkHioEStqZNDaKgLdwLA0stB1sIc+/JW6xGyaG+MG9g7KQUGNCj91W7bfIpNSQrrfYmsEOmFgDwbAXYOeuejvPj7vkax+F2na70Qffsd/JAnvRabcWsLRzxa+tydEl+H9Vm9I/ykZloVS5RV+4UhMpGkkA75Bo5CNO+q3+XeFTbBR4SXMy+i2RdnX6EVybpdkSKRhSQcpjykdln7mlhyiHmZXFuSI0KGpfKDxZO+2V5XVE2cVRJ4NkT/C0CjhXRXpVYKYN X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB554; 6:qytb/615ceAgBVLkzX6BFr/mDA7h2N0NkozXhKpjf1BiS39UZG3IVLNCVkPBpUW1rKnvvlQzNlrvdTaeK3L6u3yZSjneM4iwxOznK40ZbRfmvvdnWtTs7uPIepfkhaqUeE9qbU+1Uprv7Q1ONrxdQewSMGo1gbeNkhOVy2TG/1Dt2qq1SRKnrQ1qXp7WkPzTHOEqKuP2bcophatBpkoeoDceTxZ6iwws4jxzoypetkjdZkNnXgtx2o4jKMBt8JBRKbReVY8aYDLatQ9ifZc1990RcXBUpcRGM1sWETA7mu8dQ7+a3EaVlLGiCBR5w2aM/0dEw6XWAbQ1lOSpU0E7PA==; 5:HlBshCJ1Hyp9gUJt27MunpuMS36OtlC4hpg6IX8USKgdf4KRUCMAtqLqPuHIbBGpe7Ps+PshnePlDU0i60SEcivSraaaJBjX415yoZgxvdtWELDbY4ardd41VT+lefRVBjdKoUI4jka8gnCMuBEGNg==; 24:fYQv4aO43LlJngbCqilhR1F7tKATdgT6Iexoigpu5pIU1XhWJLVOhzSzn1ubpNzvpuRLABvtamdSd7rA3JBv5kuCyI5+cE+aIBHpOaloyGo=; 7:AkvOsiqCFZrPgHObMXbfEvOHjtJ6E00edP7FY4b57JJrrDwYaNzeY0QQREK8c6hiZRbrjq2V2Sr8tpezvmqhX5z5vups8ujD6Hkwn6hF0Mfc0X4OtvYwRpNmb7EtKMSPL/2lFLiXfw+yhat7ofgiowy9Br8qPRXX+VOAKckk+/YVaxaDFucm63rzbTaQsSufILYG3E5Ay0ATMm1dh7rUMOQzillywKcj3cSS3Y41WkQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:03.1448 (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: BY2PR03MB554 Subject: [dpdk-dev] [PATCH 01/27] 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 Aug 25 10:49: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: 110984 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp808727qge; Fri, 25 Aug 2017 03:50:24 -0700 (PDT) X-Received: by 10.28.96.66 with SMTP id u63mr1146813wmb.150.1503658223979; Fri, 25 Aug 2017 03:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658223; cv=none; d=google.com; s=arc-20160816; b=kzoMn40/iLV0NIPBZ8TBu2zMwIRR0j8G0kE/bMMoI7+8d4NTmIlCWfg5w4M4VXxwU2 NWxd+6wUEtDSpRJFIPgfCD1nfGLknOSzeThGi8HMEw8e4QN8fsUGKETC9xZR3lLAkdzD PDIy745qLAtDFXxwM/Q4KOtEAYz0jsQX+O38aSyGGNECl3NqsbY4Ynz4yrPIQo+xLiPF 4zAIng6HqoeLII4nsuzTocjZr2UrNijk/NXCg/z9lwAqL/pQZneR28ggPKSpVtO/FA1Q rDwVy6MCArk8rdZkd/0EUmLacTA+LVM2Z7u50js93ocR3liSDzMaYWhMNGXh+qPYuMrg gR7g== 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=gUlj/1xfOKQ6UimsnIzpJ8wmOY0oYB88WpO2NxzKHuO8uxr+ZohgLMe6+dJCQ5wW5t YrloY6AaamL4HAq/lutUKI3yf8gWOSl8N/tKhCrUhI9TYugn1C2uGaI7nAE3pPNQjamz mGfIWer1xE91fm1XLr857ErRPXtxOvJikPtflyrhOC9qam6pv80NwAaal5JkdeJqb8ZX 8YB0ERgrRxmhwwwhBCzT5lYvItxIiGSDj0J/tI71peM60wA3jdsjFoylsVo3CMFnKJJs oggi+0O5ZBnTdPZjrUovoPFS4SjPQDz3yd3pSyvX5zkpWZWZzyRRUMn7z3ojBK/8VgZU DEWg== 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 q25si3343576wra.229.2017.08.25.03.50.23; Fri, 25 Aug 2017 03:50: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 859688CF2; Fri, 25 Aug 2017 12:50:10 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0082.outbound.protection.outlook.com [104.47.41.82]) by dpdk.org (Postfix) with ESMTP id 54A3D7D96 for ; Fri, 25 Aug 2017 12:50:07 +0200 (CEST) Received: from DM5PR03CA0048.namprd03.prod.outlook.com (10.174.189.165) by BLUPR03MB552.namprd03.prod.outlook.com (10.141.77.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:05 +0000 Received: from BY2FFO11OLC001.protection.gbl (2a01:111:f400:7c0c::106) by DM5PR03CA0048.outlook.office365.com (2603:10b6:4:3b::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:05 +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 BY2FFO11OLC001.mail.protection.outlook.com (10.1.15.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:05 +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 v7PAnw66032070; Fri, 25 Aug 2017 03:50:03 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:18 +0530 Message-ID: <1503658183-4078-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318052479084; (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)(6916009)(36756003)(104016004)(2950100002)(8676002)(81156014)(6666003)(626005)(81166006)(86362001)(97736004)(356003)(50226002)(2906002)(85426001)(68736007)(8936002)(498600001)(189998001)(305945005)(48376002)(4326008)(76176999)(2351001)(8656003)(5003940100001)(54906002)(110136004)(50466002)(47776003)(50986999)(53936002)(106466001)(105606002)(77096006)(33646002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB552; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC001; 1:PEXv+8z8zPGzNlUeXWe/35sUOQ2tjk2dQXgL9P8JApAHHN89vrzGoZiTvkmRkrRHDOUrMrmhAdn+14dG8CmHtEIEC7ZJNH9yKNLa+nQ5r72hOEaHRUBD3YqfSwthkIkv MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da31cc62-8dcc-4d5d-406c-08d4eba70b95 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:BLUPR03MB552; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB552; 3:5RkD/LxaxxB8Yr5B+WQ7NC4F+XsVt4sR+e8/3ORHXEeMlG7VJVJ0mBDxodq2AbdyA9sBJy8mUTEUVtHWaEa6zqIThRyFL8fdmlpN7BCMZjFk0lXO1Uaka2Q8xO4p9XyCsH0C2lJ8GEY5fACPH7+nyEhXlb8EMFhQ3p9xfmP2KcNKY7VOi9YGoNtVruVxVzKyujLY0rug/b8Tt29pgYoJtE2RQ2aPT/UuO+pq5OCapcI6JlyCd92lEMXBGV3j6FIU4LnGukdeLBaIGHPZwcH4N0ww4ObcHZfletXqD7X0Eb/O4FZbyl/nLdWl4yEX0WTSXzaEIFvF1NlbTjhjDWl8Txhx9OEAxz9elXFm8+iLsog=; 25:p5ZBGxEZeh4hjwDMPncrAAAphcXqZp6ujlhPOnZ44ifPFaS8QT2kvsvpK8C5UPcwpLVI2sSc3BC5ENqXg0DXNJ5H3uAzzg7/Fw/oIBSCEjfjvtOXULa6k2461JPgrteWhb6iHEVAGkFzR/ewYbEbZn+yqLQ9uNZneem7BLlyG6NwvvUrjABa2wPLt1DTHq3s22RnNTCuhg5npXTzjDUBNNxYQMoKO2BgP439ie1XuJ4My+5sNXR5wg+F49COzcQLcSWvTHUGPJm7JaH1iFSlKMguy5QC6kEZtK7q8vzJR9JWbxKqYMmUgoo2frK0OgIG7J7I3g6l2Pa1h2HDaHqu7w== X-MS-TrafficTypeDiagnostic: BLUPR03MB552: X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB552; 31:5JgmteJ61Zq2xLn6KhDWSahMYWgq75GTbhqutUx+Raxw3MK+Gmnm1m1/ZHkRj7PhLz9Ju/XtozMLNYI2RDT8dloyNS8T0lBzjUaRBEP8tyA9L1zZSIYInXbozHZTdN6trehvDmGAYIIXuftj4LTm+qs+E34ow0+N+VqIoj0Y9AlJeyBtmfsXeh4rK+LkS6gd5+MD/lvDEWwHfkU+YIUR6TSGtzegBauptM2E+XJq9DY=; 4:yaevnucVLDa4KlTqRent6zUMFGF+pFUOCDd43LORV31c2HeCSc3QpZ4r+HmbLc3gWGRSd59RO6pO9Zng7QA5a0zwEdOfkLg0PZARZHkMNpReFRfBdPnUdLyIZVFQG+C4W2qewWjtRAsj4PCZdPjuJlhAR1jVtmulJtBp5GVKZ5sRVCnS2vfALxYUduGLowW6UR/qsFoaDtwxEcQ5aBLNGZvRBHbkWKMDCzDyeGOiDowL3B/Do7Cr2aq7hs+APb0nLmDDWn96H3Nl+gzTMFruloMOu4w2j0CWpV6SHYCvYx4neEFXldZw5BpFvgPwz7V1X1GFcWHUpRZUUYQJnB/orw== 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)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR03MB552; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR03MB552; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB552; 23:/FDNceK8knEFCj4C8meSY3C2MU666Vh+PGrlBpeRG0?= AS91l8gp/lNJNNvfMxFmKAxADJBxC6Pq9jr4y9IsxtxW+Um7Au72BOSYAncT3eB7+ZqE42HomzLrHs7dkGbJK4HCSdDOXYohJ+tETLxLz5kvJOadiTwFLDXeYuha8iTcd97inz3CjcdMorw/K7/WObyCaXUcRD37dvub6Ht4QCXLkwukPOx2UHGy5P87ps9cjFqRgcmJj9pCvr+8b+m+wk4mLUkMx1s/HwL6OVA63xkDmOlz2B7NJnnixAV1E07Ii19ree8t5g7qfz2zQrCIrT3j8zLR/PlBoPCtysRTmKGutBsmAKAY87dmSW4WCuSnAlOGpuTmfKD5rtHzGeLLFX/GqXH8C1fYX8IcE5qVDSKYLu2fi0LhkX1Pb0AxXhVfDa1alkSVzPDec7a7+zEsxlfAnqdKs9a2Cofu4ImmWw4BJ0o2QgPZcKry9T9JUw9z0xjT3IHjIe4gUp3ZpmXCktT15cKqCGknoo4QM15t5CtdV+4HzSQ8V51yc1bMt69+8J4mBjEfHyzXx9R51+BwUU1gOLpSDTiaXSJOJ6WEn6tGiw4RVjOSQPhJ7z99q6xpSjs/lT+BMq4N1esidDv5sbObfpJjAmrtlPt2CUvD6IYUcTHOx2F3aqPfEmAxYOvWVY8G+k3UogWCc0SDx8JeamXL2BQBKBGMZ/wcT9KpT/89X5r/dDiRuaw6wKgbs1V1jti0G8qru76bf/oOMdIpW9Vk+Gg3nQ9REKX8r7NyBFjzAorFn6cl+7AWsMPxzDiwWHZui0cw49LgeIgHfupF7Y7OnA0hRq0FHsdLDYb58pJf2HKhaTJ7wPFodCo43OX4YhMGTUOwGeDKCRtWoblZRjmGcKbeXSCgij6npq6aWDD+/Wziz17AfIQ8NJBZt5waVbEJy8JrwA55oPx1UdQXCwOk7GoEROFTeutZYK87o6nd6S7BntAi3Sh1jKVv76WyI4fgabkrJxcYLnz0JaRbByW4gWTeZusM54CwAVi9Wqq965bgSBBj2tiTVTH9NE6reM/ISKLT8BiCTxp6FOt3uU/4N+2kIqSsK/2hAozz+Rv9K+sVcOVRzfIHbyhP1K0AGejjA6tHQg3CYpuDRzlT50 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB552; 6:Trc5ySyALVjQNqaJNFBTbjLuxO+z/pgMZJNv/Hp0yxyfq7jzisjOGW1usMN/bST8/DeBQI/g5Cs4ow8PNwGbk58kJWnjGMAty34nBJg1EN8TNVcXNMamkHQGO54P/k4ns8ARDO5vo553T8HdqDj6deQKh3oAe2eo7jocAbI514WjBldy0TRrrtbCeZLnhl19uS/ARTqcxAKujWgLNR0ng4Rki1XP2cEsKdcgHrYesf1pc3K3istsIviI1jTvMucGk/Wh4T4bjKBoYWRqlZ1Io71Rpi5FF5R8x/XT7raTG9HQpbAx9XZZNY1Vgc0vgq7hHKbkn+5YMFET1q5VrSJPDw==; 5:B3+GQ/vBdixgp1Kbb1n/gi+0ihKcnRU3dw0GgItOqYhPZWZRFrHB84YC4QzIacUp2Vzmm4RgJ2ApFPn1mLmIOopWbgdodTySEjiQGVAcD1z2TB2yE7gBi6rDG2JoiDAIHpSxaBgavcoZaMsc5AcVtg==; 24:RqE96ln5PxiSsnVoxEZoYgn2OQhSXqimVuC6eIUPOWXGJArF8Lm4nbJYqsgYMkehAg1B1ih/3rHUVbpyaAog/DpMi+Ihnl8eh1tVewNeG+g=; 7:AcSvmdoJ+lbkdVvDjPTU+g6LhZCv8RFQ9pLt4Bu2PX9k8urHVBG61LKNVpwjm4bCmSaRYZYZEBKVcFDa+v22ByzGs44GDWxaZVkiS3YrA7TO+XOtcLPtPGZKA7w+hYb8xgTs4UEjfs5aG2/7KZgGlK16/JNLn44tl5Bi13pE6wkNQrixAe6Y18z6XzqbRHLEWUGhLVmLSRaqaIpEMYflQNySx9q3Ek/wEZzY9e3/6EQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:05.0607 (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: BLUPR03MB552 Subject: [dpdk-dev] [PATCH 02/27] 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 Aug 25 10:49: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: 110985 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp808923qge; Fri, 25 Aug 2017 03:50:35 -0700 (PDT) X-Received: by 10.223.155.9 with SMTP id b9mr5261420wrc.127.1503658234972; Fri, 25 Aug 2017 03:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658234; cv=none; d=google.com; s=arc-20160816; b=GI86lbt+aaMMmNce1gTr9lMxdr5kaAF1+AiX9cuFdyG0aSUv7eRZdRFq6q9LzqD9bM ImVgMFq8wy5dphtrv8ARUD72IxcpbnVxP47xeAtoLf+H0GNIKbCqktwRwAMf8yuxRiq7 +SXgW8OB3Wil9LFCYVdNDN9xeI1NZBTiuODdzRR5O+KVAzEhdpga/O4d2it4K1bGEJV7 JMPG2nlol5o/Zpj/ym8+ZKN52qrXURP7fi3k43CqRpNSRGv06o7OsNPUYuYzy6cMp6zx XhKq6XfS7gsRa2mUmhZww0QlE+9l2TTThIlUjsMSbPcXE9rhvd8idQ79VuBNfgb2CC4k kb3g== 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=g7B+vKjvayOoixLUS6tkNMXpihH7wdaaf+j4OKCNmlE=; b=qvryAhPrzWB6QDBtCXb+a1zdQJ+4Y5P7vEbRklXpOtqUEdvKCnaan10MsMaAD/cI+8 xFplFZXo/SFCCj7mkx3VLcLjy/rvzKzM+OhR0ddTA3VF3t65WdDQtJau12OCXMw0tgTW Gg3ck0R7aQx4WK3hXeyeocuVj99/8dlXa5UupjA4frJVGQN+XEcsZx7Ff6TvfIX6AmLC Iha8NnPgczGjRHtTn88iycrHznFj+iHGaMiq5y2HWWBa4W3JsjXNJi4JrYvA6AA3ghY0 +gwMOSAN5OS4qByhVRO5/lqe8RRRf7F+/riabv6uFefrlZzAwSeFuOxJkXqBDorMmA5N Wgrg== 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 i90si1029602wmh.239.2017.08.25.03.50.34; Fri, 25 Aug 2017 03:50:34 -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 D1CB890F5; Fri, 25 Aug 2017 12:50:11 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0062.outbound.protection.outlook.com [104.47.37.62]) by dpdk.org (Postfix) with ESMTP id CB2337D9F for ; Fri, 25 Aug 2017 12:50:09 +0200 (CEST) Received: from CY1PR03CA0007.namprd03.prod.outlook.com (2603:10b6:600::17) by BL2PR03MB547.namprd03.prod.outlook.com (2a01:111:e400:c23::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:07 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::189) by CY1PR03CA0007.outlook.office365.com (2603:10b6:600::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:07 +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.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw67032070; Fri, 25 Aug 2017 03:50:05 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:19 +0530 Message-ID: <1503658183-4078-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318069176703; (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)(626005)(110136004)(53936002)(4326008)(2351001)(5660300001)(54906002)(106466001)(85426001)(498600001)(77096006)(33646002)(68736007)(97736004)(50466002)(105606002)(81156014)(47776003)(356003)(81166006)(76176999)(48376002)(305945005)(8936002)(8676002)(50986999)(2950100002)(86362001)(104016004)(36756003)(575784001)(5003940100001)(6916009)(6666003)(2906002)(189998001)(8656003)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB547; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:h2DM8BejEZtNIqUBmw54k4yH14vSmW2gW16w6dCBpwJPWMK85bQesy96elkQhTGZuV9o0jqGu4HF8QdKZ3KubnmkwB3CMdT2SGHFwyUp9g1rGZ0IY48Gp1W6r/hVW30C MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec59961f-9593-4e00-a81f-08d4eba70c91 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:BL2PR03MB547; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB547; 3:u92hcp7x+4sNrK1YA4hq3gEycJvO890zq4WkOXUB0z+fKNQVFBRaW644ICa0vrV31P/li5tn2ZDn7oyo98FMqMXRw8+MNf+iCb898aLM6cd9l1Wpc1RpbnEH9Jy8uG8Fave2QSwv53+nLNd5lWBBKnbaZZ6nMEC51dV/0nKIdjNq2dVOGWt4ggOGl8yJo+RDCSbLm609DJOnc+bxazHe0nnA3t/RZ+Heh0EZnH6zpowmwt52yPBcYQWHx2sG6HsTpnarEfN3e1DdwdYU3KNQ0/J5ZuvOcf/22+EcTdT6p+QguRxS0cYR4Cka9q8GmOlbASfY5SF3lYJ0nLa9rjZpUqkhRAie0SUaMkfDiaVALr4=; 25:rOs7l1ebd34ChIpMWKXhL3iPl5ft629rAXN20+zVHXeobHKlH/5iFvMR9c9yfCX8qlxUUxIOw0GAnrzfqEtTi7nkuss6KNw01GQvagUKVvCXo4cW8IR8/MPTxLzSs/tlSxggggOFARMl4Zl6wjp4vELCsX9zM928Dof4AHzHwDg24IL8QFoGSHQMBKalzjWnrnjm3kzZQuFYbo6I6DksMrvpF2eb2mGitF9Px34VVsjyj5fIIONpJmaqO5MUgUNzQLMf1DrX4i/oApMGJdDCc9/wsURNjL88LFb1EQNYXqdwmlkHFXKMtl1VMUakoIPfLUDG8ieo9rwhpOX/MCJUznt2c9bVqvhJ0s3JjMuYy7I= X-MS-TrafficTypeDiagnostic: BL2PR03MB547: X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB547; 31:k9OpR8hVaLaQJSt6StYWNdJyEqlgD5yut3A0iOnzq16zcSGfZjmCuKPa8R1XUWD4N2Ez1iHHXgPMsDkn85fG81JwrRrrfIq93w6WiwZrEKMPHiRL0ftLB9ThM342PrCcwJI27f2Uipu7949qqT/eADEBEgxYOjzlpGPlDA3HRuGyBWP/w9RdKX5Aef1pOOhRPKzloQmzRlWUdHxtT+vl1fro/j4VSd47ir+Hfug76Aw=; 4:V+blnHC+cTOzhsPIuWNVgbySnno6/VGWB9bv89BKzNXcyXdkIca1ANDcMUPaCu37q2B/Y0RV3U4yIIzAfZzEDq/tmfc7UjSpaxg5EGkdT4XmzBkz3+SiZ/ZV75fJQE+f7x/tZMSCFx2pyuaa343ojIreTFpC19+wsdPejDMNSUXUFz2iEaW5c9Pd08Arg99wQGwC5TbwiFRpMbMOEdC0dLq4R5KHsXJhrHf7u+Y7FMunuJwe1E1Om7WvuCz2Qd0blIynq7qITllNJ+5inn7SQk/kcvF2bqsWfpX04QxnxUs7N0JaN/09gvC0+/tQOB2+XBgoKPW/GK9+zAuAynUizQ== 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)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BL2PR03MB547; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BL2PR03MB547; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB547; 23:E5fNaRIh4B/SwS7PcNJI6Cuqau/GcGZWeWHy+B+q9k?= v8id6Dj4eXvELSb3+R3YWFVhanWVLZoUotQu+3GJtRvSvxb4QPdqvw7px0lluEjz51sCM9dpMeIaIn9xSSI/lPRA1PBKJUuzynUuEJPCes1knssw6kpmjSEDJ05lFW9ZoX8gbXoErZi/xg1BzhcpIU/1rTaDVSOKZszzHehf3zNwat3Y4LTycLF+aKIn5Bn3ve/uPFQzPgvcaOvzxlQEpDalJz6RuDHe/kRREHrTWvQKSvpSGjtLPUscyH9AlwafTAeqPrkDge40jUSZFQTvVD815rwPQZEOfTYvqzPNBa1BJlGzNyWMRbceWjiVuOKc/OWRqhYLxheALYKdEYdUncb8k9T0WGRugqKWQavoVQNs1mn2t+4TadXHANRglhsV8mabygylo9iFM0+L0GX7Y9Finm6HmqSkL9Mg9xWsuIbmZkTrYtowsIB7UAuJGehU3yVOJyJsMYFf/kIGWAF13H+Edv4owe5TvrFSk3lIGSdZgXrS+M7tF+J4dNYBzUODAC9bdYbCU3E0U5Fnh4SHgymvvy4brk/2PEgDKzKURzMmyuEHLFWARP7a3UkkTwbkn+EHYuQg0PGs0TZDHKbhHsM/aWsI/MG2Xd54PfZYAqABASJFWBXAaGbHPHHD2sznp4lwmw3E6m6u7LcQ63csS4P0cClfNrYzjvGNfF4AgvTdgGPyUlPKtKi7vjlbHonwkl6WlpNMmKROA22SMG/45KwT61/0TUHU3dlWk5I9RVm3+aR+Fghg5FUhj41TwXrbQVcxZidRPG8ImxUobAqMXl6uavZ+WQyKFKCjgd9SDbEW/HNF8/tQcKcrBf7uHt3sNd7021DiwOzZr90Dg6xLk5S6qJCRn17GF5H8riAoBgmv1JvtFbfF235qwWbD6lwfxQvhAozWTqx01RMqdZnz/K4Pc1gQ2+CZIv7eTR1caFKQOfAwxmEgvZlMP5bTPf5EMpc+BrcyDzeAZcyDHqUt7IyT5H+YVy4z0COQWj9uyvADl5k38B3daayCJu1/rWI0TBghwHiRxtBX+46xoDGZcMYV+GE/wKZPPNjVre6OGIrBtYmLMP5ygoQkmshyRQ2gDnOA38rG548LB9CN8V0BCFdyMemssTFawHkbSpLOXYsQ== X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB547; 6:T6NGNrdrE7PfCQEcApCig8HhGj1HdcuHkLh3UUp8IuTdVhwBQKQgfjslp8+tTD3sdgkooH/yjNZYIh+gbwF2p6Wl3KMlN04argGqhjDvZ341P+t5XbuE0Ie5M5+dchtH/LAPrhs6dUtLzQQbXzPNcu/BgwdvheB8IqhcDsxtHdwc+d8BbXM06gzGVlDvfDsN5VH9XuAioV0US4CWHiwiphNj3VTxGH5tr84l3AFstWTvindTWYsP/GC0l/pnLO0ui2Y2NWsKgK4cU52dlo59PLTt3lIJvu4z+heMludQ5lskHFez87Wz4/Ce6n87web/OQSvBXuSJv1+qjNresFxtA==; 5:GkFVQEqdNv9cEGiMHPanvTMtc0UM6Qk2BXa38x/GIUQEfIfjNdtxKyhRhb1k2vEmnSY5JHVPMxhddKBP2yqIwSDCgIe3/V2l4U2GoQonSOWxXVtgrn1Trn4DNN2z9+mp4BHOXlEl4ayFmy1KtM0jSQ==; 24:J1se95+Olm470J/8Mv+5c8sxbEqMrWZR6Gj9Zfoe3Kcl6XrUG4uCBN/8FH4xEhgOefQI9aiH4a0u5qp4rlSILMQnDvADv67pEunG/a80u8Q=; 7:qXZJd2EMxM4UhWMlm28MgpVfF+mtfxjoHD+AZTsbHMm2dJX18l7uRwjgD5NFUUIKT24a5BwNhrdI4BvUR/G1cO1gGCNNn1QME9Vn8PyuYhRtIWSBkiO7AX4iRU0WtzY/xQjdJX5WqFL99DwOPmv4C3FphybgNmq6FkKeDj2zWBKHrPll2+jt2FkS3aYT7bgpZFIvarM0YQBW/DFlvJ1r+mAOo7Bofd2P/7TidjMOCAE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:06.7460 (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: BL2PR03MB547 Subject: [dpdk-dev] [PATCH 03/27] 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 bae0a96..8052d36 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -671,7 +671,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 Aug 25 10:49: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: 110986 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp809194qge; Fri, 25 Aug 2017 03:50:50 -0700 (PDT) X-Received: by 10.28.125.69 with SMTP id y66mr974789wmc.42.1503658249999; Fri, 25 Aug 2017 03:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658249; cv=none; d=google.com; s=arc-20160816; b=J5XNrOhyJO0MJKvYSGpaagB5pqCNY2Gp7eJv+qzocvyDkhEWelgNHzaP6fNAQY2R1s B5wKxHcWzho4SIa9pR6QJ2NQMCt0+WYIbDNY2CBqVHKxiKbtV5F+m8t83qxir9isf+NE 3/RT6l3/3enMQmTEMkx1p3Tp3VAlTjwnj2gVQ4sKo3RNZil67NZgDdeRygoQBBLIeVW0 LI5MU/xyv0Td2uCxapqH2vimzZNrDCTiK0M7JO6wZV952KD2QEM0oQEnur9qCS4oJx17 0P2pNKS7mA4fdTleBQ1Zuuj+xPDCyM1KRJbzAcCbBghQ82ikmJuELrTRA3FykDi7Xfwt H7/w== 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=urOcnCkTx1IaNK36NK+mZOUp3lW77mewHXZNKdVISLORa2mTOoQx9swElpl+2CNEbL YdSbbUGeFQmSJmLkX1gf4OncVVEDFHBRnw4EWybghSVKbtuw+n/9btKjnl+Clz0cKTvf q8WaLILYQem45IVqpE5GOXwJRTRavRq/XwirfNEYPBxqmsRKViAkJ4JcSEeDlIPHogVv AVGZIIw8K7MwmeT0H0zgG1h84KvZFLVXQqNqF7TfbXFDNBnuqpdxsxO+GEy4IJ1C6Flu PboJigeGUwVfUm7yoTYzQBdhND23eyYe31+FBpTQsg0bDIcyfJqB1eOPF8yAg7Y72gAQ mitQ== 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 w9si5129002wrg.265.2017.08.25.03.50.49; Fri, 25 Aug 2017 03:50:49 -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 4013C90F9; Fri, 25 Aug 2017 12:50:16 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0069.outbound.protection.outlook.com [104.47.40.69]) by dpdk.org (Postfix) with ESMTP id 4D47A7D9F for ; Fri, 25 Aug 2017 12:50:11 +0200 (CEST) Received: from BN3PR03CA0084.namprd03.prod.outlook.com (2a01:111:e400:7a4d::44) by DM2PR03MB557.namprd03.prod.outlook.com (2a01:111:e400:241b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:09 +0000 Received: from BL2FFO11FD048.protection.gbl (2a01:111:f400:7c09::115) by BN3PR03CA0084.outlook.office365.com (2a01:111:e400:7a4d::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BL2FFO11FD048.mail.protection.outlook.com (10.173.161.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw68032070; Fri, 25 Aug 2017 03:50:06 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:20 +0530 Message-ID: <1503658183-4078-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318089041357; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(77096006)(50986999)(36756003)(76176999)(6916009)(6666003)(54906002)(5660300001)(356003)(81166006)(97736004)(2950100002)(498600001)(50226002)(8656003)(85426001)(81156014)(53936002)(110136004)(8936002)(305945005)(4326008)(626005)(86362001)(105606002)(106466001)(48376002)(189998001)(5003940100001)(8676002)(2351001)(104016004)(68736007)(2906002)(47776003)(50466002)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR03MB557; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD048; 1:+w9SoiOLnJIJ8qj6VLuGaAitmz6DQc3etemvgQ3Xbl1XMEh4vshOwabnAAFoSQKQTKrZDrmx+oItStc59MPjIioieScD6RA/olOjBgjqj9kJjZ+3M3HFvhexujejyvWK MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f886de9-56ca-47c9-25cd-08d4eba70dc3 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:DM2PR03MB557; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB557; 3:AaiPinw99ocVToqFxUS4S3jb4mmZNggPZMZssSe/XlVxNCgd6DYzCTd56FbNM9dG+8Eg5nZX4ITJoJY7bjAiE5MTCfWR49eoTVgVMkQT42rvlNherrkoFZInCLXg6cc4RATn2tnfXkzEza4dqd9nmoJOipYvwzw4i6or5WvFfY7t2v5DrK9jG6y8t2QWJD/hXOv3PLjB8XXDbpMH6CmLe6/BYO1E66GFRzNf9wd35Iyq/thpkOYmCFHDISg8AvPmVU0e98vWR5soB+EuYloFSKP3IDVs+E+Cj7Tq3hBrTCrqpxwIXj20v7ZlKVpGeg556rzJwlGnnld8xXjUBHCdp0jesgLiUpeEqr/8/qoO2fE=; 25:IUZUA81p8nEYgijk2QrP1X2anlYp8Xxp/MBFp80yQ4o3V34E5El8GZK2HukO5+FpiXGw357LXNHn8sV6+v0ea3X3wDRbVNwQugtk5A8k3/Kyn9j5JDYXZ5R1sZRSFE8lV9a2vvPbiJiv8iH+L/xJjraKz1+4ck13QV1IjzA1qLRaZIwsTcY/9VWK5AuquzGEFE/p5FJWDXnSVdh6UB73QZ8jaDWsreX75ktWmCdX9TWa9409nF+3Tzxz81dAOa+9wDFFmMeRF1XzNnxG2v/PbJEjWLeNxLjQPyMaMLCwbnN1K61oU+d+0Z36dKqPwgD4BVMaEZM8frvhln4x8Ffz3EXyvaMdNmzyTomU+wjB4tk= X-MS-TrafficTypeDiagnostic: DM2PR03MB557: X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB557; 31:hKHqgD5Jk3zJHFuYcl0RPSHVpLfNsD31bQSX3wjHY89h1b+vEJaec/yCzSWFqAWv4myafwPt2ZBryJVUKLhAoHPJZhVAhP866oug253c7JhTQwAGKFWPf3jfnkwab/eegb6W13YQG51Jqme5txTzbhiFZxH5GEgXA/4p2mCq8drBi8qHDAxVsuZIERBa2lGt5rogHnn73rxg+2NMXTj5VjNueJNd/l6bzWzH75peNSE=; 4:bP7KT7hW+GvJPmcLKHEpV0uuL4S2j4GPEg3J0HfUNT2sG6OH4ko3b93h4Pz/b8EUKx06XX8VCVMyfYoeID2nZSadrbeHoBtk1gMGGeJg7QMyzBM5/4C+78F6DS5ZrhdRjrnNpvZA19xZa52fjx/RqX7HXyF0APH6ZXQs2VwI6zvyhotRbEiB2RTbuzL9eS26lZjP7pfibF58bL57jy4u6unrCAZIx0DnDJVJaXcIPX2/7Qiwdzwg6jeHY2tkThuEWOxP04vlt8stGvaCT0EHU1jhC5FikXEElaQbIh3wmY8= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR03MB557; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR03MB557; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB557; 23:8TacZUXVb+yAKygWpYAiVUmGl8UYQ0M9xa/6XVCJLH?= CR4WXT+n/M+9kp7t32rb8pGlnymPsN7c3odsBCCYgMMRfI/jgZFZfcAKGMNQNgb5uTyJouf+jeertjYCF+1Y0ROjRImjlQFQkKlXv/W0sjlrL9JgCBDtYQSxcHvk0OxLHsxrE+FY+6/8LBmxv8uP5Uh1D5MbS2NmlNSJPwV1rE8jJ8l346SwZWUEWvGKNnFQGwEFww8lHuq0sdlpK4piyffZQriAp1lPAwoI4qpN/LtXZdl2LpUmeJ9Z9dEHi964rAMRmlS6XRlFq5FOIF87f+vQGyc15HFwb0sNwZL/TSyEHLtGHqY1jQA8HE7mX6xTOY4Orwm75dr835IcIO5hOpRE6eH3BnsnBn0fxZRw1jaz5MZP4mUJYREBPwMug42dBZxxsnYtZv/GaO3TXkeq0CpUF+bHAtheDyd/sCpzFy2KIic6Knw6tvvu2F+y8+kRACYnDqsXhdfhYADCX8jbQ2GOtaLAyycj0bQdZl7u0+aevrpGcg3wBetz0Ne3/aEzqaA0hBTrynTg/T0VjqQZ2ZD2TVUdfl4NpFpVhimrOkvycl4MQjl8FqAqB4ddOJGhTJHUvulaHCJB5dj6EsqkJ6aL2cK3YHjTztMwiCG2imRjQm8ONcjK7Fe1yN4fP3NEYEydFYSXitA9puBUWMLghKsX12QEBxTrEMILhYyI81CnreRtsrvKaeRQv7YJ09/4WQmcx714xu8YAwgHsCdIqB9acEaly9P4zo0Ed2JX95Gxjn0GPtxjeiartP8JKRxD3H6n6XpY0rj/MM/4qLgLq5Z9fM23X6TRULN7bdX8Bp+BAHxmKPmjI+VpEXnKwij25dAYF1AOnIXQVQjqZrrTN4HvoW1Tz2tIiFwPOSkztxA3InJp9Qsk+XlFcLmSKj2vvQPAi/scQLmjFe3NzpPI8xUP3P5cMB+TjaSh2/zG50vP5/rhuVeD20ycbIH6tHaFfxh3aKJyMDaac5f8B+IxADNoO4lgnBVZZzbnQ99Ur5C8GO40tbADzqn78SaAZGC10nvfWKDrREqyH47D+N0D3+wIrVS4QaHV1u6g9XvngWPa6u2VBBS5S+OpnWAhtuTYsSq67j3tT4DnMBDxNUjrY0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB557; 6:LdtdpnVVlOFvsrmmq53ELtRs8dSRjWY44uHHqrrgzDb36Eck7m9YyZ1CmZj5K8/O2ClfQyFAJrsc8WG5SAeR1XPZ36vkIq6E1CQWhAFYeRgsHwkDq0PUEV2c2ru1iCw3Gwl8BIevmjGhtp5EZnxkJCafzYN+B37kNDnpdaOPtBjC0wzckIjCqoxUI4wskTZfM4c+jsiGDAJFUz08a56pOWvM2aTwglu4p16IfCEGN5aSK3NnUg57Rkq7Lc5mb5zDJZ6cHpWHEMdJ4AsVpSAfMrnX2nE3NG1SekG/MGc/x/aJVi0NuM3FyWwpbGrvH0S8JgYE+6AUKWXr057EdN/InA==; 5:hjOYuvcsVrcVdCvRs9ClDFMm9WgQR1NIolx3lo6nWo5Xv8rXhTFvxgyOO0eL+gMh1VJtNHnDpT40m1A3Axis5i0aUpYhJJKE2yqaB5h+9XohLNUcivgMVSBHFeRPpcnddIPn4ocCNegUaMHbXW7X3g==; 24:t/9GkzZXGRsOZj1njRksbZ3x43dCGixRPZ2U8w+LIlLggK/wnfxvkuzs9tEZw0+eLD38IJZ96hhz8OVqMBbQWlxcyZy4cZprQXYm1r/NbUE=; 7:V5x6C52b7NY5cbCkfs7D3m0TVomgOklIi+Fwg4LBr+SGhKyFD3xyk2++DQhtiWA8wXGcF/5bkqEQq/IxJrmDjqDlLimgNfQPjTg5iQ82fSf73Vys/8pDmOPEf+bAECPNi6wbvJBQKPpHbv2pCW1Ebw3uqsAjexkmPLDRZxOICjhSMGhBXII+MZ1Uw1kSkvLvoenjY6V8h248796H7YPL3EojdR4gibM7jqR03uCMZAA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:08.7013 (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: DM2PR03MB557 Subject: [dpdk-dev] [PATCH 04/27] 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 Aug 25 10:49: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: 110987 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp809500qge; Fri, 25 Aug 2017 03:51:03 -0700 (PDT) X-Received: by 10.223.177.211 with SMTP id r19mr6715064wra.96.1503658262970; Fri, 25 Aug 2017 03:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658262; cv=none; d=google.com; s=arc-20160816; b=QXOem06HybykOqWaiD5HjNet4VHDO+zujbObULudAMTCXz1I5AyGwXNub8zQmV+tVr rvRTa6A08dOHPTaAYko/TBYBYhIE0bREZPsYifwN8frEd8xF1j6s8QB8h6t+Wd3SeFfb yBgmgnc9Tj4aawgVvIuq4D9rElDhl5H0xeMegFhYR0y6XU/7EAg73ugg5kVwcZRzCp6h +oDQlLu0w039TChW3dnm9+qJMnXm0DoEnEbHkB0DJf5x+xbAWRiNUFvUd83EZDajqMW1 EHWBphW42WbNhCrjtIivjPWSJGq6BcuBrCPAnmU9zLra5lyREpz+k/gSrSc2yQ0Q6GNf YeWw== 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=W99l8XRhIGsUftaq0r+Jqf5kKTg+2zZYLNqXt8TCUc9sLyjq5B1OXUjJHiviWtsujc lCjpJi8FccrHTmXTnYQ0s5oQ++jl9UWMn0dAWoAWC5B7Y6WLbw7iY6jXuW1MSf3DDLC3 xewhDU0pZefsvzcMbUtJdaQqAscz1+uimVCbV9s4WaIJ4e2Dnkbe2lP2IYIMB1gZpYIf iAKrbKEJDUX5rg5L8+9Vv8cFiKqeqkbqTybpQFbr6OIBo1/KhYjtEevu5HaDZsHbWT2o Q0GHmMdFg0QwrjbQ+gckYWEl8q5pOW9YHcTAipniY6l8f6mZ5Tg/4fVyrvI+awfjaO9P kYYQ== 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 33si5312999wrg.1.2017.08.25.03.51.02; Fri, 25 Aug 2017 03:51:02 -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 930629111; Fri, 25 Aug 2017 12:50:17 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0052.outbound.protection.outlook.com [104.47.38.52]) by dpdk.org (Postfix) with ESMTP id EB33B90FC for ; Fri, 25 Aug 2017 12:50:12 +0200 (CEST) Received: from CY4PR03CA0073.namprd03.prod.outlook.com (10.171.242.142) 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.1.1385.9; Fri, 25 Aug 2017 10:50:11 +0000 Received: from BN1BFFO11FD028.protection.gbl (2a01:111:f400:7c10::1:140) by CY4PR03CA0073.outlook.office365.com (2603:10b6:910:4d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:11 +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 BN1BFFO11FD028.mail.protection.outlook.com (10.58.144.91) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw69032070; Fri, 25 Aug 2017 03:50:08 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:21 +0530 Message-ID: <1503658183-4078-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318109123790; (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)(86362001)(77096006)(47776003)(189998001)(97736004)(85426001)(50226002)(305945005)(2906002)(6916009)(104016004)(54906002)(2950100002)(626005)(6666003)(81166006)(8656003)(50986999)(5660300001)(498600001)(76176999)(33646002)(356003)(8936002)(106466001)(81156014)(2351001)(68736007)(8676002)(36756003)(53936002)(105606002)(50466002)(110136004)(48376002)(5003940100001)(4326008)(217873001); 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; BN1BFFO11FD028; 1:sV7M/Vv3YJMVHLrXePKCivdpXVbv7rcRpE1yVBQus9KU8cCX9O6vwt3YI7L4XIZXu1bpvNUZoUlOZ56XXnyZ5xiriPzwuwHGIgHdtFcMuVwQyfzPijIWk5XuVuc51Ccn MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79083534-2a86-45a0-89ce-08d4eba70ee2 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:OMbMoAFqAvAR8MF362f8YRct+TfE2Z1bYcqGOC+sfTuI4bJKBoutC10lhDXQ5bLlrzFwqNhpkbqyHRov8cKc3hfsZFwPGp9zZa9CqYO4Ia/WHtAB5zzcKrjxF0jUgDMhsH/iTz/vxjXZvQnqvzhfKdpQB99W2Fl3GqQ3xRgO4s4QkStLbvLEt8wt52VoYVJglZUO/UAA7OtiV8g5I1zu9c+zzLTslF0h43LIb5LHHHBTcvKi9Jwe5ugJbHkuKYxmD0TM6si210inZkw5LMyi8wH2dKesYoHcEGLlgFRiIInib72sjOFl1YVBPudY5rUoDKiBxbcYt/iegvFvkL+oBeg3JNofHKS54ABWGo7zbXc=; 25:fWexlHDeIG3zaGIkk2Yv3oqzMcH0qUu08jUl/KE061N8Bbhg8SpXy5ZCIJ4Z7Hht0mEvLTHSedfgcEFBYAzhNJsc5sPr6mmFKHXXbH89G7EtNysBE1c4UjhzBxnG/ZMbRrQbwta4RjgBk1r24K2pOyXKuimbQ/VY60HoveHPP6T2Zl3V8My2kDP9kBslEW9Gg5VmFEEAcGS+XBm3fSUzjC0YqvpvHhozcTm7VRS2LxnyHcwbrh+6Uoh3BQ+7emfZDvPwChCxB8Lcu/mu+xdqbDcLUbK8vNApyGFg8F8CRWtWNUnG39xobs5dz9euJfVWitTbc9+pFdUqkYofmXTyjQ== X-MS-TrafficTypeDiagnostic: DM5PR03MB3322: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 31:0ahrHJhAD+lQdvFG8LhX5o7aS6C/qSduIXd6nAe2BLJ8PPNtEinEpX23J0ENctJc7voSrRWirOkR7OsWjDUJzHjmFy0qCPx2jzjf9BLfycxQyqfAcG+ugpmyEy+lW6y36Ia+kVpwfyNNZ1I80SO6DQRbrtMiDUXypfqVBLbRhBU1rLC/za5l2IYSHjT/XPp4Ub+y0AM6/flD+1+KtUT+AzJbS690KBnfHa2ZLLSb1bY=; 4:jRcsH6+6UZmdqABnLNh7sqjKwZGQinEXCirWCXtYKjgX34EO1S7V7oZJGz+uBBW6pJ1NxZWJUFtF0amcV4Vs9sdhee6xtImHyABdiNNe/BYJBZk7SFMBjsUGYzVN5vX1gzaQ2jMqDYeaIxUhW92weKfs7kI5v4FeDiBDQPHG6N3YDNwAsRNzxQfHlol2pd6evJxTJfY/hFEGPDitIR/WQP3F4otQA6cG6rXm3C0GgxiPoikmorftcNkvyTdUz0eoV/YMGWVfpfybCXVaKCdEfjwvI8SMtV5pktOQbwspPcs= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3322; 23:zfymbsFPlEckGmQQh5Nq9suQdSUJfeGAzcYfZdr5/?= Emv1aXB4tsO5wqjWjzDtUZSQCJ6utUMPowuVJU5wpZl6bqNd83VyVP7qJ7oS5tQvj1t0kDt5LQjkadTeRNYTsCikj1KwDiQlqtNb87foAiN47ishGUHJlUkJzlJwDpnb2uyZ5x39BgZdgacHOQPgM3O9E2hDBynVETl9pO50zPOO28rM0lMRhChpADqzHJKl8klngYejvVF+lqJCu0bCJmQiGSM62hQPaa3xBOxsVkNe6v6B+nD84DuMSqW31ZgVklC5kPRCS6zuWneRYEhpjiWQask7TWVWAbOaB/fHjLvqzwW7XUiRhtQe6r/GGyyFW13B2UifD9d3+UUncv1cb8Ar8oHDGzbKHM/mhbr3mUdo0446Eqw3umiLisE/8Cx+GjjqmHla8w+p+LyKKA8TdnqUoW1Ht5Feyb26/rVhBOHl9rH7gZiaO5brTyX8bMtzm6ERaQnzaFYwWEJtJng13TB+2L+HtDcvNhCiexERI5Zx2nuf6QzXsEJa+sBY9rw5qGUpLRVSlvkzvJYeTK/8GmIm4UCKwVx9ibS2LSM7bxflFpFXx1/1+C4RLWBqwpU6j2XvNbzi+rkg01RpoL6Cp1iLIItdc447vruEln18AsXftwJEY/SV+1w6vPTzxN1kMfydMy3/+JmwFsOwxvj+imbC88qUMsyg6VL3mbMMetynIW65CcVd8AH+KCTAtSL85+KpmhKAU7LW9XNNIR+HjXoiJEBzdbdjLv6kMtd7HRZ0NuiILLg2jm/i2uRB72Ah8wyF/fWHijdWFYYrGdKU7HlpCASFur1YJ1A5hjOAfOjDksVzuH9RJ74AfrhGQJTVoyRBPJtrmhLWmKe5YHzkw1MFH8Yn4NK8wnyS+oh475h0o6NzooibteP/Q/lAGpWoKfW70w3vpOKZ1P2Ot4P9yvCy7CeiZkcxjQdrls9rfGpF6dELBkPsAYiM1hstASwhuZdllAP6bftXiLqr2N6QMlEUNbMCBd/mJnM9TF5JCQ1ZjDaX9ul/iY7UlNm9fGE541fU67YlDyrNqIREoZQKqxqqcv6bxXMLcuGa0BI1Bqh424N3shyOPqidKvYDsNXxqN/d7Kh8JBuayrRvaGj+0wri4mFmYIsL7wci+ht4knRSw== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 6:Pf/zMrYQUjS7HwMf7Jzmq22e5/E/IFW+CWJ5vD1LSDuH/nYiVM7UUG16R12ohB6Mz0g+d/AtW+ovj7LeRVzCGjhnWjxKAdxkHeoi2avRZRADjbK52IdbtesKTaDSTvDFPckx/C6Z8hsrd8FVGEH9G8RWl5sNQomCQLl7AiLufRLamAyLTMrx49XGsFqsr+wrt7yeysfE5qAS0JvWH5ZBlCe29dcyaS3lkD275NqZX6Wh2bxTHjNOs6Eh7myZ7JUqvI9M3K2EvR8GOw5Zi9pODphn7An+Lf7tbqBP1wRr9m5kL3hWVYoyOMwKb+YccIXEX8NDMvEMo8lJgaEibSk41w==; 5:PB+YdLQMpchR8DjLlk3xX+Ty6R/Wt9RO0P9ZjHYiQUyne+0MuIOFWLbnmUYwZhQ08yc0GUZX2L+y/my2shv8QvxHv7tspQSufOLaqvd36VFb5t7Kvjsm8NrRkYutsxI8RGV0HEgGnW7xy0VhpMCyjA==; 24:kP/xFQfWuwSZHImScVrYnxs1qY3hH797vma/NdX4GDGih8hn4gv5Zi05pMXJe4L7rR8BcPG0vEYOebFwb0kzs521iHsBWC1DctSoTuK5saI=; 7:P2sgxeXdBugrtsltnWx97dYceo/zX/qIqeQdyZJLLRF1xPt4Js7p3uj+B1i1vbYdcKAMlWwsAo/WqMTW7dheA93J9pevJ1PhrEWC+9dac+CzEMPO0JO7pv58h2UqCxLWKGo6jhJrzMbAqVdnxUUJryj9b1MrzY9vt0LfauZ3lflQawTXzMgYulOifkAVpJnq2ZidaT1XBsGtZB+aH8g5LOB3iduz1lptS4cR8gp4DZA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:10.5847 (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 05/27] 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 Aug 25 10:49: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: 110988 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp809835qge; Fri, 25 Aug 2017 03:51:20 -0700 (PDT) X-Received: by 10.28.2.2 with SMTP id 2mr962974wmc.54.1503658280716; Fri, 25 Aug 2017 03:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658280; cv=none; d=google.com; s=arc-20160816; b=xjbBQ2qYT/nz9/gtgNRtZ9jH7aP4ZdG6QRFw5YFDgtEoJ0lil4fJoymg67YK/TUiG6 PtPq7QjRSycwU+dBYICYXJyHnqfp5sbMwY0+3Wdt272Eeb3fJLdsIamrwiVlO5XwXgYR W0iTezJJrVlSbkA3buyhmqlTEcJoW4703bb1uUmPt2bDrh2xi0MgSkBJU0jFZDQGa0kM MYZnkJjoFf/pGslcdiUfj02skDQpGPYPTu03FfmmxeFDbd8xZSjNQ9dxMWxCqbNxKw2N /kkIEiIDI93JXUeG2WMm+Na1xcbokt0GI/iUinja3CAEkchMAbbhWmNd2Qk90EuFt2gY gsWQ== 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=+zIhmgHiw81UAhl0jvaTZz4d+4yzHyPKeqE5qK/RXxM=; b=fqev/xFdQBVFAyVJnt0fPCOCRQiK5QdQM2l8sXNmU0NEAjqO9DMNqjLuyCu0RztApn S2akTtSR9wEpQBl0S1/ojzusmJRyYXaqMIgkh5+crYlHoB8BQ5HAD7kLPulqoWcVfDaV GQIS217rled2dHaq6753o9ufbd3O5frWajML1kePf3h4VwcNRVPAIG5Ifdqywn5oicUN 3/R12w7m4iTxwx7PBBKVMhoL2YQYLDYLLVQFD7dvPsqhIluY47glnhvlo5Hcz7RimKnx o/by9c4aYkoCcH94SNPzlZR4kR7jGhajAGmoILAycit8h3EDX38oRODrdE7fzfTvg7pC 7pow== 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 m123si1029020wme.132.2017.08.25.03.51.20; Fri, 25 Aug 2017 03:51:20 -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 09538911B; Fri, 25 Aug 2017 12:50:20 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0040.outbound.protection.outlook.com [104.47.32.40]) by dpdk.org (Postfix) with ESMTP id AFBED7D83 for ; Fri, 25 Aug 2017 12:50:15 +0200 (CEST) Received: from BLUPR0301CA0024.namprd03.prod.outlook.com (2a01:111:e400:5259::34) by BL2PR03MB545.namprd03.prod.outlook.com (2a01:111:e400:c23::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:12 +0000 Received: from BN1AFFO11FD040.protection.gbl (2a01:111:f400:7c10::127) by BLUPR0301CA0024.outlook.office365.com (2a01:111:e400:5259::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BN1AFFO11FD040.mail.protection.outlook.com (10.58.52.251) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6A032070; Fri, 25 Aug 2017 03:50:10 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:22 +0530 Message-ID: <1503658183-4078-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318127180510; (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)(106466001)(77096006)(50226002)(33646002)(85426001)(2351001)(5660300001)(68736007)(2906002)(97736004)(189998001)(47776003)(50466002)(110136004)(48376002)(498600001)(105606002)(50986999)(8656003)(6916009)(6666003)(76176999)(2950100002)(54906002)(53946003)(36756003)(104016004)(81166006)(8676002)(8936002)(81156014)(356003)(305945005)(5003940100001)(4326008)(626005)(53936002)(16200700003)(86362001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB545; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD040; 1:arSfyUBR/bqZgCzME8nmjc5P332yz+w5kiVNN5T9jH6IjcWnssABWgscx2CWm754Qr+SgZ0DriFAxmT7MvxrODrrXDlqA8SDttAQlw7HGWjY/Pi65fzR63fbLg6HCPLI MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 866cdd9d-ed60-4b15-1ade-08d4eba71009 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:BL2PR03MB545; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB545; 3:plofwA4r6f2ffYJxtYsEy1c4tgJa8qnLWYbws6bCoz600lFjrg7Y3L1q3+em1aRQxb1twzKdxQS7yBxPuIylbaAxzi2oXj0YV/3AFy05JzIH1Qe6qjELn4o6I8sRmGRNbWk4jHC85AOlaUDoec9mSflQoWkp7nnClNhfCDxlHZNn1Fc4eizOI2wwU44ooNgDsxTnJ1BdDrcXpEpdtE4mY3L8QQsWZ1ov+LIVKlmT69V4nKIUifiVJFN6leDjzg2LXk6D0+kr0znHku7gObcGQ1iFjRsnk3sKJh0I6kLyGOM8MGV5QUESXMUQatZjALxI9WMktIKhkZmgY6XlAPRqtfOcK1P/youDAMIHXdFCGIU=; 25:ssJXiKC6FODOaOPseLXGddshx1sP8qtlmq42PS3quTC+um+vDhPkQXHNSoY4AxRQAgSLpP/EHkQhfKGL3+mMvd+oa9g3a6/xGBWY3s7+A6GIZSnBzQKpkFiljC89nqggQCo8HylHmjIO0ZFVhJ/5aX2M0WoBd+i1SGEtmlk5DcI932sYoZ80MPTmgWfEeL7hpe8nCqw8ElD0GJYmjkXOU36sF4wZC70JLpydw2qBbsnX3rj2XWFMRVSq1095qnGXcTixkFmHgWn+5Jtw7asfl4zSHTqTQjJZ4gYg5Fzntakyi4qTva+NuPdVza2pceB7/HB7QBzbM1mer2oBIHu0QcyhS0XfYxABZxzG2yUmHPo= X-MS-TrafficTypeDiagnostic: BL2PR03MB545: X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB545; 31:Z2IITgm9bsmIcmNomcno2lsZTnF6aUbt9etFlNOSWU4//9YC3ZjuNs4d5xYeozJYm1B6Od0evTBwThj9dJR9VVQGnOUzokAQe15wfVNzcXdgFOrPkmqbSfsuTaXWTu4yzgofzodKVb1+7rpDMb0LcEf6p5VHEaLiAAYmoOy+MF/L3noychRhQV6Oo9Cg2VNvnztNE8H482QOvNHHfWGoquv5bktT3V141oQjQAqIwoI=; 4:8yC1PYJbDrIfkNSiIPvQ33tn1dPenhJI5JaEcJpVDGIqVFS6sWf9rL++6bO67rMozKcfQ4df48lrOChM71XJEB88CO+H6DNPT0cDyKbZimaq8byFo1BrrfZaOM+wk3fS1WZH449Wj/y1OjOwoBhP+R9vDNl+FXjClObb8VBYLDK+TqwJ+5VWV0TJa1rYIiFJnQF/QjX8WCsqos5wW5SE0euukZC1P/5/jUaGI88KDXs2r99H+Kjv/QxJPG0jTVRHh1VjNCtwCDjwnwuG5RiWu+oJqN4gCDET45p90BdgmzN3PwIaZhqPXhoRTVKfx629ekgnGYMnGadYv8fKGfT0UA== 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)(601004)(2401047)(13016025)(5005006)(13018025)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123559100)(20161123561025)(20161123565025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BL2PR03MB545; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BL2PR03MB545; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB545; 23:j9Q5Pd0rlxukx1FDWA0ZbS/DyjSCDX5uojJlSX7z4l?= g9ybbHbA7j9l6zP+1JyGnK61Sny6Dv12KrG2cqwrkTp2dObiH0Gdc2opn6W77/Av6VzyzN346zsC7W0BsvtBUaZkMNpRM+Z5qJV7jPlpwXakz1LAg2z4LQx0Qf/hY6ZH4ONrVdMOe1wnzhuXUYct+BT2PCAOwI4PuLMvV5H3KMrPhRt5o4KHJvFrM9yOeWNk0v/CxEO/HZIwAwkr6/eG4BGAtBavybk4+/ECNm1n3Yl5N/7Lri/xlp4eXYH67kMweSTuZbZ8AQMS6kZvqZ4LGGYlsbaOqzwByfPI14Pkzt7x6OtHJzuJyYd5fSMTZzFbAbatwVpas9OfTbZH2ftmN64bVoqNFFd0L14v8EwmuEQF9sirXMNixQwTn2zALL4ZoMdrOnOvjg2DnmmLfmbo457YkgcShCaYujQvKQp0dhSvIp1K6XmRGDqO1IwwTFy7ZmvZa+3E8nShf37bXnkMkRQycRwJWPdCn0B7dsRE4NGzc+dp1numT4sM8aGVmIrkUEcm1R2lDhYIPwWHlXI7FCDL72cQOVu0m8LuWB5nqvAfYQvmLEFQ0sFD+5Uz4xp1viQswcuNrzLdEwpFjNQg0x5tI6NZkdC/qBvXeMkkNloqGPNzNrSjjxsSdt+GFRmKC+PzmXjUGqnuC14jJvjsIAHQvhRkJvDnX6olAt69EjDPgwGzlu6wbOpotFUC3mcqHsWdgHWG3xYuOIPxQm57gAw1UQfhw+wU1CndzUVhmFO+MolhbiHGfYOg+JtKHUM+qTHWrjNheRKp0zIFPr2bXeIG4ZKr8JbNTg6ipvP1ykK0zguWBVx9NERsCkm4/qwHbj8Y9LF4iG010bRniOBEotWve/UfSgJhzEM89f/zmVAYDz9x7I4UAGtHMKeC2vXpONcpClHVzbPgj/Stye9akSUNwTcyFSlXnnJ52PAzXR+GLcEFfLVRQaEuhRIdINoGHwpUy5fTPcF5uWVhAbiMwnabBPSpX45kPEca3tbLzwFzQ0S1xvtZojrPh18hMFJDadix+pDDfuy0u/32n09fnarobQWrhNQWjMGrao7B7Gp59zD4/KTrAzBbC4l/tLWxt+pSOCtfFlRd5SaWO9Egjsb/ZVTDl50KzON3SkcgJv7yXWhRr2r7ewkOzd0j3vJJJrDygFJWb8CZuT3R8S1DmO X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB545; 6:aommUEx6yW96aaP1wKh9EGJgHsMzxsDZBmCqnk+g1KXW7Yo+N5ej8x5SgNTidi9hj0nfE/pJZiHyIgAtYW/3egnNaoTurZXPlX/RmafD7O0a7OaNHzLoouQjJcWakOX1DjtsksUjPO5ak3H1Iwc/dApyb7a0l6ypqFyPOlLQeGGf3O1bugam+ecMkhIZKxiU6b6lltFQswH74wyDyhCaNw5IKLvvDxGubZ+HRzuPUqG5lUkhEDnpSmaOq1Mph3xWc7OK+1b+42EwtRpITtkmT5J116ov/k2WX4fdTB3zmsQULsWWWST1ApGolWdUayqeqAd3uorSAq5mLlEnralIpA==; 5:Xr4CdbPKzMB5IxY/lE6YjPODCvZ0fs6YxwRK6v3TZlNP+9IubVA2S3LchuDhL1IFL+0TLS9QMPy9CQDe8XSRoG+utMWkc4CSzgrBeRLVK7JyAinnXrqVxun6FF6evUrGnkIKy/USsV/WNCsFHa8UAQ==; 24:s/3nDqiTPXOhwvfp3VNCw+JAFrCvH5tmx9eJhfPoI++2Lfx4xcmc4Wphtjx2hWeUSruGbPuj4EP2xUgN/gdeOuLKnJIAE0KfnofiFu+KuPA=; 7:MIUKJFlxAQLoCT/EiDgJoirjoSDB2yBLAWM4IsKApTVuWc96LATfHa5sjd29EpdrIpxZoDioJ3qmfCTt9zB84sGNqf8ImPOXmU5hwk+BGuX2wKp+7/faPRLKBEGfIbpwljZhKC/qErXCZUVHxVYTjeMgjB1Y53Uzr2lY+S1fF354Ywf3FgUNkKM03HHZVajKyX4cLhKZGIbMUC6h8I2UIXtEd35p9fyQj53qSOcPhOc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:12.5464 (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: BL2PR03MB545 Subject: [dpdk-dev] [PATCH 06/27] 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 8052d36..67ca718 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -817,13 +817,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 Aug 25 10:49: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: 110990 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp810155qge; Fri, 25 Aug 2017 03:51:36 -0700 (PDT) X-Received: by 10.28.22.69 with SMTP id 66mr1265611wmw.165.1503658296614; Fri, 25 Aug 2017 03:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658296; cv=none; d=google.com; s=arc-20160816; b=oyZhSqMnhXdSs1BWLUkmH7ZQIMP1s7SEQf2zSqkLeNcAUVEcij1ALBAkPca4Mcwvvm lPomCrhfHeg6xCWM000eQMg3r9UzvUNs3z/+rVfo4Hsq6C53cL4K+6fN4zoQCBRcBH/b Hh4oi4opz8MCoOvdKbywn2+RfFZIdVtTti52ud2yZPgiFmye2EDRDQCJ0oTLw9uVMH6I SDIOhqrn2ervt7+UOBnBB1VaYkCyx9H61Gh0ipkU5kJ01tpTPDRn444Xuu5aON8uaOYx qLE/WIHM17kwrS2Y0rQBfSJA/5RomJtzVcJMHYLggdlBeMVZqVbwWXJ4vZuBkIZqe4tK iULA== 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=kq5v9zaZCIAR562B5/TN4cGwFiC5JH8NbNlNw0DFBf4=; b=kKR3h7NCQnpXu/7eM6aQJ+/u6pl34k5EUTiFEWpJYdP5RKnI7BNLNDoOvVKxj8ab4z Kc0vapGzWvd56UlCnYfmJFw7XOSk8NtanAvPducG0MqwrUlBbF+q78UlOMcTrR3izfrN L2zzpJVie3zD6kBoVh3GaNNmPk6C0L9e1ZPd2vLvhE8FK32fi0Bum/iId5Xaemhp1fjV 7tPZPXZUzJX1Em0AMf99mQqBczl0A+eSfrMSjzb57ov5NbE4b15z5tO3J9cjpLvGuGc2 5EtE9WfnmeuGXfkgOO+UV5wIbfwWYI8mYhnZnSMmi6sxxApOkovPhi/5EZK95Hk+Iqv6 rQmQ== 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 e24si712294wre.205.2017.08.25.03.51.36; Fri, 25 Aug 2017 03:51:36 -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 6E065913D; Fri, 25 Aug 2017 12:50:21 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) by dpdk.org (Postfix) with ESMTP id 9A5B7910B for ; Fri, 25 Aug 2017 12:50:16 +0200 (CEST) Received: from CY4PR03CA0092.namprd03.prod.outlook.com (10.171.242.161) by CO2PR03MB2261.namprd03.prod.outlook.com (10.166.92.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:15 +0000 Received: from BN1AFFO11FD044.protection.gbl (2a01:111:f400:7c10::143) by CY4PR03CA0092.outlook.office365.com (2603:10b6:910:4d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BN1AFFO11FD044.mail.protection.outlook.com (10.58.52.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:14 +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 v7PAnw6B032070; Fri, 25 Aug 2017 03:50:12 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:23 +0530 Message-ID: <1503658183-4078-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318145681188; (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)(498600001)(86362001)(76176999)(50986999)(104016004)(105606002)(189998001)(106466001)(53936002)(2351001)(36756003)(68736007)(33646002)(54906002)(85426001)(110136004)(77096006)(5003940100001)(47776003)(626005)(2950100002)(6666003)(6916009)(4326008)(97736004)(2906002)(305945005)(50466002)(8936002)(81156014)(8676002)(356003)(81166006)(50226002)(5660300001)(48376002)(8656003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2261; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD044; 1:x9vMs9Dl/c7QC5bCwUx196H8gPg2h+wsnEKXL49aY9SjW2Tz4xnLKqQArD3vPylPLM47adAJ8vxiYdBrI+jZzH98rlROC+N+QeimgcGygeXeL7ybvBzQS5vibtICqKQZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 946ffb34-48c3-4da5-6724-08d4eba71123 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:CO2PR03MB2261; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2261; 3:eyRoSVXsqHa329LKlHpROflriG3fEtldBW1bXgAS4nukXmnUKr2kQPz8AqEf9WW98KBv4Tqx2c6OS5xXlR7iUPvrEbaEIM7jhBgGVCWDyuYycE/CUs78OnvxruGolqA4K1LXpG1tAtuSVMDizUnzsRwi5kg6ZEFvzRA+sAwz3OFhTldZoQGRmeQLpr5jWwzqaD5cd3TkQ+d42Rk3OCegvwmtqcDIF87Jw6XgevDeldRiI7W+h3O846/TLfanXoZfUqNySs33+PeJZDjaChZYE1LQwKVW8ZIqO0A8n9VLw4MrlQM96tt4oBZfCclt1pc7bXqEMSQj3ocZ9HBH/xTysUqcoMU8AR4jFXKDjImx2zk=; 25:L1AdwmAHFozCp/PZZPQGNQqkVASnPR2xSX+yi29jmaV/BDEN9YnDh5Z1OcGTPuJld1Cy8YcFdTV7Y3NauD+TqSbT2Twhz8l7LmqReuJkHS+pZR12AD4/Wy0yogNYiMsO8DcIypj2TNPqtg5JenRDsDeYJx+zJXrBzIso8CJ/yYHeUj1LD60r7911aPNgZ7MhvIfPF8PFYkXxiIS4t+Ridzg4FOVOn7W0uVU2PgOI02jzAW81c2PjRg/rivImROdtXGj8Egm8cISKCA8L5DnmlTKwvsd5tLukOj1BdjY45tZVTM4B2YO+yHpNXsIrXtsUPhd6kgPU/ZWeFLlNeT4C+A== X-MS-TrafficTypeDiagnostic: CO2PR03MB2261: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2261; 31:n33lWeeMDVWh49h4q2AyO/6qxnU/KkcCL04Uhdkr8jDVBBYY5w9usn/dfon4cyzqz52CzU5fuRBhIrAbZZHsQ2utYWcuQd1EaIAw60O0/mqCNLC2FjWQAXX1hn0y0HDb0r3KS6nD/cZxLaF0huLCSoYPicKO1LITGVnt0W0NHWPvkwCeNbXePhsehPN1Q3T10qedR+dCugy4S+Bzkt6TQq4hcTyrhnGiQj0EeIoY6sE=; 4:KzQmsbCtehVsnyEE//vjgh3URpdiQOm/sCgZY4FaEewT/z+vwfJaR9esuKfJaQTHX9sqInwKJRS+snmQ7wXHrwrtZXlCSerGF+c7H19FQMOeRGBTHKIOVZ9Hj2NhDzrTZWnpRUVpIOY8rTUgZyB0HVeFpMALYKRc8f+fYQ9Uxmv9wA51nCDh/MT2IniBINUSOwwF+aTSK62zI2+JhcNcwgCpbOBA2Hm1krjQp5ZYwK5lNDDVizN26QwD+NTpdkrqS7ziGfkt8z20divyQrpZdUgrkUR1zETIrZ+NUftOMXo= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(13018025)(13016025)(5005006)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2261; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2261; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2261; 23:hJR5LND0hWXSI6CnyvvMcqhEtkQNSa9PChb7oT8jG?= V5G/z2GOScfrlBTCvru8LeZnr4EVC4ya7Nc0YGb9FXJGD7+zqIguX4ktmFs6NqdFU1fAbP6tJOYfJ1JZE54fTSWAg1K7FDukpKeJzjygZzfNYTQSoG0fcMlujULkHSJrn+TGwr0NgV+501afBBFR1IF64EkzN/BwZ7fzbU+Bi4TzVAwY9biU27OMlNq/SnUPHJmzHKOI0AoBK8iK/C+izCB3TzLnJd7ljSAoQzkryD+JD3xBZ090j4nhyaxIDcBLFxNpyLOBmsYuvBnfw2GBMXNJO9Pl7Lx9K1Fh9L8wJI6xFo4ErNJjfnN37doT/8j4ZG4JbwZU8koKx1m9bbKscq+QTx0cFDdpezzaGki7ts2h46uvaU0f8KUvrvKoY+pkFEChWCEay3roY6QaLGHbO/FH04C9V5VWw9tQjFCQSaQML7N2+woq3ZvzZDcqP/lZcYii8jc8xMLAllmvMTxpaFwQrgfyT5aYbZo551o/ukygE8oROlnbrPJ8nsDSi6z5L6ZjIuImHz2zP6JvyLRO13/GkmyKwV6FP9gVrUBkiS6PLR1R+aMsN56//pRUlE+A5X2uoaIFh0YbM/U7bb9/jZJOqJHo7hLSk5+B913gqaB9Adg9Roz1PN3OBHqw/scTh2L4YklA/T9YzpWi5/8CLF1x155JTxRrIIYPLpGqSvbT69DxMMzaVYx2R5DL/InomAu6e481iTEPrTHvmRR5/DCNzgT7NpBooi4qHkjDzMjy7QktLycM9x104591eJEbqcGrGaYPEUQw8vy3omGRP6tyrqzJ78jt585YAZXR8nY9Ju2ynJE1PRB7uHafkWow/z6RuAGJ2OIdgHdNSAoJVZSKPMEHcU9E30UqXSZ8qIhimZvd+jG5/ZMdFcvzE+g5p843uv1mSlZVPNDOwhxxe4dZMVaxR1haac9ugbHeDlNKzkzkQBSDEAkd2CO2VpA+3WmMyTx+Y6dmnUQwNLKXLAJ1CofS8Kz1EHSaG12JP7unQ5+o9B/6iFKXnbwvaj8KS6/IPT/QB+OIkN7x+D5s24xmBN9/Aljt938kKDYYj2HNRxt2XVdZE1w77GC/nUxRfrcTFYQuaxarZGfYt7qjB2U X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2261; 6:qhHFpTKz1BhM8MY0jvFpVc0SYlTSqktOLHYB+3TZn1PpvKYgk06m8OQw/AyU2bxW+1OZH/PvSu3MTrmjbUv+MlIVMMQ2e+aFnE/8ki0HnUBOPmn60AVPj9u7zSWlwtVJOBUVW1ZMQM14669bVtuglvC8CZ7Jieme4LfaoZ2H0DhPBAaqrN+7zga2qaYjQDAvmyyUl3YQAIv7cIUq6paIlWRxx+be1HfDSVrNb5xPOE/bAHF30oaP4scGk9jjmqXvKSr6QFqHyNbaTl2lmU6Rbc+co4utH8pSGtnASBnKb1XhiJr2JMWh1HUnkpIyTwmUvWFLwSYPLwoR5g7TBgekcQ==; 5:i/KXlbEQMo4k87kd9Tdwcksd2OjdBlW1n0r/WkaOGkj4isI2lxIHbVPpC4VIM/5H6Cnw2d7eO5Xr1T9UglQ7WvU+lxLsVgOzNya+zyr6LiIMsxP0ua2LffshBghlIA3r82YNsPKGlze7RXfdd3DXjA==; 24:6n2U88y+HiwYPdk0kobgL3xXrtiOeh1cJud58hxqlIIYFdjKljdBXRuRsmwtbk3gJEEhKyyH8CZP0appH7nwa2RZNX3oaJXWOkIoeLFOQ8I=; 7:za2UDrTgH95VQGeFI7b/FVS73oqgvcOjoZSCI19wo+xCdJ2NZEoS/F9mc2UfDhVADHmJc2Cfsxd6FQc/M32etkO0UmehDb10MOIbyBsgJT6RcUbkh5MFnlQecxc1eFRe1G1rZW2Xr9iw9ZYQw+XsKlDJ5bHMaMFMEwIiIIJYpdVOC7/Plr/tU/2TW63FiTunkUFD71DdBQZEXEBeiZMSTPuGojfhnJfg4X09qe28vuc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:14.3965 (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: CO2PR03MB2261 Subject: [dpdk-dev] [PATCH 07/27] 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 | 187 +------------------------------ drivers/bus/fslmc/qbman/qbman_private.h | 2 +- 2 files changed, 3 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..528441f 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) @@ -128,8 +112,6 @@ static inline void out_be32(volatile void *__p, u32 val) #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 +129,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 +168,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 Aug 25 10:49: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: 110991 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp810448qge; Fri, 25 Aug 2017 03:51:52 -0700 (PDT) X-Received: by 10.28.214.134 with SMTP id n128mr1228994wmg.92.1503658312665; Fri, 25 Aug 2017 03:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658312; cv=none; d=google.com; s=arc-20160816; b=pPfC2sPrsfasHMVRvE6iPD/oKkW/NQsDrVoA0txPMch9etHecbpKqjTvz6yVcMJcXm f7cW8HGrsp0k7d3x8LbZrcgMq3ZaLN3teWmJeCsSDNm+jtiz07q7JREAgPbpgsbRxYig 7AgYuFeRjkhFu2+3peBGINWq1sWb8nsV/mm82Cd+T11iDjJjHn+TI2GFmxTeXO54G/Fa YRdwRGYWivyYVA4MV91hjDaUiqs8Yg8uCWir4rZOF4OEmYHwUKGG9gGQDfI9dm6Fq8Or xEZSg4cQeS/iLzJnE7bV+owcWGQ/kbB9TWpjbq8DuWsWErXQ5tSiX1XhVZFRWNN4k/6i yFsw== 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=Zj/T0Hzbii1f4GxDaaf7VHufoWBbEDXRq+ym+DhsLGE=; b=bItWt6rOKLGTCOsIPlsPG7Z8Z5akoc4SUwJB+tvoI4QAtKSZOD0SyrnULyPZYG2UIT nDXeNFAh5lheVd9v9mD8ZDWHtu3fVbCGra4gr6/zBVag3dTcv4ERZCasgRsts8qMl8pE pduVZ7db9D4HSwmQFxWaPXvxxabcatKqag/+XqRseSZZ8ZrX3vDeM9qCZpkzVaglSCh3 Ea3384zWjNP/Imb6it7HyJ6V1gdcOehMfV314IO5VVwxtKpTPLVHA9FEPnbgeNhR2h0O ml+R96ZHhuW37EqGuR32oNvZJdOwQfDhWy9S90zoOeJUmmlyZSAHO+8yoIJZAxGLAupc fVHw== 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 e191si1036880wmg.56.2017.08.25.03.51.52; Fri, 25 Aug 2017 03:51:52 -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 9D4B59161; Fri, 25 Aug 2017 12:50:22 +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 A86E790F4 for ; Fri, 25 Aug 2017 12:50:18 +0200 (CEST) Received: from MWHPR03CA0015.namprd03.prod.outlook.com (2603:10b6:300:117::25) 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.1.1385.9; Fri, 25 Aug 2017 10:50:17 +0000 Received: from BL2FFO11FD021.protection.gbl (2a01:111:f400:7c09::112) by MWHPR03CA0015.outlook.office365.com (2603:10b6:300:117::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BL2FFO11FD021.mail.protection.outlook.com (10.173.161.100) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:16 +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 v7PAnw6C032070; Fri, 25 Aug 2017 03:50:14 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:24 +0530 Message-ID: <1503658183-4078-9-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318163216034; (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)(81156014)(86362001)(81166006)(50466002)(8676002)(626005)(4326008)(8936002)(36756003)(97736004)(104016004)(48376002)(5003940100001)(85426001)(8656003)(356003)(50226002)(305945005)(2906002)(5660300001)(110136004)(68736007)(33646002)(6666003)(6916009)(2351001)(2950100002)(50986999)(189998001)(53936002)(105606002)(76176999)(77096006)(54906002)(498600001)(47776003)(106466001)(183404003)(309714004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2269; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD021; 1:Eow02qI8Soh/LCcRwiLaH/f2hb6AkR4yXyy80y5HUNn1fU8ESJmO/ZtsF8b3s9lWlvXS3+P3PJICdzR3xJ08/qvKqqoNVbQofFImI2AWjbAdfUA90DASb/Qhb6t3/aIJ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e48131c-0702-4b54-f6a2-08d4eba7122e 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:RFtHkuYYXfa3r5syUhdh7/ypKSmyyhPj9D5VDlUyidIbXHl+XDjfFThgi3wMhAJYMHJla/piAuMpj0VS1uFzfpiUAzLo7olUlGrWAaOINHc/955eTJNpzS3+pKiNd0EAa0OMPgjKAsft2dCYyPPBK/9batHSww/T1SvjY5sguMdVCnlEwpyCUFIpJW6uHH0oAT0FS8Nlb/S32Tdz6uUKVCwCp+KaLPsc40uHnWdwdtFe1l7fQJFQ7wSYEsnkXCVX+FLA7Ja5AdrK+ELQob/lUQq6G07oEK6JLPhTIf7ckthDrJOcR6syqP9YBYMyL1GI5MKk9Y1nF5XR0pRvG5psIUKVv8cQM/2e90Gd/UR+b0E=; 25:PNDUEbC07cXSjroT/F6qKsCP732jnaZ7dEurO7j+CN4lnaUNqa7RSvg57Yk8yMSeh2sX36bUcG1+qGS2pvWPQ/UBIRcvQG5o0LI+GcgK4MueT3+dE9dCLlaQ5oOgMRS0aZKrCTG5TqVJSJza+iw1hZYSskwkoOTTww49cpsYNHVxobyG2LTVUG9Bj9Z6ffYGFv2E7Hoj1ra8w3P9NN0UiDZLCTUDhy0ITW2Y88M+HJWA1FfqXDUy7zk6KRXqP8gGD3gtyvELVRNx4e8JGCaF8jDl1WbQcD1vGJnycElkqIm3Pes29Tb46LL6zvS80pszSFSLx3StijsrY1uuAXXsJA== X-MS-TrafficTypeDiagnostic: SN2PR03MB2269: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 31:cwPh+AMkuXPfULv6YY+ca9+bvA3hO8t594gt1G810tO/tGIz1/Ki14obI1l5kh6uERRqJU5n0u3VduO6yGOPdhrXOgRMQt5Di2j2M4ITlfwSYBNNXE906rpwY7kHapmY3RNIq4Y7rosPE9nndlNPIB9ToTh/3hICkYlQz0ijkLV8GOG/iAN3G/3bcoi73S9uI4yR0lHUUg0wZ/z0U/EQfdHbi2uucQ/sp+wT36t8p5c=; 4:gscH9qsTOb+Wea7RBKMeTpjRLwG/4xLL7iVmh1QXIjJxj/3jIPOaFvaQo3kJ+NXSzww5RxinQfZdW1J8c+CrOIdwkqJ3Vvl5PYDWl2HeEJou2CVOn4PlMmaYhaeDIBIu1z/5CC5lUqUjJUSoWsWzmj4/TUtTgnzgHAA/YBJoTA63Jud3QPDajsoSdDKPeShKnoZIA9ATAvvtYIm7fsE1jPmtpe8UhMlBcIKIyFd6Ibjebkg0l0oJPWGOoGahAPmbkLKs3wNwa9ZPFuKUhspSJo0/kpaUZJ1FvQJqeRre6Y+T67z6HfUSecKN1MkrpmPdn7cdio09OmMSXj2bM7T3Dg== 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)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(20161123565025)(20161123559100)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123563025)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2269; 23:Mj7wy2zEdHfk13dFCqLfDwqmFbCRYhK0smT5bQFlp?= 7XR18cg5nO32DwUYvVlyNhI07QOrjW4Jel2PLEZn9oy0iL9GW7B8tc5d4VdNozMtTWUBBl/Ws3TxvTCzYgXapcTGnohsUO1Pd6Op9ynd121ToBKmaS9m49vP8+O+/ENBYFhWfRfWlmr5RIF8p/HI/DiKAKr29BK5sPvYAoAcCG7r7w6BKqf3ZFsCZ53bNJuopw5PWZqcJVxmcHQ+0ibOCpTxbW4O5rWYoDnoA+5Qlf7Xb2DpJcUffnVlqYskr5azkn3GYj2TLYRbrtLYrv9ztf63dzi1Ao4ODxKNfSG3POpNskYTAa5nZxZmx5OySn43QvcUJD4bUvGMNXKvsnIMLxUpXlOlLEnwjbYp1MPuCA2X5UdzlNB4bGawNpenlM8tO7ZD7Z51b44Bc0n9qzKJ+jStGWJzCoZEo11Eo8wXMhfyK0HEvXre3QbCqi/YH3G2x9s44nGIGm2faWUwq6V/6WrUp0ADmuZP8Gdk/JKsk9wz+SGi4nkshr8KSwM9eBYziPAfdOko0VwSMtIHgFxQWGVG9DRxgjT8R1FtlySNwpGc68lwpxnOEL3LHtfdDp7VLOKUHqF60fIvsVjaWINWtJh4Fx9OFpsUGDLtoxOAYG5gy0GOSME28doChroCatCVq22CqA4SfNVTAAuh6NslEzWVi0dHPz81HmqKMVOnD0wDT0h9fLEmeaa0S/7lLJ3kBRZGQTujtG2xlWkeTAhTIIgOBSe1Nk71Ay0CXEmGqvG+n06ZYGvEzNE37iIZX8d/YFCZx8zeAN4mYYvEPSYLrALrlPd3Nh8uQrfUsRDnyobTf6Op5O+C31TF04+3C0rUX0DBrsUiJUCZ0w2aApYXBaz/mwEdO64X4xdg3UfiP1JbGnsnhMPAmEeZ8RnulsPpernXnbQoG2h1n9WcmWIHke4ZluHOb8P3kIjElQWUG9w1DG+JA1x1ijAvqGPfU/9q+hSoJkLLNM++zeu/7tF48UMNrgxTnFymvqMJ/+jcu8Nxpb5upByJ2UihUH4JGstH5A2dEqbkwzCQZfJnelHXmQ65OuzSX+IV9cyUOcBJOgc29b4ZByoqCn2Hd08bV/s3OmyFEtAj+RyRbecPRcfD/L7x8D4X/ds+9Yf4rU+fOMdPB5RTums8QefP6404VeGDF8KTxP1r1jRYoq+3zgabk5d X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2269; 6:b3clO8BNmo0RqbPpofVc51PaAfj1eB3z4O/PKZXiQ/XmJ/0O7lxf4gc1YfXxPKpzCqcRvzIZYMTh0pS+nQfMdf6dQ+Ck0Iktc8leuJeucByiQMllbKmhWFCdiSZBC84FWJAlexAHNrzLeUHJBBVdqPeRfyzlH2V2vIPraKqErtgezQXUYRgaPu/9vKixkDYdqzrjMN2O7TUF4DLYjJ9SleMaeWNpXmmca5+ksv2m2uFw92g95VkWK+IjaL/wTxpDyafd74mfFY5cCMwuhcB6IE49pWFHBq0F7zWCyosghaNSjOMXZOcQ9ZZqBnCP2xcdIr/frx/AoggWU8LODM+yVw==; 5:Sqi8PfL3356hVqCgGtn9tDoqJqxuv41629FGDVY0RFWVAa0A93r/JwR5HURenS5OLTGT7/sV0ZG0p4BPUuHUjv7VLASPrTlT2Ui2PLUUoV/tyqtzeUu79zXJL5d1sKCqOemZCeGs2zl2BFBDy4RdVA==; 24:rhYnvaUdOIiFJGwk1KDKEYOfpG5xfc7bTC2OH1xyDWHS9DzhyGXdZraXpamCq3rRtH5mi0zy2oqLAm9tKG7qyE/er0JNHX3n4sUHP1bJsnE=; 7:UljowDkH74w+FQkEBBlOsY37aV7KDgzeZMv60dqY3Qv2zB+pE04EbhV0SRQzk3JmSRcmUyokU87bN+5cbmce7U3B+fa1GWkveT6MENCbC8wExrEOiI02vNz2j1I7/QZWcT/8qotwNUhYHgsQhZVo2an9POwbD1PAgo1vlineUn2C9+3Gcym3kdGK9hMfP+mXgbIC8NatPWGGgZ1QXWb5w9EjQF7a3J33XSu0fLqek7s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:16.1500 (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 08/27] 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 | 88 ++-------- 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, 103 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 528441f..9a650aa 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...) \ @@ -108,11 +67,12 @@ 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 CONFIG_BUGON #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__) { \ @@ -121,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 Aug 25 10:49: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: 110992 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp810783qge; Fri, 25 Aug 2017 03:52:10 -0700 (PDT) X-Received: by 10.223.170.2 with SMTP id p2mr5907285wrd.22.1503658329903; Fri, 25 Aug 2017 03:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658329; cv=none; d=google.com; s=arc-20160816; b=LhtJ7juu55H9uNP3Q7NfGjV55ywvCLRZvkxA2++Ic2thCS5edMdFKRAEyeAUlt+bm9 XOgt8z2K9bUVLKCcCaN4odtSc9MwIr2h4XfhoUb5xNV58DE9buOsGdPm37gL8YhJ5za/ dWCgwaidQa37p/IrTgJ3fPMvlYGbxFBr/kRINQeMVzNtL64nCGO3qC+E5/YkWLipr7Sc qpvQmplVkDi0hok5Y2bR/uhrNcTGZ53/8SuD5jp1V0KBv0fj7/dLh296xd1Zd1xGgxEU mVU8+RsoaUf5xLyzXZPzVbTwAEJDBGjRI6cefQzXKRr47jiBMPSjsmOvq8jEPeWvAJrD Gfgg== 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=Kr6s5UzINbGnu8d/G5LFbv94tj72CZWLO6PVqJjIAXaI716CIbL/8znglK8u2fAoap 4d8W1Hl78pOzilGuIwa3pIsDg7osK6k9f4snsIVBH+qyMlgUdO/EMa4eZT3VeadNrmj7 79bERPRDL3HTjBnMdCaqz300vxvHrbqeqkonevMge8stixGu6x1G1pBe+Hj/0OahPSGs GePICEIZVqR/unt8ZrALc80S+R8tHIx1nTNCiMRLfomYu//yQLhF5evXEdgKzdJ8M31w nPgEAuILp3+E1Xw7aPTp6RSedpXYuOy0t2CXEmya0O0r7z38CqqUtN6CHLYQEPY031oD nEKw== 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 m70si1023054wmc.120.2017.08.25.03.52.09; Fri, 25 Aug 2017 03:52:09 -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 7BEBD9179; Fri, 25 Aug 2017 12:50:25 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0077.outbound.protection.outlook.com [104.47.32.77]) by dpdk.org (Postfix) with ESMTP id 7C747915B for ; Fri, 25 Aug 2017 12:50:22 +0200 (CEST) Received: from BN3PR03CA0063.namprd03.prod.outlook.com (10.167.1.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.1.1362.18; Fri, 25 Aug 2017 10:50:19 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::196) by BN3PR03CA0063.outlook.office365.com (2a01:111:e400:7a4d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:18 +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 v7PAnw6D032070; Fri, 25 Aug 2017 03:50:16 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:25 +0530 Message-ID: <1503658183-4078-10-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318186296283; (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)(4326008)(47776003)(53946003)(50986999)(76176999)(626005)(15650500001)(105606002)(106466001)(2351001)(8656003)(6916009)(77096006)(189998001)(5003940100001)(104016004)(2906002)(2950100002)(48376002)(68736007)(6666003)(97736004)(81166006)(50466002)(53936002)(8676002)(356003)(36756003)(560934005)(498600001)(85426001)(81156014)(54906002)(16200700003)(5660300001)(86362001)(305945005)(50226002)(575784001)(8936002)(110136004)(559001)(579004)(569006); 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; BY2FFO11FD014; 1:+AKygtY0AvqcUK3ojoI7WspXwGuAZY78SJqoqoAmONaiCIm+Mu0PO0ZoCW9QruLo6qZPOMCytpyw/+L4Ab5h7tDXCPwVMY8lX3KJQk4RRIIM71naFXYhSH6D9dwOzEcw MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39d29db3-97b7-42f4-23db-08d4eba7138f 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:WrHrfEyFVEiRKnV4rrfNrc8Mi7FsSiyKSACBR9VBBM5gn47y/2noPuFkixcyqzSx+1wERsvIdlBJdBWhOxKSlPUivqa1/7zrxPx8EOZv5CsMlufGfC+HCTK3wUMvD+gmH5o1cs44L5DcKtKJ4zWNCL9g4P56Ke1ox8V6H5YX8RFd5TtPU0SCYBE1iXCJ58hxMkwvWqdQ+T2R9iOOUGl25XqVndUYaNpG6pw51YvmUYfwWj6qQvIaJVk5raslvWNBY093lM2aDO3Q0nqFkzxlaxQI37Ud+B/BBGvuKQtcSIsA0xE7/Vj098PNDkPuSL5LTcJsvYH+5fCHcGqb3GMlMDMrsa/J1PUJqrzYPRAFYZE=; 25:GTLf/MfkN8B8Nd3c9ptn17g4vb+qajpZjJA/adCRftCsfEJIuLs6rxa47d0VXj0SrI2EwKZX3E0lNjNgBKX3/KNWcMZbubo7iCWB4rI7om9qcYSTz7oZXBmGqylfhst821ydOmozQ+fN7qo8Sr4k/NaFMB1boBowzGpVGiwItlOGG+6eNUqFrYqSo/HmfffUD+J8MgsXwDgvm4diig/TmWrdwVrEKjenCKFuAISge8rKGUMR5+t/wnpzfE2HElIGlH+Mu9YkQKHp9MSKJOxR8vjr0oVwi074tEY20ax60kyPpdNx0i5sRlHf4hnkWzvXgiqVQwq28ksL2BzBYZgLUA== X-MS-TrafficTypeDiagnostic: CY1PR03MB2265: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 31:4zlh91jAV5dURqaXWYXYy7Dqtae9y1V+2PAYL6FCc8iE9RbMaboDU6xoURm9D8kA1YPeV3s49T2AGpnenzyYQRm1oUA5wSBOLd4hLMBc9bfGXdkDK8dflFCwgE6NusZVogQDSmXcR/lr7UTwQEnkhP5cf0f213PTt9rUE2mlOJampEWApP2QAvWdaLcl0TI3zLkRFndnnPnkjWk/p0MDC59MSsh9HWTeqM4dsP0C3bA=; 4:Q3ngmfg3Fa4ljBNquvvqNoWv/n2D2XjgFLhedhwOqDPzJbklmf1RsYyo4KfvU0YE0ERRvQKqApMq/mnZgH3i98iKU07gdqnP3kjAc1HeZjkavh05pHIbDmPmBMMuQn1cSjnj+xYdkWyDaFcbHv/iaBNlXg/mmPNwsfe2zAiDMjR3mY/51FsJzhsfVNTXRuHYDZDROnLMNAnIxQiQwZ4NQF3eGJdULEzdJE1/erBonQSVk/vScaGMKNUm6vzddSMKd/HvnkvaSKpUpuDakxR2mb6msKl4gdSRawRRLsRh5qsXY5VmP+74fDy7nun+y6Nxr5Jnh7JS4srofZ8XAqxl95u8toy14FXSllfX1e3xuSarPn56zRn2GUb25EhoNGF2 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)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123561025)(20161123565025)(20161123559100)(20161123563025)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2265; 23:YSqvo5Az85s6tANmEO3V807OZCQ2M19KFUtoJyOof?= G0yKDkz/avMpycIbt3xiNw8Rl+n7+z/vrxV5n4GJCRF51G5FT8gms/SOE1fKrh8A00Bzs8bf6NoyY9D4CjXpRSOvv9KjZf1MgG40qvNupR0RLs4XgucY0z2gIXEkznoGx3qh6wjdDuOtkTtoe1FmKyfidBdZL1hNaqjGD/twMmyxqcJwAhDIX5x27wgoUqGotkAP4U89eXUujl70Qe5rsMjB4HrhZsujCizwxS4AnO0GIwwRnDUeY0aqOwBgQFSJJn8rSiOR2GYbHj6cDbNOLOS9KMRx3W9Aw6cTRmusHdWF+/c9UbK5wInGxnRS0ZDU1ZEJRn7kjcmCvUMH9nUbDYLCpXTRW0vNQJesDtyo5sBd6OoUYj2XhkjmYgoceLKrxWzoISddAdtzUQF5oX0l1wBBIOLv5pvr+g/diwCl7iLzYcA2TVn0m0Fpls/xJUxs94eyrarkGuUAK86gScgXWZlcXL2ureYpYKjxgC1EMo97VFES1P4zEx5KJ50cNKzYeJG5fRVRtuGXkLLEX7DVEohjrBgaXHibamga/5N0jW2V7XXO2CKZXJY3D2uS7Q9sSdyR51fwe/lCa5mMFVyEmhbkHCEQceNiPWobCW8z6jAfxPmrG8RyNAPqJRtdxyG+nBnZwj8mmkF+KJiDfbXEIeq2kQpR8tjxUSPpAY0jMSDdVp8mFqsNd5ZIPPuc8hiuaqjDNocGB4pq9QSHNBj3etHCY/p90ZTQdg7K0hvAika5Q+ttYBJtbONmLADo9bNo0adRE5wObGWPZzcLivHVV41dzdBhfIrEFav1rVrT3kAkO2mZuwTfHfo5Y1emq7ZEgbXmGGY1Ob/u2YfVlJZR9PI5eL0FCKSIhP60dEzAzAhUI8lquH0qFDMraFgFU6BznL3Az9X0aOJeBdtOga0I2QgWfcAVhao1NB+s/Q911XUkGP93J3/IQ/svZ3JSBEXUme62oasqNV9wrUDNm5A25YGtK+5+WrPzAB838S+vF41uRo7rd382t3uD8I4cxA2UwsF9/M/Gwbipg9jpT3an3+uNTLGUQ4iMad+ieEJqJ/i4BwNYYefrKh2tgwIMvHcVPTevH31NEEPQlkgzpGwv92Unz2nlRruMjvczaqVCB+Wd1ALI7fWfTy3jkfz48S52KkGoIZLpe3zi08nCYh/jbR9/2h3o8+DsX7XZauExzLbNbcadFBKqWMjsLe4TfbmzKfola72hmhRToG/FuvK+NtHCnV5NKGXJ8qNq8mbTjBQ4TF3/1GIqDFnsk7i35own4I= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 6:p6Q6xOh3hrUg97hNcgeWhyLAWYiNhoVA6Q/7WvY/X7uXxHhYRoAtmxli0NUhweS0fE948PcurFBhIg9Tx8fVchzNaDPuXL5UhutqXwtxgybBpeKYwoto3mPn29Cqnj0sRSurn2xy1u+uYG3dWQWJNaRrAKUdJere1iXFdT2sozX90d8ySd6lYztw+T9I0mYKZ++bE2FQGZlbUk+sJiFItgrkoX+9AymdSUNOBooCjvvBr8cYKacOq0i+80CDPT2XzxeQ/vSWjXuVEtIXvrxtfoLyKpbHxgnVW1aclP0Nzd+o1O1L/IOTbNTfSLufWja4oIy2HQCoh8iRDwZXhg15Uw==; 5:jPHO7gNfHxr5D1tEh6j6pVQ352a3uZsYwlW6jGgloWT+ItukT+jxU2ZWthuIc6VD4Iw3ElLVBQH+VfDudDEVEHXmNvT+ovp75YH/BP72lm+Ub16i3F+RXsLrAlSNmAotYq1YpVp9+vOewKjjDzHclA==; 24:9+52NNDWKXlehHqV4ALm/IVz4buZY2NxUIa3dcgVWbgBvDOuTwhMPVt3qCjB9GuvcOpDIjOUh8ssMt37NNSkqRQTFfYicjscjHUkYAUNxg8=; 7:32M91U5zyaNBfO5w91Us1Tre6w2YYcLMdFDcQHeZ9LzFzfYciuU1C8NiWRcuDUDHyqnJ+ULFXUMaaOEyVLzrVT9htvHjcBya0bOc0Q0h7y72lgNRhuGmxvThzkrn8UNbsq+9pSrip3FyVgeDakBkBVlPGvSPLUu1mZlrHNgCbraTVggexSlh/895bBGWJoiuPlw7EBF3kDi6OKs0MZkfVCvpEjnB1ccHEVG9a/3ppg0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:18.4424 (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 09/27] 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 Aug 25 10:49: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: 110993 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp811011qge; Fri, 25 Aug 2017 03:52:24 -0700 (PDT) X-Received: by 10.28.66.157 with SMTP id k29mr989297wmi.19.1503658344536; Fri, 25 Aug 2017 03:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658344; cv=none; d=google.com; s=arc-20160816; b=pYy+FTblkEY+Yi6K1bpyix7rLq1TNk0sxMPhP+snGX4Trm5EpwDuipK2iJclEkcbG4 CgB3T9IfAa8em+fLmlMm54f4K/tCrwSXjn5l6SyhQxUefYawmkSDsjwxYZFaBh7Jj9gx bfizYj7S2cSk211LWyhs0ybNZCTHF/qAW5YnYp/7lxqZSokIKuvaYlFPteHxSd+QPg6u 5xwZZ9R3kkTqxwJAxisJqmnWn2dYBBshGN3YB+ECUvISjS6ug4NOSlFEzkB+xbd+w8TC LURhWpxsX841TOkllPABpPCe+b7r0hLTKHdTP7YIVI/Ry7MWMp9VovdyaI2j1vqjDaP9 fK8Q== 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=Zhx54GtNaKJdz9OnLEvo4cLKOJgtCjOia36GVcYCDtOMCDFQCIKJGG3+wd4Wl8dtqf OgqpFv7UynWvkZtnUhXzsJYv4vWyJTRDFZwPXC6ZeagEjo+BHBQ69qGYtOWoG28kPqN4 P6w9ZdVvWqtX4ckYJkFBpz6iItdU9frSGaZEQAhTvtGNPxyV/mDFfEchEBmLxJi+tC5+ SiZq5lcoMsVwefjXbBGfOf9/ytM7AWsvDBJ7PdaUB0lX8Xne4W8TKfT4UJLo/F/LAvPv O99u99mFceE2if4y8KxxjUY4W8wSFILNfeBszZ+EGCxsggp/glV7gnWossjQZKBIS78Q oYDw== 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 p80si1046013wmf.208.2017.08.25.03.52.24; Fri, 25 Aug 2017 03:52:24 -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 28292917F; Fri, 25 Aug 2017 12:50:27 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0055.outbound.protection.outlook.com [104.47.36.55]) by dpdk.org (Postfix) with ESMTP id 268F1916B for ; Fri, 25 Aug 2017 12:50:24 +0200 (CEST) Received: from BN6PR03CA0054.namprd03.prod.outlook.com (10.173.137.16) 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.1.1385.9; Fri, 25 Aug 2017 10:50:20 +0000 Received: from BY2FFO11FD021.protection.gbl (2a01:111:f400:7c0c::125) by BN6PR03CA0054.outlook.office365.com (2603:10b6:404:4c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:20 +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 BY2FFO11FD021.mail.protection.outlook.com (10.1.15.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:20 +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 v7PAnw6E032070; Fri, 25 Aug 2017 03:50:18 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:26 +0530 Message-ID: <1503658183-4078-11-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318205261591; (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)(51234002)(189002)(199003)(48376002)(2351001)(5660300001)(50466002)(97736004)(47776003)(33646002)(68736007)(105606002)(77096006)(104016004)(305945005)(5003940100001)(189998001)(626005)(106466001)(50226002)(356003)(16200700003)(36756003)(5890100001)(8656003)(8676002)(85426001)(53946003)(54906002)(53936002)(86362001)(4326008)(8936002)(6666003)(2906002)(81166006)(498600001)(81156014)(2950100002)(6916009)(15650500001)(110136004)(50986999)(76176999)(2004002)(569006); 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; BY2FFO11FD021; 1:CDAKVMTAcErg5/Rty/DVy5k7vTkaFsvqqQq8Tc6OwJFtFaFRh0v6uUrb5OvKweh3xYF1dMHqLY8+zhrODgVNqRL9UjQn2+4YXivSAWR3ECfxEVs6mezrP27Bnk0gED3J MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ab8f952-f3f3-4656-1ab7-08d4eba7149b 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:FA/KNpkd0Lm0uP2BZ8gAdwwWsiHWNmIX73nSL62/SqFUVWOBz6mKZDrHj3nPgBp0YKHzm8rm7Kwb3BPQjH5IMxtsV8zDyl9qQjgtDtazRM/kNGLu4ey/PusagT22HMJFlAG6NbedYREgHqd2TnXW9nOvJS9q4Uj7mw1KR67/OBS6stuxhfdbysTKamkvkvo0tclzRx25oY4Rf8PXqUfgZt+JWcWXWU3d68xWNg8irO7oZrpvwA9tES3fCnQr0GdhsgYfjkQ/7jzSklblQmaBR6veg0rJdkXSzigpyfzCVfoBXKTyi863Cb5F3sSjzsOtvOKHHtaUS2TRbaTGJtgCGkGKjUkpEPqUnXgmi948syo=; 25:KI65Yozpl7ihxorCbzBrC+ruw+9cS4elaEZeyRknUot9qDvb5H++Dh5qmzBhN9QfbDiTJT02vrA9iwSTVU9M4W0AyEkXKm+YqLmAd/TMrjukPtD+K60AWXYM+9XWLbZFG0cYP8VK0lPO9KbWXOUg14l+a5R39KfGVCWUpogUtcLVP8q0KiDYbLK96zLWZ2DbAZfRPXyKiH+CDR9fnftoz3E11XzC9b/qqqDMYJg/yzEircCaPLsqJk/G/MImY/2XheAltOa6np7FF922hZh3SVBUe8wF+yuoeXcfWqJaj8zAWuZewsFTFRjDEX+V/2YMTrb5vXK4KzOe31K0tcFV5Q== X-MS-TrafficTypeDiagnostic: BN6PR03MB3316: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 31:oIj0kAFBPjfxzV/DLC5MAS+vDkQlIV3eB6jV8/UioLqHpMIZ9DJsOEQDGuDIDuQsZ9iKTVEEE1W2gzbcWCZ9tSfkSPZzFmukLGUMaW2HaatZbtrhDBm1K5L2OT4FTmBC90F+PC0NtHjdVugPuiHsdsvpLJDCHFuhZAxV09+1nueFr3XxS02ZhiDw2pN1p+2lHFTRyGUuzz3SDJZ1bA+R7Uae1/cg8KI3BczFy67Y/K4=; 4:qHcy/YWv6/OggTH+cRQPAQjRRHyGk2OV7jefz/x1vZDS51AnMK1sPwP5IbKDP6gtU7rimLhkHsUDaaWBkabKwG4oaMGHDa1+ER80CrSyx8mJ9HH6//qX64V+4EbuCrIbyTYxOHu1Asfy1yp+8twor4+np/j5FJgA2G95bXWUCCMapjiwETj5xryP9DVGDkPKm7UEonKZpMlV5zlYn26S2twEmT2jD06nlTfNCTt41hgGb5zJMxZ5EqK+WBdtLO585uZDNL/kt9RJANJa79LutUXbWf5nYpKvqDb9IABZzgXGlOQHDci3XqzXfja1V0t3i6DFR4rnZexp2ICoskHavSDhZs9xkNwG6eiq0YnwXTVAFnN/MwQTQdRtDxcKDQLl 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)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123563025)(20161123559100)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB3316; 23:PuGxgU/8CU3ZUasMylOBVvNzFUs9lP38GoZOQMmV2?= 8s/sCwxadIE7ij5oxoLIgDAYyrAcfAr6xxM70GetQ78w62d5UZSz7U9G4bmdPAYaA2lAwUs/J8SMOX/iYPuk32/vkmMaJAjjzuM9WP3oeByoGAW++567/2fZB9rbUhyi/PwKlXH8VYydadi1rXNYQTqpjkZ07jYXJXZ+e48w3fT/tpXSENozmtDrurVLIZooALCcSd+Crcl1v3Mv2wHiUS35/z1E6op/sTrLFqxjefDZYCz7EjCAzdqz5MHIK+4QV9VB4PqywZdhkH7uMkyA/BZ5up5F4BlPkliJfdb0v/gamHwdPBFO8SXmlhgdB6VJZkik1fbRtHSRtKEpEwpkvjLgo0V1l84Zrb6t2IUnKAubWPtkezEiye7ImNMjLuiEqb2wArbDcl1njhOuObGQnsrjWrbXmXLkdhadK9hckGMZuF/m59xhSF63obeF2BVcN3aB8avkylTnGHm6Dw11kyjuOtAJwmwNrcmiXJcwXdXVv0RhuPo/hpQFOKG2tpTm8KHqFJoHANUfFbKNCaAQywWSC+HX96J4nDZpfnfPu59tuagUsAmC0+m+Ff9GbVQHPgwPmucj40tR7If4bEgdBhFDqQ7VVsnLXOi0y104oJ+kjA1oiHbba+9mpG4sjCYKVfJJmhptm0Vk2PDM2GdBK2Qm34d0+XpPXUgW9rW/AKSo9va7p9UmtgAa9NUSSxRuWbktnL5g//R92+spsgJMBV7sffjoOTA4v6D9BcdU+zNNSnPC6PrbIcA6G2Au3aBlytR1Z/wvUJ78vk+KzdDzx8hJIWhDEDJfv6xPAv1ioqyBlDPVBQzTgWPii7Ug8awxM4asO+xHgjFaWhcHHLpI8Ms1czciyjCwhrFw2D7cUzZWV0YPRSAgkITKYhZJ8qa1RmFZs/VuGdvL5K5ixqk5t0h2Tn7u4fFMnLzYB1gahe0RMC/CMSOj6T3shcBtbno1pXft5/RQ7a+Fap8MYwJERBJXRUqqMSaKAoJ68HaXTj/qTT75Ok7kmVkgDVMTFdwEmzzAPyDwVqEVR3Sk5AIwdqRcl3BWq1qEYE7EMdt6rlVCmygbCuk2hxAvbucKMdzuz+VMn/qoRkZYHxkpumGEanq6712lo+ztalj3KIhQGd2fjHiINfN9+BrlxbX1WsQRkX7Ampz1k+e2ZqjbIUWSh9IMuHqYgWqQW8R5kGQgCNuy4fRjP9QuXeH4qY0bHC8oY+XZlj71RxwXeRT2EK50UDL0vDLq41JmjM6T/JQMYdleg== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 6:MvgrxZUpjR3tin220snyUCPLKAqa5NNPvNgW+hbJUN56SrSJqhSeZG4egGtwvR6ubmsvHlwjNncl99NDrCYo05YLg4U1ZfYONPsgol0sQnW/6dfMtfcrr7vSCTdGnNitHqyok0DN3NOkOAmZM59W4c75BG4Fg4bWYq+r62lpJ1+LSYRxRlmSjZrz0NZN5Kl3ThycVbbm5Loun50IOOD+sSLLV4s4wMQD84Zv//ad0TvBnik9r78raS24tw8v+3NRGQniPokqwakAaavpkQhzkjxhIgX0LX5DrZhXf3lodaZnRIvbYz+nY1cSQmtelvA840tFNAMCUElAS3erTCrlpg==; 5:Tt5QytXD2WU/rDoEz/gGQdNnzzVPT1C751N3RowW0g29QaH3Ug6HyhIpkvm9nb0iMVqsPlG9zFQh0CCA13KvIVI2S2CoPJh1iKASzMQLcmzLy9VRc2PtpQPoC5FQO6nvV8W8WogFyfVy1f07YipngA==; 24:5MPCx/DCngHXhiXhwo5GY9d1D/ligdCpaT7Q76KxOVqvNEuYQgLL3npXg7nKSzIq7QdWYJFSrl5d+7zRyH6kKwXuSgewbHmjU4ox3ZLsj3s=; 7:ENBxnp3L47fee3/PUKCGYUTxYWq0Z0OekZQmKqN4MIkQI9wLrAIrjAjKzJnzom+jipwpNyb4Gy0WyB1p1+T/DU5cM5arI8SuPhIRMIeIt+H7xihmkYDRZOO44+et1GdR11eydGy04pVtuZkVPvHH5nRRPv1ksEYhJ0sCG0AIKEaR6IL0dfXqKcUkDOMd/E7yTx4TLTAyvgrwFhsUFTmJd0pka6u2Hd2dUbpKAuB4uzE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:20.1985 (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 10/27] 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 Aug 25 10:49: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: 110994 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp811323qge; Fri, 25 Aug 2017 03:52:40 -0700 (PDT) X-Received: by 10.28.96.66 with SMTP id u63mr1150353wmb.150.1503658360065; Fri, 25 Aug 2017 03:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658360; cv=none; d=google.com; s=arc-20160816; b=MtMbcDKP3fk28fiie15wZYMi7ZXAQa+eqSNDuQKSHfWFc/84ohBOWHCvomeDixq9hs YIpStLSZSOtp61wFAnqMz0P8NL3g+qTw1B14qSPo+82Bl1vIpYNA1bSOFq+tVvEI2PK5 tC6M1C2DravikvcQVcfOfivMQNtI3YKvic0P88BZfuigRyigCmhqcflnXzG2QrAU/GDD BDjo/1DFoxtKVw7Hx2c10OWaa3h3fYiZE+vz7DHUInxX6GXo81t70sY8jWsAlEF6RdA5 tS56tYVccWWxZfSuo3sXIKfW+rU8nOyKf50SaS5tiyLDH4BLrvQfXou8QhiC3gxq9xD1 VbkA== 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=emVuUwxjygulwfQtVKgp1aNeAkaoqsC2uJIhtGP1ebogEszoN8JgPQH1WgaozROK1P XS1zvWmqGk/0U6zztktHdFBfuagrn3Ky6/ALyciIof0MDQTqBu6REf2k7FcPmGkFlLwk ZUuZTpXU2XODfKs8qKjVL7p0CLBVyhMy+uTz8lO6eEUNeBB3UyWRZ8eWji0z6LyPwad6 W01LfMhVnXx8Vtj5l5LDrWRi4t8B8tRqMFO6ZmVSMvP56xeKy8rqfEbq6p+Vi4tiEiaq cVFxxv6V0YuidLO+tF6nQLjR7NAPkbx+TppklYIyuDwgwihST2R/hSqIVfthFgj78z3u OqcA== 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 b74si1070923wmf.37.2017.08.25.03.52.39; Fri, 25 Aug 2017 03:52:40 -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 0106F9185; Fri, 25 Aug 2017 12:50:29 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0069.outbound.protection.outlook.com [104.47.37.69]) by dpdk.org (Postfix) with ESMTP id 91112916D for ; Fri, 25 Aug 2017 12:50:24 +0200 (CEST) Received: from BN3PR03CA0084.namprd03.prod.outlook.com (10.167.1.172) by DM5PR03MB3322.namprd03.prod.outlook.com (10.174.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:22 +0000 Received: from BL2FFO11FD048.protection.gbl (2a01:111:f400:7c09::115) by BN3PR03CA0084.outlook.office365.com (2a01:111:e400:7a4d::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BL2FFO11FD048.mail.protection.outlook.com (10.173.161.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:22 +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 v7PAnw6F032070; Fri, 25 Aug 2017 03:50:20 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:27 +0530 Message-ID: <1503658183-4078-12-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318222262795; (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)(45074003)(51234002)(199003)(86362001)(575784001)(77096006)(47776003)(189998001)(97736004)(85426001)(50226002)(305945005)(2906002)(6916009)(104016004)(54906002)(2950100002)(626005)(81166006)(8656003)(50986999)(5660300001)(498600001)(53946003)(16200700003)(76176999)(33646002)(356003)(8936002)(15650500001)(106466001)(81156014)(2351001)(68736007)(8676002)(36756003)(53936002)(105606002)(50466002)(110136004)(48376002)(5003940100001)(4326008)(579004)(569006); 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; BL2FFO11FD048; 1:op5qOFftkzTliCU9pqoP3+5dYyXoRc+3aPBifPNZoVbsIhen07B0ueOasnDcyhGcwQTYmw/Bv7XqXxkAi6P5E0mD1qXH5FydKrHXU1teYnPy2osp8b6hypny+Hd+yLBJ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa5f04b0-aa2a-4464-90ae-08d4eba715b1 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:uQqIoG9+qiS2VY+cwE2UL2a+hRV+zLWr29EXoPo9G46Pld0kzeIiUxU/R9Gj828TYUBqK4GnTJjJ+tiihnnQsdqS+mpz938UgEHcIOkG5Bi87G6Fc/pXJAD011zm+f4IC19pbShXabwviKMO7paaAWuKH0nCW/uQfoSL2mvNiPrCGkZWAYXLNK2b5kGBVyf6dvIk16EfC/xSTe4+u5YggiYl9IjEGQcsoyvXU+s2KgwId6UZUFEkYEexhFQ0B9zB0HNUcuWuFKJYaTcs26vCMmhHoeW8W3l2Cm8tVztMC2pzXtk9M5nV88AMkSKt17ZpMG1cSzya+qxklbx1JK5o7VogmOtPXUqjs7Ww9LuI3K0=; 25:RRrn4nUAfW+uybhoWnW8QoxOQGd8iGmijmNmx4SykCdAJI0hW2tmhZ6rXq49cthj1od51zP60x1G1/BZ7FqSiMgB4uUNUX4xcidxrjZEE2BmGaHwHX1e12PtuvsLnNswFg4GeSQsq8aZ/3jA8Q0TtNAHAdEfLi74Fzjg7YsjMRNx+5L2WDM/g3moFVJTeu2yxKvilhp6INe9S+qKDZUkXQqPbZkS2qdpIwUUyZEskC2IzEDWcqIO1U50wxT3DeHz5kEx8uh7LWN7Mp4iBRv83KSGPw4CIn/lgWa5JVzwbsI574Qh9gOP4sWKlEpFzEwsnDpVy/MyMnjdEMjC3JXjrw== X-MS-TrafficTypeDiagnostic: DM5PR03MB3322: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 31:LOttKFWZDeZ+t0S0jqPZpWMnDPlVqdjFHpHaisaejTxicH2K4bk0OTh8Hcbz41yl1JjgU7cHtAP/XPjlEinBF9PBlhZYI3zp5N7MtJJReXSkBkOOIylowXSmD3JfgxQOoPg9oa6tmpAeYj0z0w6bpQ8oDcuhoxYKXE6XArfChpI8wwiMGU3wn7PAdtfts/tuykjjbJVfG83eAU9AMzaWIkACqlubG1NVRmhVZTg0Vz4=; 4:M3urrE1q1WGiSHkuPKYOYFNO4HTpM/vaG4TRhGY3zNGtnOvbQj0hFb9H5EiJv56yU5A3RH12fQ+CoYuzVcFQRSvvxnFhOn6ntMuHwlnkdNP2IRwDAEFS0zxw7lR5xVsIJXKrJ8aB1TLWphImvaBcVAzPNeNlo70DKgr7RwQMl6ZnTKx6JmrWspiHyZwKVeVlVzeq+0q1xfEIWcpMJspnEouxzr/2tSye9fDoj1y9NgI2j0acnEuMW5bKCqx9jWPXP6G7XVFntpqZkDWXFWlM6FYMVIk4L1+uq9Jw+YC2qJxUzgK2yHUNCbQk3e9nd/vmWSMwUTjqdCIUA2GZsXSvbg== 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)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3322; 23:V4HZt3z/5j0yZjCc9d6bHAfAOr/AXjHS7ZCK79S85?= 6WBLsIFLH1zShuhNW6iI0Bvv3HkobO1ADfX/5LN/FBU9+byxvUVlHxqpUvgtEpvJUJ6IjG5hIS7MU4izqLDFFDhKFn2btP4aZuNeoKHr9yiUL/ZptR4Bq21LzeJ1WPgn2xXaaroPcx9vFXZuQUx4KuQ58/VgM03bt3tnCRjQ58wlDu3FC9emKVoOdfmFsyDBHNkE3qVEmfBlS9G1NHteylfZi4tmK9Vj56Y3QjgDOSqpuTZuxxV+6RIFAAvkld9a2DGRyIZVGNNaijf9/XUFPLFaB55D8ibGqY8f4FBpTfNuv1kZAPSxV0cbyeCQ51VjRNDmHNQ18nwcpBuc2irYhPOd3YtV/W731OZ0S4SrnJes6Fdr19LqXfHIArLYoqKnxVzivXXMWredzJdBbo0cllWrZUaDopvXoTeKqLJBDlTR/LVRu9XCa6XoDX4y1VPACo11/XBtqZxvf2JLv86jEBNPdjMeTnMxQsUh73R+jGG7pJj+Cu2r6B2OkFDAQ4TxQhRhJcLmV/BTFdgMCbPWp/gDZFSGKvfEqX3uAAmKnEReB9SYn4oIfvYtHFv3OVpSp+CBkKyi8XJBLFjaP1MZGL2DBa3GKhP5z5cnvnc32Fc8Jy7jTaYaYCCweuc2qlairgu1pLPjAU8Ce+JTiQOKc75D67wZvD9FF1G/QFfiCcmIY33c2UeuwLdeTvLQ2mDfKMO/r9T5sheA8djVRfCepdAWxujjd9CjR46v5GX2CiG4MMwNteSN6zeGRXJLgVVwUJTXrSZiPiP1wlaZPlaiGVdVJyPU630SiI635sjlmX3yXj0NaGnxCf+oSNayonylUnqWCdlzpLcMLmjy7vFeFwsUg/ZNZPCk/zDGy6P0v6Q9Rd7q2p23kp941EUzeSZ2H7QTSiqn14L9o/aa/duRtz7LjVyxdwMdGpIerksF845dnZ8RIOuDsVES0VuXb3253QtLR4BDTN88QVGny8N543M7Ji9+gqAbWZGwGAy4+pEJ3dSuBFaZr837LIHICKlaeAahl7kyre1isByTJMEeCYNRguJrWf3ywlBeFxlpuzZifOykvHd979VPtx458vy3cP5HXaUry8KGTmmH7aaxej+5G5P8mJNfUAEuKNDNCw8AuFyoYJurnmz58EhcvJaaX8EHqdo8mhx6WDveWMsbSQDhm4I2FohL0BDiVzRTlWuYlcMEcEX/CJoGzo+vVplsSSlGsgjLMr1p1HOXSjI6dwdr1YWlAGTQJU8fejHE1tbHQ== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 6:YPW/mt96SKriXM/NSn1PvDzFLTSMcFdQBpdtHg7GGI2tKYBQmRSsX8oi4qHziB5f5xiS8t6AAXXl4pkUUbujr1qV6yTe483SYapJC2VG+KD+kD9QW9JOAnfq1L2miGEHHYCljPuSUVrnVJxsuXsxZ8bb51ZhqCq6dgl5E/N6M2Tan1KyFrgni75VxFj42zFBQn9zITQvxkEbBZw5TNcH25ya250BaayUtNjRnZa6Zb3WQpnEg4jYbxbwCc43ezBP4U7RjwEZnUMoOEiNBGyQsPCHl4WTx5RLWcxnbbanSRELTVBeC/TLU1YebgeuMXkzihRTzIn7cVAwZaVKEU3HvQ==; 5:e2TrGXBHcuvxRqrx0hk82/ZaK3S11EZAviGWnTHMzrNfE0/AE440jnag6RId3UIw7ZUIbz5aLTfwZB/eA4BrkYMIqS+21R2fm5CXbxPcHVRr8i8m0LhTrRqrJ8mfitgY0RW7/xW85P4dclhySI4ajQ==; 24:7JWfvXotPl09wnRmF+08PO+z0Pt3ZbTGY1KfZigl3ss4yjcHoZYTMIb0q6G+HPPE3dWBvtF3UFbq/aqEQNE2oYBR7bNfrm9Y8T0Tq87AQkA=; 7:JVrPOro4X4rRCLHIAbtAmM3rWS3ALJH20g2CTuv1o/X2Q+L/U2Dm3Gww27JhmrxTtZxofb2tSEDfD1FSoDtXE+/memi/CAd01C49SU3PjkIYfuA2aQ+Q/mOWHEQkz3gFE8IZA9gHs0+6vQeGJNOOQbbk/VcWtqX1FS86ZaZi6GK9dXe5y+AQcHMrGGliVjqwTL1Ji+yJYV9XWIDn1ONWuTYc75OZGweQl+H21LLZ5Fc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:22.0546 (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 11/27] 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 Aug 25 10:49:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 110995 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp811625qge; Fri, 25 Aug 2017 03:52:54 -0700 (PDT) X-Received: by 10.28.95.69 with SMTP id t66mr1218821wmb.74.1503658374320; Fri, 25 Aug 2017 03:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658374; cv=none; d=google.com; s=arc-20160816; b=joOgXjeZ/p0UsBWzA7BJoNV1ystDHOTTF3+q61zj6iPeWzZjVcCTPCaAdqtT5csFMh O//JCHiYKtJR1oRIQMeqbQ3vPo8nA4Wq3Fj11Om67XuKy7oNVNaHnNHYWsreAOcWPYdE XC2DBSje7f6FWMBid5iJWi79IhW1nhxZpv3VPkMdR6IJVX6NcRPPZXtFHn0L6DW6hnSu ZRAKVa02yguRuFBUdW/J0e/kpJPtlci9TFqHOZI3oESuzHaGA40ytySysnqG3ULtqPot CS7k/K1pV8r6mByC36n4MKeLCaEEsF4WdjOR9RqiXywq9pA7MJyCV0NROi8EvHNuPuru UeDw== 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=g0LMfBu1UcxdC+LazuUvesPB6rBM7POewCtL0u8Ny0Rw/WuoyoC0V2ygBRyUPboVQb VDC5KhD7FXiEPonj4fPONQcIMsK0LKq1/5avAnJ98jH2WZfh7kUS1+ZfXCGKoJp1Dz8J mtIznl5RKMRwZ3U/a98VvpyDjnqyHiukeTVn4S0ZF/lt7TZeviRRMSQyVgTonZnyZZOM S0rPhdLqWsXtWEDhnFdjJCGocDsVSHAFpR+0dhPEH+XSrAgycA6gJVYnpw9j0ZMRB6eU hYB0lzpAv9XkK66pNZ/7lC5rI5QQ2F2Upv2ARZ17srLa4CcvINJnat13EQlhwxlrJ9Di jGcQ== 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 j64si1048097wmg.130.2017.08.25.03.52.54; Fri, 25 Aug 2017 03:52:54 -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 5A3B29954; Fri, 25 Aug 2017 12:50:30 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0055.outbound.protection.outlook.com [104.47.36.55]) by dpdk.org (Postfix) with ESMTP id 234439177 for ; Fri, 25 Aug 2017 12:50:25 +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.1.1385.9; Fri, 25 Aug 2017 10:50:24 +0000 Received: from BN1BFFO11FD007.protection.gbl (2a01:111:f400:7c10::1:151) 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.1.1385.8 via Frontend Transport; Fri, 25 Aug 2017 10:50:24 +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 BN1BFFO11FD007.mail.protection.outlook.com (10.58.144.70) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:24 +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 v7PAnw6G032070; Fri, 25 Aug 2017 03:50:22 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:28 +0530 Message-ID: <1503658183-4078-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318242939422; (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)(48376002)(2351001)(5660300001)(50466002)(97736004)(47776003)(33646002)(68736007)(105606002)(77096006)(104016004)(305945005)(5003940100001)(189998001)(626005)(106466001)(50226002)(356003)(36756003)(8656003)(8676002)(85426001)(54906002)(53936002)(86362001)(4326008)(8936002)(2906002)(81166006)(498600001)(81156014)(2950100002)(6916009)(110136004)(50986999)(76176999); 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; BN1BFFO11FD007; 1:q3yxSLHV10ZdJEfn98R1jvOxCiKDV222uj4ShD9TiEzRBDXq+sd6rHvDT9aWV8N3AlwdVstumvB4Yu2KEQ1mmybkiDcX+wCLvBaxM34pEW+PVbjDIs1lTuC9CgF9CrDr MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e54c810e-ebc3-4d9d-af5e-08d4eba716ea 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:gJGK28kTu8bIo23s+X2acx1hiNa4sVejGOMH/JOehd0V9UMlIIBLpRQs8CT5MFh6w344VD1hs85DoHEfjsAr8q8JNhecD2Wm+xxczPqmmoBw2hsgCYpI+bSb4vV3HevXazaq6EJbXkFJRkpQkO+K/D5msLu7i4CT211cvyk2N27z/w8mvK2P72c2G4DCbbMI8y2Xjvt/DE6RFWlIPwYj02hjsj37DrZ7GgTzwiv4KzfppxiICbeqrL3sck1P5w9v7NiUHUwQ2RFelRkODhkA0RAziPKEhGjn7rmm8MHg257zIwyPziJBZY//wLRzWpFTov/P+KQMt4lRfR3LLW0CsqqJYmsHgbFwBrn1kRNhA4k=; 25:94vIKnie+4fEtMgIXSL035kXXYDSK/iVqArSRATHi88AiBR/j+6PJCEKsuQ4UX32m1F9TznbhW9nVKSKcBeIDxO1ydl0zb9AfXo7DixfUFO6BshkybwE8x0aDlU7iGvvHEODqwY6TzWi5pmLTBtg+Ix56ton/3IY7+zNExRtfkpPnVx8twRgbDV4aZZ3j4eeFpjHDg0nTEGStRfFde2gaJSGk0Hg6QNj+dZgRBtunK2QTLNfp1IL1nq0K1hQFoFAutEWSf2J6QTALpwwhyq3ScbYNX59Ysij6+Vdj8j5+uWiazLK+LHFiHuNPrKqYqWgin8ACaZpKN9IiCt3gJDAYA== X-MS-TrafficTypeDiagnostic: BN6PR03MB3316: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 31:wfuv7RHaBZ/XsDRzDViQPTjVYlwB8Cx6tcOEsxuVSPAnJqtt0bekyiy5Bl2K70ugs5bWQEOHyBU1ziwD/FYa7/pHwQvsm6YrCGu5lSq/7seOgK/PbUBE3so7Gv+oTye1TQ54bB1Oz5S6p6ElS9iT5OUniHIe6gZZzuLqPH4PcstlXw5OO8Dhbl+N7UWzqvl1PEkPSxj3ng1a0J220izYozf+3yan66PZ3R5UykpZzIY=; 4:cXIU8WlILUszGTFWDk+H3hdEq42Diyn16onceqrbgBt2qPLZMu6NaAtOQt2WtmTRH0t+WN3fvaGNHHspX+MYZ6ErRCE51JSBPhPfKsQk0kKBv/DaTT1K3/ERvIEzsdIFm3M9ZIG8La16r9xMKHRtU3tzmfsvfEuB5ndUK7dbEoI5t2yS4D/j1exWA2u7qYDK4nFq1RC9mAJgOds+0N4BtLwRiJaZqLxZiqUXz+eWu69Xr7GRMRerExbe0WcXZh5pQ0c3PW8MXcHye3PzVgk1INTm+6T+9QEQonpih54hcQU= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123563025)(20161123559100)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB3316; 23:tRnmJky3CKH8LMg2laQG/n0OFu5ZZgDiYEx+7LvS6?= KDB62l8TT3vgH94DnOTXU66hf/IXgBJWmYMVwTgCwB2QN9L5AbVs9giUILGm7Kp4chFyrytOfvV5sV1Bs6A13YtxplKhWmGos7nE9inEBsm1RvZYtB9vIWvnW6wKZ216EtErrr0kbkeabJDfEdoT2fi5fwrzwjud4FoZFAmfEHdY/866CvDIPAFhQmpzWCOOXJQBHBZqTnASserRHXxG1CwF4kSnIBJYzzh8rFFfhEp3E8Fi0vcEys+Mkjdifme1XcBA2YlWBQICANNHZMVbve6Af/LnQOldKUZ6wFepYdusWAvjB74/4C7ztTDEEh6fNDCSDirDjEihwSJc3M4rzrCN5QZalPO18wBNgC5J81FSM3mcSygS4juSKcCcgzs07f9Pc0HcuZ+4Qv9FLUemdZ3exnNiKZp6f1DS/xs8zx+djWQNPqmASP66VqwRIXaXdAIkywuGEuvgFWv1JH5RC9apGxU2ZQmQDmRfURNMawkGh7kVfsw9WwhL9PR0wtjNw4UFCDVKhPg0WxUbBziQn3PqpuYFBMN1lVJLxp5zV6++3PjsFuI9waK1BU0zFiupKxCpOb7kR+WZfmRa6tFiXli/Fsw6HhzsWSCYOedoiVUyY0m6GmlaWpXLZqsQ52h/GZqO/BSpf/Y4QbpURI+nBasA1u2CUPzJWZ8KRWyf8UCrPg1+dR+8S8RwIeidnGYhPo5kRd0te5wHtbCZYapaI3y3UPfl5IX/2rkGQHWZtYi7D/C8kdGspq5duaSA6nEI4x8E5Ssg3nksE5uQMSKGL2Om3hReGlgOC3F6nv2Eb7cFF4YFrc6mSzZnVIrJm+KSImOfX/0Gk0UM0hXgrphWj0d2L77iAaOKu9XXxkImEYFMZYEGU9Ruw0aMdrEK7JUPf4HN5g3dyjGTu1zgMzPzpzSWwWICKIVE+/VNmZ1cQ2laE++rUXIxVf11b+S7oqhinbEeE69Jx6KFtf8p7Fel4Ev9Gq3nq16+Oiv8d5r8Bpd3WWHIcgJRguCHgL3HEUOaNjyG5aoAKvvyzZZlqdm9x91LU0UYWIKTB1SVCd4lmJJ2REOjyyUjqZ7ahIYrXrJSZM= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 6:lQXVWG7CPRiKKUsgA2KgMaSEMAwUTKufcA45jCGUhWAuccIKphXo1XpO0zG9fXDoUtJdBdfkC+5XFseZcO3FI3nppfJDVNjyrZdEC2y7DKUnbfvzUhZPxxxZ3JxpdeWKCiTdCLg/oaLSwcrLSglh5rELYlyJiCaA17g9ivly9exWgxIaG1YrkmZ0Qj0GasVX62X/v88Neb57l2m7MKRiBd3ht7kLi2bdXI5r/npBpTCQAkqV8qseQIX7NIzBMQ+q7zBlMzfdYcSFwSuffa9YMLeGEo6G40WQHD3EeQTqUq8nVyTGBpyeikM9Ozz0KAl4QFJqxEdh1NwIsjZ5XrRf7A==; 5:ZeDU4nCN2q279s9ij5bob8VLVyz7G941onCxhla39M71ZDdIByNav7iZeV4HVt1BQ7Fw3mMBfx1jUH5VZlC7ZcJcbcNfG2YsI8WnqNweuOoQYQ9O2V9kdn4OUxQoLJrMn9Z7oosrKqEa7iulKSbVMg==; 24:EQrkOrwatyFTP4pOfNg8YZyCHsVnz68ikjeuOBQwqspE9ViPNL2WjKbjuCBbB98rHYhg3sRMWxxHj3548brMUuw2rUjxMa2AlsuoJ+y0fWg=; 7:gYTShaiOgALuK+nQRAJ7JcYwEQK7ez8W98tqbyB4sErkMkkgLzb1b3/qmh8V/5egR54lC1t0u2IobRxlYWbedZ3qB37vvwqhJHz2KNGOJmvaqbpkhmHOKUJEdU4xOkrt1RgVTwsbUj4WVDksHfzfwt8W1FVD/hydeEHdIvPWKJ97xJLXV7h3ArkVg/7hFvnCpsz5uQuDZL6TQNvI6NN+fFzTU4WRvSnkB3v1Lh3QkvE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:24.0755 (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 12/27] 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 Aug 25 10:49:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 110996 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp812039qge; Fri, 25 Aug 2017 03:53:16 -0700 (PDT) X-Received: by 10.223.171.18 with SMTP id q18mr580001wrc.12.1503658396566; Fri, 25 Aug 2017 03:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658396; cv=none; d=google.com; s=arc-20160816; b=fBRgm9Tpkxk+yIDGFQcH619GIuCaENUN7FWopwpqtEnacyzhNNuPN+MKQrrzVEix9U SxbD50VEj1/gQDjU/Ldfnxdwa8XCTYKkXUYA0Vl6lGr4YJFlPhMK9NKO55OUmvXqGEPN 559n/1psaBtoHgk/pjZNCggTMxkNZFSCwA0JqvjAtpJVXf3sFe+UUBKcQR6oKH63opFf /0idy3xPgEWz5cR8jX60oEgI9iO6VVTZ1S3RGMeBnLW23WlJfBUPWjjA5Ah/c1Cp6soH XzK/sGWjifML0QIB16gKXBguDi4mMkgY4ePyzBsrRlJf749mzVF9ELVoULAo7Zx7ZD5q rkcQ== 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=Fphm/8Ch0eVO1VyLuAt37euRLGzUWyHHHHmtb1vN/EPNkaoshbgaYgQhxLwe47r0wM ekYin27WUWgWfshXrRrlAsi726yyxeAr6GuDOh9yyAvhyyCM1orkuO0BCSYFNiXKf4kY Qv7tE/MB+JUr/ePEIUuxzxLoNNeTrMEZptkGdtP26COgZeZm6D5pzSGPKVWXLEzRLw97 ADjraHVm+r/h8P4vqr6mCKMCo4I4Xm8qK5tvgzEiOqFpPLpErFeKmsOAqepKVe1s1jbA +03gGUs4LP/BdZOQQMteZMmVYxDo8aWx3mIxxS/hg4ScgA6eD8b9wPFLsJzOfF359JZ6 VkTg== 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 m188si1032611wmg.245.2017.08.25.03.53.16; Fri, 25 Aug 2017 03:53: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 798F9996E; Fri, 25 Aug 2017 12:50:34 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0044.outbound.protection.outlook.com [104.47.41.44]) by dpdk.org (Postfix) with ESMTP id 89B2D9185 for ; Fri, 25 Aug 2017 12:50:27 +0200 (CEST) Received: from BN3PR03CA0101.namprd03.prod.outlook.com (10.174.66.19) by CO2PR03MB2262.namprd03.prod.outlook.com (10.166.92.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:26 +0000 Received: from BN1BFFO11FD043.protection.gbl (2a01:111:f400:7c10::1:168) by BN3PR03CA0101.outlook.office365.com (2603:10b6:400:4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:26 +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 BN1BFFO11FD043.mail.protection.outlook.com (10.58.144.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6H032070; Fri, 25 Aug 2017 03:50:23 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:29 +0530 Message-ID: <1503658183-4078-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318261777420; (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)(86362001)(110136004)(8656003)(8936002)(50986999)(50226002)(76176999)(104016004)(68736007)(81156014)(8676002)(2906002)(81166006)(36756003)(53936002)(6916009)(47776003)(2950100002)(97736004)(77096006)(305945005)(85426001)(4326008)(50466002)(48376002)(626005)(356003)(498600001)(5660300001)(106466001)(54906002)(2351001)(105606002)(33646002)(189998001)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2262; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD043; 1:IuXwbbWws3ojCnGl+UM5UwuFOCKdJTkXSmN5wFv0QzqUQSe/sCSTZqA2yUYcOjPxVWDnl4Lto3cKsH9R5jS+xK2UAg0MkbTUtCo+9PqSNvofiJSiwHmEs48tmwgkBriZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22283356-9086-4384-e40c-08d4eba7180e 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:CO2PR03MB2262; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 3:orXxNsCRpIPN/MxbpAHOAWgrvf7QIUo0+BLFL6yViCZEq+R7er1sBIo2wnjUPigYrQTa9aGmBgU6BpfnyzlJHiUqI6dVgSGCcb+sTTsM5w8/9+i96GBKNh4mlBuVbCLAMvAN0OMpg0xDD0z4nz623eHUOdmoQxZiLpWMmUB9IV3uJgac88N048sgrihoyGUdIMAsBDQ5Hs1VD5aSf7vpsqwEZ8bMnG3Q/V/d9usJt3r+PsY5+O01sUZSkDNZdHgB4Pwo3fzBFn0l2PRLZLPfWDhHAiixbyE8wpXP+eTOEzJAB15Qhk9UXjacr+4gAG9xEGaPHiMiF0oxmXyi4eWl1imxSxHXxW/UI0qsO0X4jl0=; 25:C7O+U54/tBvAzHQYVnvTrZFFcPIm4cPukCS6nJBequ8PqFSQZbFUk47NRm8sjSJtu9XUwH6NotEpYTr9GPk/R7NED6dLahN32OPN8cn3xwmEVEYbyLEgZfdA+C0B77Mo/qOVCvKR6dg2MquTPhiKtiZ0E3KDVGrjPxySljTgJ1Spgz2VYu5UQHWQcxrR1oB/he1H6Fx4MnK8xaiHI1JyfBwiGi08JMhNokpReY18OoZl7SubOfDfydj3PZJe3eDxbKUIR2rD2FDy1NbiOJVcVBYPubdHURigeqxFl3cKP6Hek640CBiO7zpK4AraqLQw24u6eNlD5/fy/r6iYIBRzA== X-MS-TrafficTypeDiagnostic: CO2PR03MB2262: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 31:PlzgcSkBCngzMnOLl7PcGHkOgf46tXcb52hRcr1MK9qpNRUYkdXj5jfA44mSQgTV4zVxTWS43YQH92oPYlOuB/GXf6dtt21w2jqr2gXEuYMuRSB6uz9sxAVc61wF6jl+rw4zES3OpLMEaZ0yzK4E15r1gKYv8OdCMrJqzBD9pMOq+rA910vGEvGMV9Zwkkzq7RNSzaWWCeScRrfBBiW3V3IwGA5dnvYJpg9C8bb/C6o=; 4:/zV33pYub7OOdsw3rntOXoMZou/jCZhg9GDQFwxwGi7LI8E9QJC5wU7q9ldK6M3wA/qkASveN/M0E8z6ylFPloWPZ403Exy6n5RoyGgrUfmPrMEtIAzOsXaAyqzxSsv0jaitoHKTpuvkeInvShoQYk59VRhC8Z2DV/iNM7AoIGcufmUpEXi6zNRa7kGwCBSGnFrfGyVbgTTQHfEeIOh7IdqJ8dEya1Iv+i8lfQqu25zUkDovVRPGoofvnnW9cQRjLz9nIluFk8On3E2N3WIJhpqeshRUWdaIwXOu4wEzS4Q4tMu9LfBlSU2Cna9nmIPkMm51gLo3bqPgQKBbFnGNJQ== 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)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123561025)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2262; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2262; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2262; 23:wlbwdt2Yk1/rcTAyxLhdc3z9NLaCyfs880DWcr74/?= pXP7hATkVC8vQjQcu7cdTjlRHUurO7HyfY+BK4k3A4PiUeFySWORdD3a62P4lbtRO4avDFsLdyLnmMZiMX5KNu21nFTzlC03/pN/b5uR8BvAwhwoKTi/Cd+OUS4IiKlZRN+DqRfIWQzCZfbojBa+QMLS+VK3Pvt65EG1AxkoUNyk2iPp7dqTLyGZWSWgCedXYPsusMu1Qcs72c+wlH4dRV4lqJY/8lJRUAkrp4PanxI17haYsIbWINVQBAPBNeqzzujbqUz3RXpLCO55U9MfMK3SXNfAeTzQFoBhyxddgEOjYSxDDGGFZmf+AUyYtjyZkmXTG1YA3dxNAy+PwCcEKpGosa7ESRlpslf52lC2Bfx4CcX2nZh9Zk2h/YCylcnyfMdnug9Hkj6OFCsHEHS7uK4xFGgAOwk7l0nD12qnwmzdbH2JZnldywrOLTEH6Btd6x1sJ6iUEtkSg6RY0nIDIg0oKuTbqzu7AnFtAevclwTgyRPf/Dgd/Gnq677BGoQY/FrlLRydWHPT+LucSBuWttrnrDyIxGNjF6HtNYbue3MuK/kJwmGkWb+eV3vxi1CWaNdg/WnCngI/w9ibZjKrP+hfIGtEVH2j5KautGgIGmq/xpM1Rn4PLK9zdftUDok6uH3lNqs9JiOVlt+5/RImnxBC68IBndB+DW2qGJT2K0LGHOZogoNvu/UO31LW2kfJhNIfANTUXXS3lIuaOu2VTl4DkzUce5HS+JjITJuqcKSjqSWcp6mrKEOFUe8caDshA9vshSmBHfI55zxMJRPpNvqPVDnwMuSin0Y/iJtHP8E/SEHuQvdCav+Dp1I70HjLmeXtLnYXSRtEKcVLTofBbM8uh8MX23eQtRMcoMzr862Cc14YpUUK2ZeXLAsFsC85SecZN0NXHmfKz+ngReKECnb5o5vt2Pj9qPaNb8hOgGOQezKzwcU8GoWWNX9wWiXCzDitfga8J3n8WzBUid6gji3VQOmpNYwuQwUNn3IgieXz1tURxQeJKaNA6BcYsilURA4Z5nUvn+mMW6EfhitnLi3jO0bLhn0RMhOmuemn9mWUyo2zwu4SqBOMo/LYO6uJXg= X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 6:6KL3hrm0pMAYma51vQfn4n88CO3ci2TWefkg0yYOp0ugWRdVYVO15w6z8r8Ua4BahX+2DKZD8Zhbzb7SeZ7G/w4nIxg+iVXoBDS6Xk3l16979NxjAOIdqOUaAdmeubiMcZS2I2zb28zGfogawA9Zns9aonDGDkJopK3D6j569LouA5jtgloMae2HlId6CHL6mVLbeWRv2nZPPmAD5kSNXIhu8cgSmATVSP7HBFDZRQ/pYNizqwWwKIewazpGlJGXiqAyaoO6CJRaMFyV4YoMQRYn4sRSI1DScNzhtqVAlsv+94ixWzlK73oMBgOYYq/SR5N0JXUfOBdArJ6bA76zDg==; 5:MaO6jKst2/I7TonAwBWV2tkC4nBCfqgAu/YTmHGlnzcy9HU7uhr23VIXaOnO36E5U2AdZLJ0qYtfg1uHGEFdSf+FOWDzS/hB4NZTDtLMLQgfs1y40c7d19ITgHydeH6Y9eQDkbW+nj4GavGJklJdig==; 24:6oRehuPHX5JUIKY8qAm6N617F9pUVZiFno4uF+y+cfwQfheWl5yb4BhoPREe87kKwt1rDHKK+T7Bxpouj5Cm7Zkbu2JUzdF6D41ibL9txeg=; 7:uTPEuhb0R0Z7EjO9/nFhmMvdKuF8onRZnuFWg7M8WCxpT4i6eERX5COdzciiHcCMYem7tWhrSNHLtaH6EXBBgXLmPiXT2vx+7uVLqt+cFZIC5K70oKyMb5dUGoNuWsn3rRnb/6zHbCFrGaQScxjPnYPTUH6KFzAD6tUUpP9ThKZFK4dIcTeODzrLE7QbrqSJlvyy64buwGW9Msq33DeWPXwAC+wMTXGWp8Rs4qL1ZOI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:25.7097 (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: CO2PR03MB2262 Subject: [dpdk-dev] [PATCH 13/27] 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 Aug 25 10:49:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 110997 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp812229qge; Fri, 25 Aug 2017 03:53:28 -0700 (PDT) X-Received: by 10.28.67.1 with SMTP id q1mr1056323wma.162.1503658407921; Fri, 25 Aug 2017 03:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658407; cv=none; d=google.com; s=arc-20160816; b=H/xI27vTl9eYUwJ7kDUSRTVHwKEehiRfTLtZR0tbmP8hubH5UmezWUv0ABCVVGjAcR J5PPSsW+ZVq67FLeEu24057KHAND6qpCi+0LAmJSGLFAPD7j9clIH2DAHkLQREwkWKU6 oRn06wdIm9IEbBLAnO2KDZ+eFFLnBEw6N+3P1bHRL+T82nqcP1VhZ7/OZv5wW/4ClFTZ anhbRlqgeucTOYy4aqh6Wb4q6fVpCoohHahUOwZ9ZmKQVnkoqFxm6f96ULzC8z5d7a2T sf2EadYEka/QynWFeC7yVTBRdSkXDgX48JrawcC0W1uRDYjeWotIwUEVmKsvLQHaomoB Q/hQ== 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=QQENZmG++nocYR1UaJVf3SGJymqsdKiprYtbwoa5Wjwj1prGcBJzJRLcUXAfH6Y/4d YPw2Xds8VxSwBMkeia8Qn6p/DBeADthM1p+jr0hs1DseA3D2BJ8nfPVAi32RD8oTd+Uy 7SAA64MsOzWRKSun9WZ2eF9HkfsvvEbdZgWNR9gSWkZdPxz+GF+tlfpAtv4Dw81EIiz6 3VlOQnpgUF12nQob/Eck08M4LW7kAvk+uNCJcr3pDDRUEy5v23ywVXyPlxZlt42QfGMa 4SZjrhH6tRwSsR6dSjqHW0lhzCw+tPSRVuYQZ5EpKNfZkblmBHmhcrfFPyBxGqx9Qy/L e8hw== 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 e15si5056811wrd.129.2017.08.25.03.53.27; Fri, 25 Aug 2017 03:53: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 C04DF9974; Fri, 25 Aug 2017 12:50:35 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0046.outbound.protection.outlook.com [104.47.37.46]) by dpdk.org (Postfix) with ESMTP id 7B08F9957 for ; Fri, 25 Aug 2017 12:50:30 +0200 (CEST) Received: from BLUPR0301CA0017.namprd03.prod.outlook.com (10.162.113.155) by CY4PR03MB3318.namprd03.prod.outlook.com (10.171.246.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:29 +0000 Received: from BN1AFFO11FD048.protection.gbl (2a01:111:f400:7c10::141) by BLUPR0301CA0017.outlook.office365.com (2a01:111:e400:5259::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:28 +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 BN1AFFO11FD048.mail.protection.outlook.com (10.58.53.63) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6I032070; Fri, 25 Aug 2017 03:50:25 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:30 +0530 Message-ID: <1503658183-4078-15-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318282044729; (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)(48376002)(110136004)(50986999)(498600001)(5660300001)(189998001)(85426001)(8656003)(2950100002)(47776003)(6916009)(6666003)(77096006)(54906002)(53936002)(104016004)(50466002)(97736004)(86362001)(2906002)(105606002)(33646002)(4326008)(76176999)(8676002)(81166006)(356003)(8936002)(50226002)(2351001)(36756003)(5003940100001)(305945005)(68736007)(81156014)(106466001)(626005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3318; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD048; 1:N2ybKhuT4X/W5OM6o8tKxz9f1FKPOk+jOZcm0ectrUpnQsloDZawFvjTn6HDr1R1hX/AnDZmi3wNH+/us0Otov0GmO7yEtE/x+r/NEaTelvD/JckbllupB0g6Xk0EmEr MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7788a65-9535-4c41-c3da-08d4eba71941 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:CY4PR03MB3318; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3318; 3:Chu6/xYrdsAkh0AZKhkMGZrrCxi4/7eIp47DXdR9HzOBfr3n/tNEC7VbuKijzauPuWk+qTYTvbiYRR4JgIb1Q2gwr/0FdcGbvpc2V0prwQ/5SFw+7eLh42vSXKQwj5h87UJeXGqPh1zNShFwR0rvs0IIJqt9ryLNR0PaXOFBfAIPKHLLYW+DFt5HYh+zLdjOLfcY4Jvpw8JZsZzgS8Xm8RhanfasQFB+BQrbVutZA9DflQboSfkzgHtsbIYqAH1WgiJWyiDdrpedA94TR1VZdpCh9E7hzijlxMVSIt0TigARVzI5xxnewJ3YnxJnt5ppdoIL3iUoLR6Ff7McuIrOjx6UB8OMWSZhPNeIc65TICA=; 25:OfWriko8rDxBeSDx/O1diqNLT7mXYiAErfvcniCAlwo6lYdS82GYYRHx10rc2q5wpFHjuFI2OSE2raXp+xVfOXmIdxKPiKs2/C0uiJgLR290NOC99D7b8QWe1BMkCBeg7C5gQGKhpSCyLpLkB1ORcjQb4HIJY09oWf6wMtolhRX/uqLVpW5YwfijRHZSTyAksbY/LDNcjH7ZD+jX/vpLI3XMEAKqyULSDBbj/vQ4t3vNsJCqKydB1wgNkaZfg9SgwTTJR4BT/Zjqc6s+YLsUNgAejwAJV34bufijSs30xTSkPiBvotQ8/TOl/x92NhBWhG5HqkTotU+Vk8cx4P73JA== X-MS-TrafficTypeDiagnostic: CY4PR03MB3318: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3318; 31:raoNv5o2VikQrnZYVP5ci43uym5uQ/fE2SwSwOdroMUGnsblJqVhGhHXcf64MtHrYxE5h3gw2u+zSk16Ty52IyRngzwZ++rHS2HI7SiLn+3TY3xabDV7UDxBSaNEXIxpI9k5zJ/yFnb/w8e8EVLJJC4liMzMIAHjymC0TFF4qL56GRH4pnvGdeA2DMEbl84zKx+DpUumAwI4M0GoNN8wg48YdNvZ2cEyjhATLnegKmA=; 4:MFQROQW4dw9TKGbDE35nR4FU/4eLrV37rfYXQ6DYG5v2EINf/itdse58tkGW6VN4aHtRGhvLQGwkhbgavoNhXpX1XdfqYy9/vMRHSEwaNsVQLvtyGT6QdrnKhyvknAUCma06Th7TyWoAvOODkpT9+6HbSNv1op2DFmNkTQ3LWq+1gNm8vXhbd55j8Sx5GhHcNI+ql573nc+UpU9SlEp/nf7ToFmZCtOgj6vfBIaFmyipmL9fueUfz//3QHgZWRFC8ptPPZANbwWWKL9ZScjVPjSTMI5HRTERHKO5nIngr5Y= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123565025)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3318; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3318; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3318; 23:9dTNT6qdUwOCyr+7M/bPGsVtUX2i48bcoZE8GoTl7?= We9+nTnP6d7GepdNkjXdqlDEr9XcXR0IQGYEAOl/gGF654E7O+Ff3nfDjj3OavsfixccWVWhCvoS7h8xIDAb2gS3kTxhG0u6z/SnvAa6aRLLvt+VnDndwhL8GNTglOmh6voGGjFdFh2CcJx9LSXu8fxxarcOjI+UNwaPotFoSrmKJYlRkMH4aOxvACVKUHIk2koXCIrW8h+rod39BFQPMoQgjrBpqMuaagSCv6cfSxhl552bD0a4eATH0Vph3sYIEEC08ey083bIiZx8C0GeFWWk2DrPmnCrT8D6Sf7AYH808PLeuSmllyTO4jLlYJdOESEAiiK73SZudlWaqiWKEnt+szmXW+3AjuefJ/Kp3JfHM6EWfnCxNCJZPLPXUEgs7xw+OQn4/QXEly3gSkjZQ69TMSJ+291Sx7yHoffVv9OPsn1m7SQUd1kniPJJ7wWMcU5dwzqEzHhj2VM2lpxLAboiaRF9gyEqXN8cp0yVPHCk42ocGDv5099gJt2dki7jOsu8KtTAB/gmitaQ9PsIRF0YywDIdfBL5Y9L3w0Er8nEA7lNO6l3Nw+dxefwUiOuxVbdnawoGtgy6JFtjggF6IV7FKvMu35ytK3ZBYaWEV7G03N0YSvNKNTtPMfu5JX4fFEVGYuN6kuJaPZwB2LRgq25vhfxCaRNLB7ehCqQHtFLktF2VtdjBYbA/Z1r5VIGUX6+MsAr997bH6jcAeg51grsMFOsWw8ZYDeLEA+bereIVYiiqE32kE59K/EnNOHSp/uwuuqLy6mkJ6BZCV5cZtAF1PHDPkkagVxjsDavCOjYeS6u4DP00/t036nECzTZsWNDpU6CzCA4yBlmErcMMtsGF1iOBCJsHihZDt/5Q5AFOdxwuq8wtcQLJO53FovrCO8/TACmQzxdE2wst/S7eKNOGHG8CgB5jiHEVhgzbqnnPE4mDpf2Ad8Rc/dkAkcL8WhaRsOg6KUfvQtENAdaf7X9lZOalEh8I9PxsTsJCeq099sV/cIIpEMeiZ3KI2DBzfKpkWLsjpj4hlpAN0a6kWtyu1IqGD3YKm50mGJkS4Xc/7XgRWH0ZEfJtE/vsTWh8WLqc0xRVf5NnClpnV00oWb X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3318; 6:SZJGZfVaHpglzRKOEHtryfbG7b2twDI3MFfKVwk+ujUFvBK03zkfewrOHyNdQ4ALtLVttRCoNt0JKSlNhHt0H/qPh03PaarWnpPEht75L3JYHRLrR382666P5ol/tjgAEL5iGsk0HMntHKRdhA/uwgxf9kAIxsG3BYRd9pznQEd9wpgXKZN3Lh8x3EeR20BYwiUdY4A4JEibDq3PGFuVueqjxRfyBApQHq7f2sIRrEaIDMPWTb2D/VZENh6Ekip1HugYBsnrfRXzZ1zssEAUucMRtWnyIuijQHJQTjVZJS63yGOZFIIWqK6r6yhU7OgnrLBd9jTtnIspi+nJWWLbVw==; 5:QToMkDxscVUVOnU21iU8mjzWloL1VN+a2EzHKopLqqk1PJPR0DqSKE5xXHNkkrPY7jgn3aQpBV5p17g0i/3s9Yzo3JRKipnSUIt4MUtz2+iaQPNcwyXFNzzHwr75h5ic3AgHhfVpaYnxBZ/E8TEpvg==; 24:lJ6ie5kXeWxgSCz2i4hzlbVb8c9rRn1zTLan3GRDPvMnCF3TEpozAUC9U0KavjrqaYWArfdi0Jf3jUGopZKYnzAa+nF8+vgfqbLfoI6DkDE=; 7:oL5f/LX5lL9MBLmQsiRhWjjCuK7HCUTIwnqzQgF+MUJXEKIC4Fq9exzLhhlHVpxPo6vsRhIisEEALqgwr56TKiCqpI/jZusGtGUhTlHbeTRxuOdRGj3UpxIuf1cXPc66VZ6A+1uoaDjPTsWf04omkWQBUF+XJE8zZjEzCnbdJquv010UXp2on92YBaN+ZzCF7wZDzsgTgh5XjBNe6F7MkMljyzOUUECrY9c1PBYK3CI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:28.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: CY4PR03MB3318 Subject: [dpdk-dev] [PATCH 14/27] 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 Aug 25 10:49:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 110998 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp812425qge; Fri, 25 Aug 2017 03:53:40 -0700 (PDT) X-Received: by 10.223.139.129 with SMTP id o1mr5513772wra.219.1503658420140; Fri, 25 Aug 2017 03:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658420; cv=none; d=google.com; s=arc-20160816; b=xEx63Diov/5d9z8NClTD3ocIlx5BpUcFQcRj2nkfpaxiKnofVEV+NyKRjLeSAJbSbP 4RHwwo5fPK7iSxNHx43EUe6VY9aI+FT80OkJvJY9gWgFHM5mW/bpasCDoh3h1YrrE+4i vEHW11/JTdHKq7ahAM/fW2mgl7P2kp3FsXvPX+hp0wadAuV9v6YHZveyxXFqfc/k1Q3y ZI/Ydd0IVKHLfRXbJIxqftn82pHrt9yXmDdA6nAqiNC/Df/jzd1+1Vyulz743nMbmK4v l4Ieo4/5NPFODkI8iB/hnvOXM34DwAfMFY8YT4uZnhCgJLTT9POi6ILLWHfblDK00tCr UG8w== 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=fxRpbx2RLYmMuLqXFVBrKpFRfFFW8Xhw0I3nugamoOB7qnLTynMqZou9xtWkWJ4UZ4 YxWm4TxxvbphKmWOl0XuRENw1bIb6IV0DVZzBfonkdKn2qTqj5pLhPSeycavA9Yc1Ot+ MiTNjzGIg6pksmK9UD8kTvlozduHLAcn7HX7rvhSJSmXwxV9mQJnI7SnmYRzEjUg+xqP 6x3hNgmv92iM6BgSvTCtThCUaxN+bIi9653pIiJmCIkuN971PlOF4wANywg92boYSVrR 4T+qQEMzdIWBXQTbe8VyIruf2KLHyUMvJK+iJD7P6A2y2J2euKgxyUFomWtfuF6+r/OI lxXw== 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 187si1036390wmn.152.2017.08.25.03.53.39; Fri, 25 Aug 2017 03:53:40 -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 019A3997C; Fri, 25 Aug 2017 12:50:37 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0056.outbound.protection.outlook.com [104.47.36.56]) by dpdk.org (Postfix) with ESMTP id 7098B9959 for ; Fri, 25 Aug 2017 12:50:32 +0200 (CEST) Received: from BN3PR03CA0093.namprd03.prod.outlook.com (10.174.66.11) by BY2PR03MB554.namprd03.prod.outlook.com (10.141.141.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:30 +0000 Received: from BY2FFO11FD042.protection.gbl (2a01:111:f400:7c0c::125) by BN3PR03CA0093.outlook.office365.com (2603:10b6:400:4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:30 +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 BY2FFO11FD042.mail.protection.outlook.com (10.1.14.227) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:29 +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 v7PAnw6J032070; Fri, 25 Aug 2017 03:50:27 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:31 +0530 Message-ID: <1503658183-4078-16-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318295482570; (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)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(50226002)(54906002)(81156014)(81166006)(8676002)(77096006)(47776003)(6666003)(48376002)(6916009)(50466002)(85426001)(2906002)(2950100002)(5660300001)(8656003)(97736004)(104016004)(8936002)(86362001)(36756003)(68736007)(498600001)(626005)(53936002)(4326008)(33646002)(189998001)(356003)(5003940100001)(50986999)(305945005)(106466001)(76176999)(2351001)(110136004)(105606002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB554; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD042; 1:WGi/kSjHLJQzcmoOvGRCiRVHReuXAuL8nePie20RJLS0NKlBg9SdGDlsgURWfSr2Shq5CMIA5ofEEUdy36jNNh6S8mlSZQ5OdWl5NxplkSIKlO8fMDS+KsHbRMIzhS2V MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 318d5ada-5c10-47dc-25c2-08d4eba719fe 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:BY2PR03MB554; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB554; 3:6hqdzHlvfR8wo81Y7xRl9OtBZ4khcbNeQq8VW7w+kKi6IwwPZOyTG6WnR5DOffgrIJxanj7i/nmGj4r2fP6HoD4DzJZJgogVJ0cAuvLIPDEhPIvjrSK43zPenwlTmepEYc0bjaGNPzxKntNqgAU+KWzWwHCwHFBQxvukDZMezNzVkDckBpa9hsERaI8StWiPodMtzs1n7fqWK96jv920iOYDIQRDP2RtX8QJUWq3HMt4oUPFnI5rgrTYjN7LTcav/O211Qk1K4VHGYykgRCITenZoeI7W9vaf5DCf4vyjdq+3iN9BO4LCayvbZ6LGnvaswz4qGrGFbxW78SfGgGCgIa3IrD+lF6XNcEjkSfZwn8=; 25:yt+g16Hol/KBIrhXHCgG9qYTICoH2E3dRIDi278mscFJBErzAUvhQFIxve1V/kinv/jSRVJfX/Jy01KwgNIAxInT5KfF0vPvdMR5HjUr3GMqSswnC3IKI9th73pSkRmj2lUXLI1mh9D8nsvaabluY9xCMlIHE1Ey9SxsaXCuli1RekmxJ4AGbMKGcZjJA+8bplN5nU74Vwd3CRnsUg07qF5afgMt/rp2yzQUjTsWGcoRpxp/ShqxySlI/kQx1qxftGYTv6MiVHluox17EPqd68n7M8ZpBTaWtwWyErml94EEl1krXm5nxH7J1IV2ulaHmrpK1A0sV75Q5t4KsuFOVA== X-MS-TrafficTypeDiagnostic: BY2PR03MB554: X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB554; 31:ujYR6fs+Ezv6XnGG7p9dn7ve5qeXtu9heVJUXlfyIhwLS4+G23V3zwZsW2c6DA5gVSaa3jA2OfBuLs0cVjhl47oZ6lUxaQSqQ/QvZLYc5UbNzTMD09s4FQRddiju0GmzLI8oiFQIzxg0Xu08IXrU8qQ92wOdp18nBRNFi7Rfiy4g0j/+GQswgqvF7pFtfhBxaoSuKEKjHpI1nb88wmybP1gRE7cnmwXzDlJ10swFqwg=; 4:lwYV6y2dDLFvKXJECJh9WA678BeIokIIdrWg5Ze3XyERo6w9HIVmLTSSFpYbrjQLohRuCCHvTyoawA5WX2Uk72kSDcy5I216zKiA2jJa4Z0u5QX1WojzUsnVpzPS6xulAP+4lJcTVCRBRc8XzEgtSOTrX2XlYp4MjhChW6oYqh5Bg/ad0Bi7XmD5pYH+Aytkx4mIl06GcmDi7CJKeK37K+QjMABzzY19YQlMqI/9Dh04qYpg+fZdpN3QQa+WHbeHRFogffPlL+3Q2SeTMyeFrnm+D5QQ7Cqg4JKc8FJErrhKjgc/B7CoNJarzmB7UqVy2FbF4kcu0SoW4/Imlzm7qA== 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)(601004)(2401047)(8121501046)(13018025)(13016025)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559100)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR03MB554; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR03MB554; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB554; 23:aCaUV1RaDLfgrXFczSDKm0W7t3YHMXFPNAl2JH6jdw?= XwxxiT9yKIeykYpjV3JorFwifUpYo6ksDffbnINCVfq6XaJDxtbzfnJswub3VaYOaQkQrxDSjao0e3eH2ymXuvnW0U7YltF35TgX/6sxFH8EGjp6t9owvMJItJP3dHnX2TWcMfo4TFRwxScNMVzQmIehW3gPHPO3yLGaivk+JDfgFYTWmwfaFi6ZZBM9YqZYtb9ngYg/wU7jpEh9XVKBHjU/5Zh+ERhnWr3Sm93D3bbflKa5RuKayKYuDaVP4BZbRgdvyrx3MOOQCdPwr6pv81zx4126zMkmMzjm/Gj/zJJ0IAVq6UNmJZkwH8bFF/O6CgqIXLtzfouUSu7FBLSFGBlcfXNtszIu95Z/Oi5Py3w17rVTMjaKAcCrn/STTEDoPGmtzvBeTeT/8311kgkR5daoIxpp+bIYRjxeJYWVjX1wuryWifwwqWl/PfakJXxh4Ycd4sI+GDnSmccp4A2mXk+J/iZvp1pevQ+a6wujjhbQrgrfWFISGGJKuIKjeiP9HLUqnfEDUZq9Bhh24gh4IJUspT9499p3Y57I/NpzQnlFZe1OMVUJbtOD1Ow75kSFybBXlgINgnjveM6McxQYXxRT2V0xe/zuEWNNSSM6s7jB8nAn0uUd8MMPCoXGb/f5/+rllKkNgHDYswF8BgQ9NZ5UUlvWeawJvwXFRgo+HqJ7754eZID3AjH9jB2Z5MPlLJfzPImJuCL8zG9L57reCJ/G1/tMCt24bjFQY3fmugYfDD2VATGbp8foPucyvP2UXdErKVAnrzWxUDMWv8Q6Nz1PwGObIB6PSagwjHfwlbwTfavbTL5L8Q1yxuZJRZQcp//BpdtgR5NHkJBTL9xbAr61iFPwY8pGwfoVkMqZRegjrt6ZujeJ87Hjm88kYybFmRukYMKR3NHW2Augkk2mc3AC9khCoJUaY3yWWvbBXD5sw63WyVcZFYsXZ3kQYrZjaZiptbdFOnSJZrT49f28qrQuqAplNPo5Od+YxAXnqCkuHS3ynIP6IWN2i8vpE8g6wNvrW3pedV8FqxgccLfqhYS9W/AOszWEI/BZwGpN/TPiaHVnrSbDfbLQTvCzmvUEGnpPpuLLvILTaifO5Uh/n0J/B9aKi+dF2BYGT1vrVC3ubVZevZwcnA1oQJXcmGoaAQooW+2JBOQzoCLMJgkCUM3rpwfLEiYifvYFRSYcQ4gw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB554; 6:yxqhSxLtoMXLtP9p89QMVia+Rey92Zuo+DNHjbiuAf6ep2rZZpnHWWfd/kB+aOISmzU/EGa//HMuOUUR4fMkK6lChWwKG3ZBAWTCCyd+Be0UkfVNs4z/x9vxBzeO2bURqcDgdIsECgCEOkt/EXlmnqDBa9nQ8brmNTv1zXqjqb3XW3cY+XGBXhOGpZuACQq+V+qnD/tvFRG1snlBtfSSn+FjPasQxdrsMi348gHhecARwcA76WkNvvOOHOJo5j8WSzLKaJnIUA9+qaWFR9ZSMNFNmhs4w5+f7/BEMAW/1IjEusR6QQ3gHD1P5V1NKzctdHk6P2mBCnf2PI32WXhMgA==; 5:Wrn9whJATLYXhuRLStsY8PObzmH/UzDfZfsqBriAJIDupauOxLNXiK7H7lt5FnQYqIcrlEZuAtrFjRuA/Z+arSgoha50dgrA8Zj1sSepd2IMELtz7vCcdP7RMH67MRgAsDVfx5xzwFDxqxkeE7raxw==; 24:YAgq7SJy6aTF3cEYsxgqMlYHoeTf9g2MkySzGGHNrupuDxjJ/Nh5X64L/yXkUWAxEypGe4fc2fzKqR2kvnOvS3QC5PI2sIKne9oMlgG6dkc=; 7:urMwo661iHdbAW4DaeS4/DGDWtj1FOlYSF2EI+b4HbwK/AzxP0t4H+I9pil5P7EMbsd2RxoI3HYDN3aR1dOxpElWz2p7/yiG8MYQxxbn8HeuhCz8wFticCPgmS5PSN8JR/N38o5trlSLd5oO79aYZ1e+Y1oKSXwmBjgpJS7dq+ueccrlgqpWFd3b5INitgtbS34Nw6lvLMIQtEAHDO7gmjb24+YFMO/OLzECpRSk7qs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:29.2362 (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: BY2PR03MB554 Subject: [dpdk-dev] [PATCH 15/27] 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 Aug 25 10:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 110999 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp812723qge; Fri, 25 Aug 2017 03:53:55 -0700 (PDT) X-Received: by 10.28.109.151 with SMTP id b23mr1058936wmi.24.1503658435261; Fri, 25 Aug 2017 03:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658435; cv=none; d=google.com; s=arc-20160816; b=kU3QGALSClplgPqtrX8lVkVkMdmhL0f/rk63tCm3INMsvX+VFHXrkmUSUaSYdJ8oVJ FU3UzRGRSv0A4KU103KpkFHwmLihpHBVb8zxfN+OdDvGXzzKb/A31Qz2Yr8pzIPzWfAy TwXuSE0ktW/Hj4CALIaXFvBSk4Np+PsCWQEEjZsDbFdTU7/Oe4G2dOMw45yQaG4Snn5g S6dFczHRYtk1rWtwS5zBI36gtH1kyP2Ln5uwg1LI8STc4+UES1cCwrnBuzHJ88ZoAi/N FtTG7+2GUguXVx1SqSOyZsJpTqwvNU0hA+rmBhS6v9oIz/c2Y6xk5CWqHuG8lKGiaO1S q07g== 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=Z88J6AtLou0/MR+/wflbS4ZujyKO151oaFuODYYZh2lRBySnnSHCPQ1az1kWAi7pvs Bsu3mc/Eoogm1voBXT64p9/7UC8ClGHGs3i388jf8lXOX/QcFkc9PTYjMAu97Y6tg6jN LGNmX7AC/mQYfP2TF0qzqvQ+YlCSU4ya2xFioQNRbuOLu5p/SMi2U9M3+khzBnIwTa0Q nY06TcZqos9iLhjTgJ96sxqtZmoJ4m/XZkM3Ngcj0fb4BQiuIMGfC0IB2MYcSflOWLvf bTleY3tYilafq9A3Zg7kQuRiTJbpIEg25/Z2TVvBXsHx9bS51r85LAXSx99J19SSx4Pe ecOw== 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 35si5068932wrn.335.2017.08.25.03.53.55; Fri, 25 Aug 2017 03:53:55 -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 CF9AD998A; Fri, 25 Aug 2017 12:50:38 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0045.outbound.protection.outlook.com [104.47.34.45]) by dpdk.org (Postfix) with ESMTP id 895629957 for ; Fri, 25 Aug 2017 12:50:33 +0200 (CEST) Received: from MWHPR03CA0014.namprd03.prod.outlook.com (10.175.133.152) by MWHPR03MB3328.namprd03.prod.outlook.com (10.174.249.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:31 +0000 Received: from BY2FFO11FD015.protection.gbl (2a01:111:f400:7c0c::100) by MWHPR03CA0014.outlook.office365.com (2603:10b6:300:117::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BY2FFO11FD015.mail.protection.outlook.com (10.1.14.131) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:31 +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 v7PAnw6K032070; Fri, 25 Aug 2017 03:50:29 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:32 +0530 Message-ID: <1503658183-4078-17-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318316173680; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(356003)(305945005)(50466002)(104016004)(110136004)(53936002)(36756003)(48376002)(2906002)(6666003)(189998001)(54906002)(85426001)(68736007)(8676002)(498600001)(77096006)(81166006)(86362001)(81156014)(76176999)(105606002)(106466001)(50986999)(5003940100001)(8656003)(8936002)(2950100002)(4326008)(97736004)(47776003)(626005)(33646002)(5660300001)(6916009)(2351001)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3328; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD015; 1:kw9nj4ubbSJEvQ1XlC2QzbPwr1dT7D9WNBdH7JX2Ul+pOn4Ckc9zuNLuQQrZ3nqIeNpdRj2BSqv4DB4uS2ahSJiqr/OvFyTELoDrLCeOMewMTqA/+sRnh9xdTfE4mzef MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 427a0a2d-8d3e-43e7-de60-08d4eba71b39 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:MWHPR03MB3328; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 3:Qb1rM0xCUEIBLFRE2A3GHXnrfr2l+s0rNH+zIfn5nSXZIaJnzsfp9ehUhCSS8TZv9l/4covTU/VVFPXZfw79Ehc+gnTE2nI3TDiGGGJS8LnlNLtl5e0o6ieHcfqQDKQbF1IL+/EXsHEJlbdjB1lg0t7JWLmt2GFxQrgA5aGgyfL2u/9dUNTbXy9mcwlsEqzOThMN7jJ9yseeeVflBTKW46UG1qfdgvXuU/Q9Yzg1RQ/BvXvAf7MjMi3f8jK/EO/P896ca6DnmVY0u4b+q6Xmr2aUcxGP9v/AWg6of5HbG2/eN8y3S4pAu5lHZMHj20yX2JR+JFddZjSYpTsE/q+VT6FsCDpk4LW9L3rGZRYAv1Y=; 25:JzE0p/XFQ6HazSYDx3d562k62LUD8ZN2888QED8VEbYC5D3kU1zYTlsvyK86GPzvnwivqbuREs51tKWWYuaYuSgG2W75bUsWgT8JQjrjEeUEkeNzAix/aSgxpx9BMSD55jVqRmyIP5tEtJUv3kyvYN/t3eKLYx7oeglb0MJ1qitpG2rfAefU8IVjJ+eL/Ksq3/zelsBhN5WrPRu6/4fcCMrsTJWvLIWRwr4t5r7stuYwtHUxPBx6BFZ4otzHih2zSrdOjou6RaRc2LFhBNLDJPVedoFkuDZbmTbAbwt+/Fzi6hCZ41ztQxvV0ZtLS+4zY6eY2s5LFibqZVbhJQFH0w== X-MS-TrafficTypeDiagnostic: MWHPR03MB3328: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 31:PWxaklhFJ881Zz+MWow0kLSz+6rmsFX3SYi3cNqFpagKxmKEiQ3dxKIys4j4LKWTlTwGeFmHIb37jgKx6E8NLim/JzJtpR1z+awUYPIKhRIiCt9Q0vatiQYRJ2Myk1Cgqv9Fx8+ZN+qlSUn0apLBMG4ddex2tr4XhHg6R30hw3QacvMWzczkFrX/x7B6lPzYMjZkF34zF7g2KuFj3xQLksQGZUghq4M6q+YffdobvaI=; 4:v/Jat5FaptwyRSSlRkIFmLmh10uV+Eqgrlk+AfP0B7njbo87dAGF3m8gifGvEeFY0mYyB0EXzmOZbIT9B5v04BA7LBJPsb6T52icHf40ni98Vu/HWuThVa5T6OjYXfX1/Sdp3vZwtNAvI+vhJGkZrkmL96yCjUKGnZiYXwwMfGU4F5ur+SUcK9jofTUV8YxfDpVFrMSCNzjDwHonGJlX/IvX52e9IsDke7fhn30ALFW0wB8OFaS7SxhBADUwIrmSBkhQ2ZnqHgEhQrZ/0AAUWAgWNJgTyOCZtmn5fEVWBS3YcHSkmD1SYLwR3DRYmsBoec5bOqAO51UltjKdYDRNcg== 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)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123563025)(20161123559100)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3328; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3328; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3328; 23:oboN9OWuVw7PJxx/SFG/e7FUIuqy4XRD8iZps3xSy?= k2KhG8FHE4HKPivsQqXzKlZJSwG9cUOXAiUO3XYWPboRKzvitwomXJyB4BVuc6+PCOrnKb1fZk9Cun+jbMGlUz3G/XT8sJUb6Cg/Fkgz6rvDZQ1SPWeGLQxiaJkOCyh4eI7EbFAmgzoS0RnHzbGS5HHCirh9eQUeJs/Y7OZUf9olVhIOjqlE7ca1baGvST9FSDxdY/onc/+69CXCYNyBZMTZ9Wq1Sl+AbpkD+3QewK59/bgFLufv8ZTs0InZsO4uPFkfvHEBQie3hvSpLB9m5AkYlAC3Wl3efadyxE5cqD5qVbn2z1X7K0G2V3B5hm3PeKs2u95RBbPZBDVBuiO5LrKkdrE6rWNvjuay5P39hmh+wUfV6VMLUQzbXchBOKVF4hESZZKi0U8DtIr6cmojC9lEYzXcpEgRObVFun99fBe4S/GaujY4misRqs+Bje4yydwaEDL8WbW4qYx50rLdr4bytwLJQo6WUGDj1yLmM8J5WDI8MITeTLnuiv2iEHu89fTNq+XWpKkkz0p9ovoax1Tf8/bmwgulWf9HkHlrCImrSzQZWCR9CIRtqGUglKEHIABVKdMNU9e2wm8ewv3DCWqVT7G7vciKz1NtREYasgGBirHxVrUdGqLk7O9JdFUDDt0VJ5u6oJClZnYcnOBS3VWXFIBlFOgrpnR7e530DBYX5ZDpgmkj+yuwwnGYv3kASKhB6f/iaTruSwBISeHvjoPzNC/uEDHiXG5N8WiHhvdBzcR0jedXTUPQOCxqta70X3ri8rdmVXAiTnnkSHdQWu2+8Gfks7u+PiJrLJeIA+MIAYJxIznkMmKBgh2HtpblxUaWs7RubfMJpk+gDD78ghd6qMfsmVuwgwRYtyZ06v05+2rJWOKe9fLvhhPbe597eRr+0qyhkizZwM2/pRsoSU5XM2d6SBjJjbXZok915HnQTYqUHkp7qtYegK7aZ4VpoTjguIt9boU0kEtq17+3nPUkKsPviOODPIIfuK7mjWpCXxd9y2cMdyd37uBvDNNwzyvME9wCKKOT7p0zEEcDfURufqMwob7f4B0nY08jJM2EC6H9gGWxOhn4JP3oquNPW55GGLTeEnRjR4nuhlNYsDo X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 6:ek1uh6p+4WD6cZ4VvKgzI99Pl/BJJTfLTZgGnnM/sqlAth/7b9KgKCsqbz/BCDdlGADXBfQai+SghRc/7sikcjA4+Upyg6pmkXVVrDfOjbEDlp9KYSsDSnU3qGVzMILn+fcroYp+egzFZwoikjmY4Cke8Vx0tg++Ci1OHlMLKLGchrQbak1AyoRflORd4R/vWY23A3tOoCLjhVjG2oioiSFKnfkNwiVmm9K+RC8pL8Ikn2dQFJCB+yIdYdPVYOdRB0h2lxc67NTL7/M3YFVV0BaWrJcaorpo1Zn5DsoXRxtWaCeJPD90qFKUneonOnSN87R0EJOPNPuGCXpU7FxlRQ==; 5:dn61d7cKn2HackCGjzsUtusqx0PmvR9b8DZQl7mqooC+Y3HWoeBPrfn6uSI0MUzJDjzR4gJKeoytwj4XPScZ9LaHKCBmyy17YpmKwgNsFHAg4DGw6Reu4tRAmiUbQ4Ik2iigM4GT+0NeKgKaxoUZmg==; 24:xkEuRIjs17J1LPlQuXDs+aVwnqSoJcNgFeZcHfLwwMTCxL4ZEFQWsZeyFlrPH1D6RA0umOiZtLOnUAkq2ym17Ts00si52TOELlZLsH5JwsY=; 7:4ghinVgkJrcpz6ZFwNc5T/TpsBpzgqPjnSWskfuUZqzeatQXgWZj83w7wut74YqvJ7+ER+K7Sdq7JUDVbu35yIpp0uS+pA/JxgN+SeCrGPuHhub38DhlnEJD9EUYZMhfCvKt3WfnEpfOMRVqL7HYEwzVRIsnMgpUKSXGpOdJ/0lmoacxh6+WHS5kd1UsnjDv5zkWbtGJ4Dn0vRgv9KP3L8cjsFg1Sy0GYFpjNf8UnQA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:31.3053 (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: MWHPR03MB3328 Subject: [dpdk-dev] [PATCH 16/27] 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 Aug 25 10:49:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111000 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp812961qge; Fri, 25 Aug 2017 03:54:07 -0700 (PDT) X-Received: by 10.223.135.157 with SMTP id b29mr5754305wrb.48.1503658447798; Fri, 25 Aug 2017 03:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658447; cv=none; d=google.com; s=arc-20160816; b=O5FfQ7CSeJCU1B4JoEd7FrIBirS+AnM5mid4w+nTJqQyVwNZKPfpyHL0Hg3JFHlDas L/zQHwdwJ9oXnhKP8ZBiGyf78U69c219jWzJs7os8e9OBE2AdRsXbt9h3rzdI0DV006E /NDtGjXHxD6BPMkBrnIJJDuejuGZVfYJKhgiiFg3s3i6aQ9dtUwQ1TeJKwz56itBr/ZQ 7AZcXA6IMxkhcyn3XalO6ym9sDudqdeW4ypF3ox3at+NnfrkzdU9uGA8B5PA6bczxrCG +SK2gI3b6cv/bOZlMx/XhjOcQIWAd6XEnyyECThtm7Gyw+JNMlQIe1CuBttwnYSF3PMc zBCA== 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=lYxFbNB9tCPgRW4fMnwFnJSIRAXr9Ifp4LDqWoM60kg/3DMs3QMPEe2pfZiSgra3i0 0YZnA+BqiCzFYRwTHuPqSUuS74vONxsfZcWceXvtccPcuZXtXh6rfeqIhLYzg0Uq71Hs RJvmiEDF2zcPko50R40uP4jh8fgkpg9KB+6qBiJmH91ruw5W2E9V90DiCtPEjsY63UG5 YszfTA2ojRgPdlMiPpAybCgFd5mPQymlTxJK4pH4WKyIe+SRCOPN70arG/zJtdL7OXc+ 1O13dcpzCsSzhOzxVaTB875u0J94PaCsDhCjt/dZHdcymWdN5pV8m79zxQFxIf0HQSCk lg6g== 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 i20si3990989wrc.405.2017.08.25.03.54.07; Fri, 25 Aug 2017 03:54:07 -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 222BD9989; Fri, 25 Aug 2017 12:50:40 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0060.outbound.protection.outlook.com [104.47.41.60]) by dpdk.org (Postfix) with ESMTP id E52CF9155 for ; Fri, 25 Aug 2017 12:50:34 +0200 (CEST) Received: from DM5PR03CA0034.namprd03.prod.outlook.com (10.174.189.151) by CO2PR03MB2262.namprd03.prod.outlook.com (10.166.92.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:33 +0000 Received: from BY2FFO11OLC003.protection.gbl (2a01:111:f400:7c0c::160) 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.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BY2FFO11OLC003.mail.protection.outlook.com (10.1.15.183) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:33 +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 v7PAnw6L032070; Fri, 25 Aug 2017 03:50:31 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:33 +0530 Message-ID: <1503658183-4078-18-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318336305134; (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)(45074003)(199003)(189002)(86362001)(110136004)(8656003)(8936002)(50986999)(50226002)(76176999)(104016004)(68736007)(81156014)(8676002)(2906002)(81166006)(36756003)(53936002)(6916009)(47776003)(2950100002)(97736004)(77096006)(305945005)(85426001)(4326008)(50466002)(48376002)(626005)(356003)(498600001)(5660300001)(106466001)(54906002)(2351001)(105606002)(33646002)(189998001)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2262; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC003; 1:d732GUNA7eeDITdejINYVCMjnUjs0f9JBn4B+JUz+S4a8JCJz4VH/8ebn1TCOauekEEA555EmBSHwqbqrON43b0tzjQgTGSYhK1HL8b5rWUyBMfE820YkbLaXFV/rXr4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7c98b1a-629e-4742-b691-08d4eba71c7d 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:CO2PR03MB2262; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 3:8gdDArnA8BGgPedA5lri1nMrz2CMe0Hgam85C1s3pWP19VStUFDzw0cdEWIKLi2AcZDIEb+04bF50v5ZNeuDySOSczkRAtIQt2wv3w+vML9wMobb4TAmTR1sIOevp/KwyGBZSrnKMLAg1r1/CwpbwlQc+/GSNquVnKnYdcsKBx4wM0gPWUfWncDVKfx41pZIauEPx6V1U6mx6rhPA53pHvtHb3Dtnjz2F2sQuG6RkBJ7j3mTsO/EBemB5FPhubVgWBBuAffqC8pjrxGqLE+xQvZ3XNl6/ObKmyUqFdh4nVhmnyFdJt89vPSP2CCYWSjS4sg10XOD3JaBwS8GGz0BL3KflfvHk6BC0vJ1d7qHNEM=; 25:1tZXPXcPel0xPbRUnjFWoIgfple/r/vJSSR6f5N08trGl1a+A3KhWEbQGt80wIx88c1NP8r7WiQRaDpVscKjsCRe1+9zPu6fplGBMqmHbvy9rHTFcQVEmhRNwNxmjHU03M4MnO5jQzlmLCqf5InzZQBsqbNBVh1MY7UlXAj17vvdTwstjOWswe9NzeKAHG+NZFLG0Ikswkb8wq9J54IZbvRj1f4RsWlzWr659fgCyjgPD8DQNpyPYcCi3mR1GmIqo8t+Fuq31qwxTm0LSYWYa3O6PmQB8YXZPsFfornz9dRdA7ImTq2RG4IDI45/ofDHSjYChEonT02SBCWBTiEfgA== X-MS-TrafficTypeDiagnostic: CO2PR03MB2262: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 31:nUONYGKVlmfY+mB9gvTJbaOR0PPUp1dYtLFrI52ntXzbMFaTZD7ZAezYRFsB4wKDOZRzgloY6YQbf7bCV+gOUqJD2NotggV3bftdr8N5Bs8bQDvfl2LNWUy7pCCQ1ZY51byqu6fkm95jpV9dBrGMNNMO0ifbwFYmJqdlTHl08yodPuOy1xX8NXJO+Ibx+5hDwnIZ6x/Lt1gTXLUizIA4sfDaq7/UCjsKE3du+erbI0Q=; 4:eBo6sWlejyiVGMnmQwuYNya6enM5PYmN8skpG5jWBmP0U11M/++Tv13OGMbnz4q//mUMqwHHwXn6c5zJNh2wcThTl8tfnE5dXxcwmlm1qwC/5MEAFlKrhHqUAWZobT1lhOrFXO6nrjZX+hc9OWeFxdRBRNvT2/7Y3J/Pl/u8T88WwNUveAg59sE9AuiIb2yhuRVRR4FRDhBNjkyskmj21c6vU2DS3MnizoLND09dbZEfOUd/MKFYhRbXW46hHW0R5V70Mk3p+kb8Ll5lRegmd4wv1Frnd5d6fmFJlfStjgIXd14v02LZi8ROOsqks0eDQyq392mPXRiRsh4qiowWPg== 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)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123561025)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2262; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2262; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2262; 23:DtOYCiFGcnjrLj4TVEDIqP3x8gZnPex8fpBmXO2Ua?= phHUYR4sESFmb4S4xlIUDIEHsug9LgNqjTl/n+swObPHxir9g/330toW7pVdQTM6BAEa9SRacMf/iM8cTRixUdbYhsGRAnUzhcs0KP1jXW4N1mT2aFe4W/aPeVnjh4SVDTbpWMMli6i9zLXDBOvqQbtmvJPGRAG2EV06pvBcI3aFjrFAacKq3RtgQxXjAt1+4RSwbRGPhc4n0flpHNYsMYTAOaqQzJ2gwhTvlenlApqxYGo4kAM+sdABG8szU5lzRYtgwEEFmxl04Bxr4sWjKYXNqdD9RqIwwCD3Fg4ZQlcsPI4XLGqvFRUKZL+FvM99Kl7mMX4vitXNKLC8Gg8Fd8aactw1hCG/TJXKHDzaZqAM1XgXmpHtNPty9yRPza/YetILX0HLT2pdsFgAXGmgKWE9ZgjZL73J5M+9dhEyel92s6dAPKsBaoZNfDiasOkdJS4LBX6KIeQvhfHTfw4y/Q9PP0WugVNT/vYBJBmrJr6d8jL7Ak2TMwjaFvmjiDnScTyijGVbKkK4KuMYGmc4T3J0f6FpFXZzS/h4vB2pgqfu2yi4eL4WIl7XazG8OwAS4mKLvQguf7hr6KYpZEG6CoU7SoCpAe7aCw6ij9x81OA73WOSElFot7OMYthAvs60GY0mo5ivMg9WEqOjB9rxEvj9F9DIT3e3epYE5F5E3MAnt7w7oe+4uAda69mADG7hCGVesjpcr58FVRrjHp/E9WeElbyUH4R7aStKkmdMgzzBDtj1biGuNuhTzycdGDtZeAIZDgmyvXsAnmXCe8IkP6BLZJIjjR1eFJqMjRzOHGzuTTdlxdR22ereZlullAJvJCqvcl9gyUSzMV1OSIAKu+HNSFKT5seasY9lGLBTczr0zZW4KdSdIYqXMXutKArcTrA6JAiUngrY6ttH83aFfPrNjHvK1qulya26ot7p3PGSuaDSPqEorwOXUT3u0uZX6eedxza2CaqO1WWWNS+w5gmZ1/YcQbEi6O6OVUBImqRw25+z3yTpPtdK2jQBNW/RGdVpJiz1STAACsnutTDoQMdAYFTDPAstmDlHAeMbcnttuhLUSlzTPekW8ztADCHsED6+DS/twPridu93IjT+ZZ0 X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 6:XoRYRCL7/uFqcfpaf9ImcArAcxD+nMHt4WVbVdWQy2206xWgdKugBnuTizufYp22l4QGykE95v0BqsaSNI1O8dyjwX0qhtDIGS1I1blWpMZVmfNrc1/xhe+BAZzk+ppGF/VMd/7+Ua/3fo8zfFHFgY2tmfUpu41A5tAJcdoERBtEPqk8o+78vxgv61mrcVvVMj4h+nUX/8zafwtzh9BZaSFR3O7KlDsZ9XzQa57NqAJrjMlOBA5miMnXXOIh2L+QiDvR0mZzvKlMyXnrsbvsf8DcSmo/RUnCDInJ00HE1grRsdxG1JT9muNo6KY3DzWeV09VN5+2lSq8cGWjlwZXAA==; 5:XptsYQF7f6mATuh+9j22o4O6xIvayxVOVQWd0dby0R26n7NisA3e2bcUD3SUXj7hQBC/NuWmYTpPaMK5QaqJ/uwbcMCVbYH7FG/Q1He/KcPzKCpAnwNaOB8WoecH6pIacHDMyErqPfVQBoEYXYzgLg==; 24:i1FnNAZbrUaSFHh/Qp3euO56wZGkyMuB+sQmVU9+7neAjHbGYlr+V89YEvUjUIMVqcqljb/teBN+eETOcSyyhXH8xGWm0hgpzRa+7Au4HbQ=; 7:TkeXOdQtuJ5fvSHoZKbd2R+6UcgNMVc0w3qiFhvglQdr1EHC+zU1Tb5uPtj8dBQSdZdH+k36mXkwWhSeSs65tFl+Jf01oRd1YKTh0RIqThx1Qd5emO285KAnnnDCqGMwSYfemy+V9ipMjWNa32pWWSLFyFis/BzsXrOAFNsAJACO55P41/WOO7Mh3LtZar431YXhJ4CvxnA8zjWGwMYDNQOeTgBkHa+YDbA+Ghpby5g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:33.4277 (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: CO2PR03MB2262 Subject: [dpdk-dev] [PATCH 17/27] 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 Aug 25 10:49:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111001 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp813130qge; Fri, 25 Aug 2017 03:54:18 -0700 (PDT) X-Received: by 10.223.128.47 with SMTP id 44mr5544599wrk.175.1503658458352; Fri, 25 Aug 2017 03:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658458; cv=none; d=google.com; s=arc-20160816; b=xYt/1MwZ9p+Yeh82StbaLTHOteQMJ4XEKUc/XZWXyyshmVu2Z/5q1gtHBNkOHsY8vb 9Kjd5IoJhp0rajyVyD5CucmcUIxoXO3yiYfBx4nBuum7MatO7ITe59aceo/y1wutJeJ/ HU9+r8O7yfV3GocCGuY9RpWUgcJww54a2Mjc25drEBo9tN7KroXZPnUMTuKgC47erru7 ExWdajSgnA8wKbW8ZZaTsomGSHHME91P8KhhQRxo3vDSRDhvPD0gMob54KJOKUwqqEDQ 6cmkOMVDEQ3JpWAV3JPVaENj6WHdwV4mOG2ktwmqQHI/Sb9HSxU+fKaFe/pJDKNAYlgB QVqQ== 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=CoY2SEENs57jTWnv13UutgTaAmDEp0YJynsk0YNAmkxOsrDn7WJUWvEl52ovFA4vvJ zsg6lCXruGCITTFsQcW/Q5nfR14attbLWSI9SI1AihyrEUBs0fbM5x4qJpforZ3DNIjH aicEeAEYFCDeTzKhFMyaZDsYKcVAijl9yNpZ2/FlPYALdunmtfPTow73qiOZq8VszvDz /Hs0fjp60qLP+7Z7u7WNnxZGYgTkGZo51ebw2c5/0o5aJZaTuL729pOIKOf5N0/07ZBw LrKBEXbjtks2Bnq6dZ9Ij48KpG2OuRPIK+yqagksDzz9LdrzSC6B5nALm1lIDK8F4hSI efZw== 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 200si949350wmw.4.2017.08.25.03.54.18; Fri, 25 Aug 2017 03:54:18 -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 6E0799998; Fri, 25 Aug 2017 12:50:41 +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 D0BFD9978 for ; Fri, 25 Aug 2017 12:50:36 +0200 (CEST) Received: from CY4PR03CA0093.namprd03.prod.outlook.com (10.171.242.162) by MWHPR03MB3328.namprd03.prod.outlook.com (10.174.249.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:35 +0000 Received: from BN1BFFO11FD009.protection.gbl (2a01:111:f400:7c10::1:116) by CY4PR03CA0093.outlook.office365.com (2603:10b6:910:4d::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:35 +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 BN1BFFO11FD009.mail.protection.outlook.com (10.58.144.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6M032070; Fri, 25 Aug 2017 03:50:33 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:34 +0530 Message-ID: <1503658183-4078-19-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318351522502; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(356003)(305945005)(50466002)(104016004)(110136004)(53936002)(36756003)(48376002)(2906002)(189998001)(54906002)(85426001)(68736007)(8676002)(498600001)(77096006)(81166006)(86362001)(81156014)(76176999)(105606002)(106466001)(50986999)(5003940100001)(8656003)(8936002)(2950100002)(4326008)(97736004)(47776003)(626005)(33646002)(5660300001)(6916009)(2351001)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3328; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD009; 1:uyV7iEp88mC3eWoMVRDRtQ1AqlDzUfhbI1J9BDjiVbUnb458vnREzEfBfp+dacrUy4NFMQ5Cq4M4E9h/Kwmg7Q6uZlCiDw+NVS+8JL12DqWzRsGvxCrIioZPeEelpIMx MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2369bcff-301a-4c1d-4ac6-08d4eba71d68 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:MWHPR03MB3328; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 3:OeSiWnjlHnZUY0TpPRywf6MI5k4m9f2RDEZfdct02SLqNzXysfk6gJKpJEQ1sZLNYYgCHYEqpT0H7f8fQ3rE+L1eFFHgzR4rOF1ej3AEpTvdk0OIUIOtAUs7EkVa9vWqj0LibNlbSc96UTTttC6Is2OULVwgna8y1qkMY8LaeQw+eRAf6U3brWI7qAJr05ODhQt+ADpnVa6/GUUzfVxyJwy825dV6A7ZNe6u3djXxZwVnN+UE8UR86J4/7xbHRJn1crNJrZSUye9r+KlkVpDZLwb21z6tUPjBapsFG4YG7R7f/TG62wXXnphRlt7ewfPECjMF8dHuEbF8oCG0EQJHUBenJjB+TZw0X15QcBgcNY=; 25:pA92iydBL7M3g+KGuxeDv4/G9VOyWeOhLBnjoqt3UGhMLSaxBBKyOJgehe+Wed3OpRuy3uvNgTQHUHGeH3PTg3BDiSQ3sTeE+UJY0ksXUVoFr449C68k6yIAYDnCO2XcUbumfPKaJ4XAIRYb4f1K0c44IkBrVqHVTBVpYIbD2afhvVS0U7kSvsheRzPuZAUCsI7trAZ77lkeEtX7K+iXfriOg2vx6TSRmzyoAwT8ab7aWVsh48p+2DrhgFHZLu5q1WTAIfETa0Kyy/Bnz+L4+Gssze5L5oZp4VrAYgoSAlFMckZuqlFpfR7VZV2EAtk4z+OgaVPJxP9meoYpiQYhGA== X-MS-TrafficTypeDiagnostic: MWHPR03MB3328: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 31:imEgnwqK2V2WupeZjkDbzf0AOQPl8P5i/KMKtA2rD31N9d7OWeU8xOwS1ymNQsG331INEkDvFBntEeSPioCbs48+Qfkh/vcXtBa4AlU6xjTARy6A/dclYx90ZklMwGswrnKhCMMmABvIsyVx73bnruhRcKyipEJypnSUDRjrsv/6mg3KV3j+f7UlLHDXektirr9Xu68Hv3gUENUzMXekyiQVUefRP7Rdu6jHOh3UXm8=; 4:25Lf1vzVGMK/9OCfQiMfCDxgxY21c21ukkl1WhrfFomFpZZkNEh05hQk/+Q4i60NeOEg+C0RJNDKIrjSuZiDlaKKsSmd9fleNbkCe1xLdID7JwY5GJjZgt5voWinxbdmjB7y+BRqR1/IUwogUX7Paz5Qa2OMNv95mRRz3nBJw27Co3gkG4ZN+UG+tsrFdStaQ0UAQSLjUTCS6eRrtxpSOU7e88QmOmPSk5OekEebY7W74tW0OPQmiluQUBEEJbb2B22SjG3lbhPNnXPCQ07OVQpZdfd9LuNDGh+grg/TdrU= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123563025)(20161123559100)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3328; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3328; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB3328; 23:0XgCiQqk2J/FbUgxqBTdvg0+cnJn6VZoukdUggr13?= p5svWSnj1XmuTd2akp63yUBgWFjd2b91jFxtb9D4nBAeCdFg7AN9Xi0Vyxr9csMio1zsKh4FWZMbwKF1NDOIQwhIl7ufjNLv0AClJhdTtkUIZegBV6+faNw4bWF4JMErwmJZ2GC0prI1RHkJYZWmVW/bA25LOSGpGuw23FzY5BTmZo4ud42JQF4cqmhfIBIXLAAuyoZ+FUYt3gX4gK46DpY4J09vGaEOgN6lToMn5n1J5yEK7GHjdV7fa1RoGy8wuT+en37dtGDdigy2GVfWmHrjsqQFRSFVbup22fp6DKSgmj+bC5qeQG43zuCn1De70RTHwCZ5d+G/dath3HzeazFgXjF/RauAJd1pPfjvgiNZubIN7VL3OWIb5P/9bgAkIvkDLrDaM52XPdwlFt4qeNE76MwP0xWbnswqt040V7k5UF9Emy//nWbQVOC2iSBXN8H5npo1vv2EbT3sfXyVZCHJzPKmsLsgGvBiRYFqnELYb1GjdCchmxCQVVWrOfUaVlZjno43nbxeGY+t/8lWIM60SPKZo86IFb9I57Vo174cinoQTmrUvYYLhNeyNYh4ZPN5p5tdzOvZRMcRV6a9Yh79mRMDIurpl7NuYxv88PD4yN/5QJhAzgyMPIJPENa9leo1aVvc7OYoHA7m2eeZ7LQ9nCsbPt2mmQe5BfYLofIinMe2TIw5fRyPJ8BTTS/kJbzszlNiWITRiFke76FVrPcuyuIpww+8CZlIKGqFRISv3wj5vgG1ZgYGVgGBM+HvaS4qsLdPMVHiMNDCGwtFtzLIfHp3XWZ13baro6Y4aiPEguObopKISYg0sHd7lg1k0C2BEsHchxh7w1+aQCT1oynr+QNAOjGMM752y0f9YAXOzd7LZvXRm74gdovoUOJeLEFmg9Aggt1fRyQzNJTo7nbA1t/vQvfESpUoqu9a0DbKlsnP13bPGq47u2FbsE5RJJAgLaxHCzc3/R78oNAXt9ZrcNtypLeh1qUtnjZb+ntQlXlFxrHf3JWddK8UOqp1N+38TEP7aSTq75IBqgfqHXY4ZhuI1iv2kpAxb9TYp4i7gLiY1hkbc+4E0n5oJOgjmQ= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3328; 6:1X55IANZF/pvCRiqxTOPtLIOwLtnW5LyqU39k43RQyiuSyCiJh1/Yh+gy8hwdwJ7pwCcstH4C8g7ieUuw46FBDzp6n1xVuiKfw/AiD/E+qeAKTqNVbLB1OKw4rCvoHIw1Ewcvxq9U7wQG0lkQAgHpSEmepvNSZ1VQnLCMrI8af/aCT3ZwCA1E/DcF1NSmhco5vpuSADLO7K6pxt4NxKCeFwCgqWfNPekMWXukE9IbSGzjnaY/5Erlyfvq4gUEYIMAKIO1fI9x9iZqs1PQ69+ySXtGJrKIHztQbk/uhzLwjr1YL8MCIVS3HJNj6iiUCvv4xG02gCfymZHe1z+LGwDfA==; 5:ufWwXh7OMjvizpX41O+ENhV5sRH4CUUqdsln85MrnLtTQtnhhHG5E2HvjPcKDieYgpQgEeuCh2z3rIi2TXtDjGxWOD2ewOf4dYeQ0X7ldKzlNE8mJFwBdHeM2ar62pRP+Oh9qC6W1W/WEFu6ZOAfyg==; 24:DK6xs/qTNzcZQnTC5JnMF9jlm/vukL0+8E4pe0TP9+tPF1K5OOGDiIx+boh5m1E/fzE2hyd/mmgU5aRDOy7n3ZznKjlxm4zWL2lFJtkf/y0=; 7:C+/Ncw0dNaF40c5TubZPO7/s66RzBbeieA+HuTPkGtLhCX+cEyARQiXRIUchpIdM71NPjNG01euLcchRJVa4zi9ZfwpEB+9kLpSwFaqs/QVUjpn1txVUzEUsGhhEzHGAga3d4iYmtnLewl1Cze3ZrBe1/W0HnZ40l94XU4VaATXMkJyzgcnM+3A3WaFfaUQKDCdrEhEwt9q+LdL3giK5K9aGAcOvlBO40R4hW/BXsOM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:34.9650 (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: MWHPR03MB3328 Subject: [dpdk-dev] [PATCH 18/27] 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 Aug 25 10:49:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111002 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp813488qge; Fri, 25 Aug 2017 03:54:36 -0700 (PDT) X-Received: by 10.223.176.72 with SMTP id g8mr5193460wra.117.1503658476011; Fri, 25 Aug 2017 03:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658476; cv=none; d=google.com; s=arc-20160816; b=q2teisoiUXHc0D5xSX8q9/S67QhM6CYS4Hrns0ayoFY9PSyUbh1Ny0EbqYjLlGcBvt yNHlpdNAbJzBOqEV+zWckZxhXLE0q6I9OpaSfWSnZzaoBCZssxyI7AKbPPjmWKyKIBzK fkek7HclACVFvZn2SgNPaQ2oeU7JeT5ZGLpRaTmOISAfQBb1T20WSXlQPmlQGyEplPEA SNLYDWYm6r+KyFgOee9+DakOIU5Sj/Krwly+6uLzQ9RbfG4dMnfCmOiKyOkcI7jW8F55 ekfpRWbXBoJjjzN0dsKo1h8Sf4VSkjEJ1RG5Myc2+4B2pE3J1ipDAfdHmEfN2n6r1fu0 ukNA== 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=sKibeukb36x6IJzp7xONLd4P3HsX/ZMaudrGdyqI/vU=; b=jw5Fv3C9ZEDQ2kbNJd6J+pLSLBlqBF4gGwhGPU/Q1HnG1yPCeImC4GFaw1UNpNtgw1 Aha//gZj16hmBXilxLk/gKLJJOdpOfhNaRMy05dt3nWE4ahPH5iPNOgendfteAdVs6Tf J/t8zHGEgqkwKd7vRLRP/NCv22S95Z3ojlZi9aWfd9huNVmShKFBLYu7zNNX+fIJfauv 88jZ42xWNWutVl77O8tG/lz8JwZywTojtxP11Vox5ZeKrEDUxDm7KAlRaRN/zc1GTZhx 8nZ2QUQjR6eTXIZpTnj68lt2Y7iDLR4mJOMOzAkdANi7WqoNOVZ27/G48QJxKVUEL+yB pejw== 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 v193si1033159wme.133.2017.08.25.03.54.35; Fri, 25 Aug 2017 03:54:35 -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 36BE1999E; Fri, 25 Aug 2017 12:50:45 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0073.outbound.protection.outlook.com [104.47.38.73]) by dpdk.org (Postfix) with ESMTP id CE6279989 for ; Fri, 25 Aug 2017 12:50:38 +0200 (CEST) Received: from BN3PR03CA0113.namprd03.prod.outlook.com (10.174.66.31) by DM5PR03MB3322.namprd03.prod.outlook.com (10.174.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:37 +0000 Received: from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:153) by BN3PR03CA0113.outlook.office365.com (2603:10b6:400:4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6N032070; Fri, 25 Aug 2017 03:50:34 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:35 +0530 Message-ID: <1503658183-4078-20-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318367136880; (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)(86362001)(77096006)(47776003)(189998001)(97736004)(85426001)(50226002)(305945005)(2906002)(6916009)(104016004)(54906002)(2950100002)(626005)(81166006)(8656003)(50986999)(5660300001)(498600001)(76176999)(33646002)(356003)(8936002)(106466001)(81156014)(2351001)(68736007)(8676002)(36756003)(53936002)(105606002)(50466002)(110136004)(48376002)(5003940100001)(4326008); 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; BN1BFFO11FD034; 1:atPXOdDcIhuFKlAkFkLe4LqnYXdUnY78degpqoCsEqQ04mOmEkT/LYwVqsVljQLmsWJAWQOOUS0iOVa8hW0T+T6udNnH6YYrJqAsqlBDenIH7a5B+8633/TAAEaLxyUC MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0abc14ac-aeb0-460b-8c70-08d4eba71e56 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:j5JXlbHTVnfQMZmY9zAcfUPz3qEmDxwdI+WcZNgfjWMKbx7avao5qjhp4Zn9YrcOwIxPIfur3JkYpHIxwH35v8PIvkFTjHa0NDL6cRlQC9484j9evlUi7Zbwp0NSbOIXEd/lF/Ns0eHfRfr1cdA6uMLByl4C/QldSPmC/IkP7hENdo7e2Lz/MAFxNpzdfsZoFMoAB0pdbo018DrTc/U6YffjXmxDH0cfWygEZBJaw5bU3rJbYGBXrTGJEhEVfVkNzQRB2jLzGAr1wOqqSoXWyBQRl0mLK4piWrslQzvEQJ+jXroVHSHLJenecpsBwEiki3dnB9VZ63V532yiCpL6CY+v0SRFydomKyW1WScH5Ps=; 25:MtDMNcjkZ1qexO/+3KCb7KokXG+7XOcjDt7gferOfLHPiLq3C8H8uESCxbdGTJBLBrscJNrJS6gNlTcO+DUVdGQb64+QFWznIf7tZ4aUWZ3joeEwMOY37wOxkGdZJx/30DXu1sNS/4qKWMvCxvlTUveilazXuk6XTNEVM409iwcZFUHGiAnImL62rF4Z8kyC93NK3aZfqbgnf9WN/WD9ZUAwjAelm/L5Z2rw2J5HEZXMdjecTN9uDVbyELhsMBqgJSCvRTyCEJH6scU7RuJhx0nOgQ8OVyhWxeJtfNb6kS3qGDuf3071Ls2h7AzO8oiKljEmB3adJAOMKUusyrZbJg== X-MS-TrafficTypeDiagnostic: DM5PR03MB3322: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 31:/dFd1CDQMdjX8OpTbgNKOD8ltVsdF2CxtzaKepGC/8HithtMzu+8TTBBZlSdtukvS7PISYlroEIOKTJrUx8muLS/9wS2QF9metxE3GUtFAi0XFkHxQNNsXpn+kqpBAlXuLq6xoQG383urswqcICzA2CPBreLbADvjgEwCNiO/Yv9JuqGfMhbzkwevP/6lM8l3ogaA8CK84XjiBoAPVFtWHfsFnG0rDBlzGS6qOG6nZc=; 4:4xcmvYfFpIcZelR8qLUffR92mOiTucGY+Ki8wqwkfZ6AdVjs3wZKHe54tfPTEP662e/HKPzSVx0KHf/9cwW9+3aD1CP8LV6zpl0eg+Ii2n4Jh7o04nUFwlPsxLIAPGdQN7yMiBe1kleNRalvSktIkfePaNsyzha+GYBdUHUrWFYd6Q0npweSwjD9tq4xcvK61Bu2Fe1T09+OwRGDGn1zvh7ZfGuzbwshgHxhWFrZ+lPlhPFBx3d8zRmj2veJK7T/lzBGcZ3P5cJqtegPdY2DwlAO8D842UsKH/X7p+7th8Y= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3322; 23:UkS5/WvYC5f5OYBBucC3OE8BtfWTLtCp46vOYLZL1?= G8MJPaZryy2NzjJz8CjJ8JU/ygbwRw9OHm/kUIaQ74Y8rbYG0ze+Y3rucyqfgc6EqUHKdX1zJ0KOWR1FHWTHq3eUdAXuxQ95aTq5M/xxEYq/1rO8mv6eMd1QVKvsk5DZ1ACUs04n6tsRaEnCt4MP8Cmo5f15ENq7ysJFrH42oMoVSTJ8QPGU6hHODD3rR90quFtG7cnnn5Seq0ZaZ/T9Jm/X/jDx2sWV6TUxour2gXRogM68Amc2qyI6Rhs2lLNxkjaBKHAFPLBGLBRORhxCsyfWbVbO4CTcu9YJqDoVRioonmsn6o3Aow0q+CL9b5o2mw3s2jXHOU/bxqKL1qJDSKBkuG1mWLRkIUUvC8aw/QeUYngpYpwAEWGKjbWkBaCz3JSDshaUztuGQ/1Oe4vJzb5QIEqUN1z5NAMoHFuLxYiDtJWSb0jKS8q7xEM2sDikNEz2/3gEJ6Aj8w/4oHGhLAA9gekYz11+al7YS2bmeZnFI8iwiXB9kDImczdjqnG5YxEpe+2/wIWxwU6JkYAapEcH0UZWZ+4jMGmKv6xy/CyPpVYG7TbyX77mZdV44Wyjw0Fk0jQ0qYLXy6MQ8Zulv85s/HlGnVCJfPA3em0aFS6XOWxpoJB6JF6LgacShVf8Nza2oF8sSOVB673ErPDy+UkWUKX7WNCBrd2zx6U5a6Aa2hup8p0Sn4vWPud8XxntaCMjS8cSnuEWH2UntFTqiJc+fb2++PYonGsr36prW1I5OngweH+gTDKC1LSD3K5jnpTnfADvBw5x4CVFDH3CPIw1jbt3+CsSirwOwVCt8uU5L9q6rCp5iswymWt5lTJyFOyRh7rXVPSf2LYVuPBGvM+y9mKtcdkKactoKecq/+VDZh6W0LS2Cdwq8W0B3reeXsAc2l46Mte58zVLDgfAYfIRXA5/aWyo0rphDqMUCXJ83qBvfCPNIVO40zoKvx9YgcS6InJK38Vddg+zt0Uj/ls5oMQ8q76P8EXB5RvUSSpL+JCTACHEu3HZF8+CqBQZRnH6Fyc/vW5rbKvzqCPi/I5DuzLEB0nTbPuTA6NO1+s8PPbvUkQCNnsy6WGgmx15+k= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 6:BSWMlvl2bwI09Nh3fKAwBsRjtoROQ15Ccr8fdjXBAAQmEsZD792sRa7hyLAncZjszyhQiDShr+s2iJ4g3q8pcljHD34bsqkUg12yaaeangNB6GZ117tZB7l/kp+QWyctiotL2Ig59viE5/iW1yJLUnPbH/QMFTx02XT/IbUFUQLjw7naqv8JABDIbTNOwQE3LAvA+moSKd3a9g2GYZj/M9nCoWx1b9kQihdl1nfpA2Latx+A5cXddKpRA3qfykmdRSWU7Sgk8AbgFIcL92cXh1qD9ieX9rrxv7bSGSwFG8ZLuFoL31eW5vl5/mxGIDFfNGthK2APZKXdpim0L/7wLg==; 5:VXfdM2l5Ixwoe9QZCb6G3xe4v1z0SiUsYnL0BXAg5DMQx9tQautgl745BPaJF4riWKYQ58ZQrIebk3p66do7nwXrzpkfEPqy/rcUVkbLAGCzMFAjv5AT6UPBKIG5jC+HJxiy7f0jDTeVtRMAkf3a7A==; 24:AlGDUbhkr0jOVQdr60bcpPB6/SHUmQrS4Qsz0JrZkUsT4BqIh6O6Mp8WY4FlmwwUHk49chvmYCR34tiZBah9kTOskmBVCaJk4hQOeFGUSbI=; 7:EMzdOub+MftWRhqZq42iFITfhLGX2iLAC5hWAqD6CJj2NqXv/1u3cBpsFbibV/Ri53FukCF5hF+64RfMexet2RGrVFLMCoTTBW3W6B/AYK2LAN6i3qHyrJNuL+QivwBUNqu65bxMl5ycbtJ/XOzXQGZ6hpgfukosiY2fh382T8IJ+hJPdv6JhkGac3Xw0TiB/kVJFdgguekJ/5rppsNSjibHFs+UGmfh2wnahy58PJQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:36.5420 (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 19/27] 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 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 49dc42b..5e5a71f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1186,6 +1186,7 @@ dpaa2_dev_set_link_up(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv; struct fsl_mc_io *dpni; int en = 0; + struct dpni_link_state state = {0}; PMD_INIT_FUNC_TRACE(); @@ -1213,11 +1214,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 Aug 25 10:49:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111003 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp813675qge; Fri, 25 Aug 2017 03:54:46 -0700 (PDT) X-Received: by 10.223.136.104 with SMTP id e37mr6035564wre.152.1503658486165; Fri, 25 Aug 2017 03:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658486; cv=none; d=google.com; s=arc-20160816; b=sO4A9K48W7JAAWbd7R+OhU0Nxw3RvsbrH44FNzyLXrufvBuY/UoUfakQyoaG1qSVkw qYAYkOAVU2Qmwo8abrTLg3LkdtY/vmMpEFFan/v5oRBr4nQZlcNslz3sjFcXyO/0grgE gTyVuKVRz4B0UVLogwvIEzz0qjLKd7ZAG0ITi7jtiHJBBKLJIXO2iSjY5GvB8Avh5xDh pn2rUrdaGwALfZQBD/gYZMQgHU/DBSX4Eh690w73U4OWsmhUTGJQsvLM6OZY2Fz7hVrr ji7WZvjj49ta5Sbjeto6oxH2P+o84Au+xpRzfuNkw+y4YwNgUni5ExYUOEvgmetFh/Je HQMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=Xcji+MK5vJrCf02MvxAXWCw+7EdMD4wCyMvSwo6v5Po=; b=0dfa7OsrVGN4DCetFLL6BYB709rY6HX2myWY4cHCqNbqYlMbKcwnOZ9hH/kmEksVez XaKZVfvM2CpvhDyB4M3UIqJwvn9Hf3Ic5rbboWrWTEGZU8mygh/C1zyFt7fUfpkcW5V8 LjpqzDUK8JQzUjWwj50OaB/2kPcNIsudHrBeFiW2LRdL55eFnfi9XZMePHuOvxlAU41q EPorXIzD0nxIMPjCEB4EXhO+kqzBvGEqYFlOKwoRWtXY/6cEIqG1/BUoXKL+WJxsQ2R8 SrYn4SDq/t0L/vpU/oOGFrfhKPtOAN4imijKV5W78zj5SArZMYrAuqhRywaNpELksc/K JT5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k81si1045099wmb.157.2017.08.25.03.54.45; Fri, 25 Aug 2017 03:54:46 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 74CAE99AE; Fri, 25 Aug 2017 12:50:46 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0043.outbound.protection.outlook.com [104.47.37.43]) by dpdk.org (Postfix) with ESMTP id ABAB4999C for ; Fri, 25 Aug 2017 12:50:40 +0200 (CEST) Received: from BN3PR03CA0103.namprd03.prod.outlook.com (10.174.66.21) by CY1PR03MB2267.namprd03.prod.outlook.com (10.166.207.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:39 +0000 Received: from BY2FFO11FD024.protection.gbl (2a01:111:f400:7c0c::169) by BN3PR03CA0103.outlook.office365.com (2603:10b6:400:4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:39 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:38 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7PAnw6O032070; Fri, 25 Aug 2017 03:50:36 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:36 +0530 Message-ID: <1503658183-4078-21-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318389722543; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(54906002)(76176999)(305945005)(81166006)(85426001)(97736004)(50986999)(5660300001)(498600001)(189998001)(48376002)(33646002)(356003)(53936002)(81156014)(2351001)(50466002)(626005)(8936002)(8676002)(4326008)(106466001)(68736007)(105606002)(8656003)(110136004)(86362001)(2906002)(47776003)(77096006)(2950100002)(6916009)(104016004)(50226002)(5003940100001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2267; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD024; 1:oI9/VVEn/gsJmvgFAlrq+L9TARiC71r7QifQ8RbqHDdkNmyj97GYm28Ul3fHOrfCBeT4uFc5qr2TrrtEtRFrSrT3lB9LhTPvVBcAzUQJFXAb4IQt9+0UZ7WG/Wl+n3To MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6a492ee-10da-4245-22a7-08d4eba71f9c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2267; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 3:0BPpMUhYiLFo5aPTcbp/044WddVimV055Sb3pQO7q9u2qKgZjmjXyZ2zpNHiY76iUjcJrSlUqgHEq2t6cW2DU3+BvR7DDh8R4XTfKmYdAj5Y5mWKw4rno1cixvIOYqMiQZwiJZfqO5al4etnch75eZYHBkRZ6Q5jpJ1boIFZWomacpJVqFR8Iu87ek8QSz4H5zv66HU7gTa3cM5QvMMlGbeHNn2gn53dyVp9zjYlNd6u7Px8d6uqn8Y29xxpeMFNFIpwLP7fr9PeHLioXVV/z3bzD4kueFyiSp4Oq0d27OekW505qwneXbuDYKsx2mUKCGcXMm3fjRjTsQgHKnr1pBygqYh+DqTYMYLITFOsRqY=; 25:L3q3fIJyAOqRt+0YdQpWsyS52tqixLF4Enao1xQgEc43JGkUxmXazHW2voCHbwjbgGEmU9xafjr7r2p1r2HW7WL+IAw0ywlMFxbG8oMFn9v5qjIGawDxvL22jOWCkVDnP9qSXaMvVs/qtB5uPLiuCeWqbzN9An+dTk+9vdf+2F9vdhiFMC1O+dzPQm/ihpXJD4vsI5LZ6RPC27ZyCuMkjI4GeuQpHBHwDJ4VM7NqYZD/sD0xI0/eGbDftdGWfSbuIBRxwlVQzbovaFYfDBUvburLUXishbsmbDxEVCQlnH3SxJUquZUWE4mkOmU+656pJNsPEYLUxzsl3BBFWZuCTw== X-MS-TrafficTypeDiagnostic: CY1PR03MB2267: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 31:F25UADQTgiUpwSrVD8gxKNDTkw+ZL3wiM0n3buhAWlic+bCsjTuj1FoTeETI75+0uw4HMeYlsPI+cPND5fqPvxKIBvt6h9z7p/kO7DJhvdylFpIKW2su2ZURbc3Zfi1GgdM6NrLZFmhky9WfIXW4Jd2Vk1rGBk2PRXdJQLuMGoJYa0JeAZmDS43ofRcKJaEtNpP18sUkDzyDa7TxKqzpYoCWM+yZmEb30sMgu9d2LkQ=; 4:4cvKbqUNJ7+F8DDZbztpnP8GX5KUTBaPUyB4BZCMGJY2Zg+0Ar2+yv7Y3b2I9fePEhzJIiI9irfMSFkBKe6l74fPCochk0KbQDDCyMOKTYTMzPSh5kVyVd6rJc7ECm0971D5NFVMQgJUeY9z0XzslOqkj/lAYLMnDoGa6XIhiJ5h5FQ1l193PlKgzOB8rAOseDC1xBL1v2uTw1o+G1PQEhjQN/Jc+Ao5T9l0SGBA1Om9Y+dyUl6CBkp8hynHoBy/jk9k3ZF1sHrABgTLBiR31uC8qlXoLruRtKgMQPbrGEA= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13016025)(8121501046)(5005006)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2267; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2267; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2267; 23:U72t76AcYa5bxk8pU89Qu7znpL08Obc/NDBm2hioA?= rfz7kYVzCIx0BwuEfTt1vnI5RE+BWt4Hp2PV55sIoe0LVicC4xmi4nM5gk0EIMjJOi9bpb8+IcyufCRZnQz3fnT0kzFqIRByU1CG5lFLHiFlBh6ujz/t3k6yIux+nmWfrYjHiYR8FJSjwVt3A+uFDEJguKAQWwVadn6imJAJaytCaPuHAEy/kJ1UhYuWa3JbBfzlpMKHyczeigyDJsH8FWuOw42+xrMQMLa4C4hDOuwl2r4RepcqTDbRIOAr97twmR5jk+Ufr3uL73M+TOeEsdTbgSNZTNN/Q2vjvi+WiMziG8Hhk7Jyb+CMaFUeNQjcBu4L9bhF25MYCwxZl6u3VwOXtVHo59miLJnBhNa0gcH9/o5JCWWW7WXPZlzyp/oFcmBhqpPAzwCqlw5xodOHNVa8prY0imbAZRc68Zq5AS09LbHahWW8ZM9k1begZed0b+s3XJuC9Rzw46QH8n7NuRBzMKLJ5WwyUwtg1mED6/d1psr1+TDuzVrjfKzXFgOxu8sR/hI8jwv8U/MESJCH+NIlEgLeMituJds3WkLzghCf5V+QdY6TMIYbKj/J+d2lVqxIBkW9oQoSsFU58f03f6ps6tzE15rQdfUKAk9RgJ0PDdlbDRP+ApjSBTh8vv+5uTIQl7l/XyNFQab4xAy43LRLTDNTmlQqCT29VseI2K6JuxkEvz/gXs7o2Bo+idl4IW1bIKfjynDk8t9XpXT1L0vavoUG1sIKKdbO383Ba2hfsW9TBdhHOQCynqcjrfAMlp8645kL2E7ZV3IGoH2NiLP2oHYFSJkuBCRrgg+JVgbK1BvXyPlX6tUYhr+rJVW3Vyr4pWHOMMHJfG+t16Fmf2nx5I6cPhcbTd2ss1PdH5IBkbv+jrxV06kvDV31HTAFevfuBZb5Op3AGFB08NSgsAqjpTJa4BKcngIPzsRgReUGsUBdZ5A79wcoCfmN+3jeqL2+YRYYUJUN1sCjxXEzFrzAexmgPxOnZNZdBdOmUvufVUB8vqKHdb439CX4qXADHJx5Sgq+VbRotIfW0zxuNhd+J2PLkkScE5EpsYLOt7hJVMJdtzLcfCkppigvlkWZ5g= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 6:1n71f0koFbbnYW3OoWqDwPGkzhWYsamgW6rxgO8mZy8Gld0wxdQpeM+VNCL9QjVv2nDPD+wxj+cRwTPIJH8Ta/prTshtupKX0uk90e/bA1ZoKs+sygDx6a9rs0F5JyVH3nUFv07NtaM5lj32u5BV5Dx6vG/Qz01atTDJ/foNR7Ukmqxu8Rt+1c9IWDmI47cyJ5Lm2xdOSnudue9pNuvZHM7byaA2hr3SMbcICg7yx9Laku6cQYRIUGBar3Jm2rf2lEOp7R2RJctURqBfb2rPgP0c8QEI892nGORuF3Ad1yMB8I+RWEWw6JgvC7dGTAmjuUwqbeMT70hSENIJSNisDQ==; 5:0e1z14UFIGC9L8bcg0264Lfs7PvzIlTExOBAdDIUZ4ZYxBgSfmnn6cLIzUgDOkAYSRFC1m6E3oiZqPnZ0BngoX2J7wj7GGIvwTVxj3bY9WvBM3SAKLg2Jrruk5gzXUOp/z5OEKjoVHEzx6CiLmJaSg==; 24:gIWiweeFlBQZN3JGWvfUpdf5c1dsDKvXV7JnookONZ9ed+1OOdEDFcELd6CNvoYxm2fbytTtpxrIFv0dlzUnrvVBeRcjEVEMiMoNcMdHaHE=; 7:ZA3Zud18NPr6sYzCPlc6LH3tsIn+9YANRDV+Jq9e5WGQ+OuvdgcibIMFQ489/MMTVcG03RBEzBKwz9W6djVwbEhAJcY+zJpbOv0kCd/R5fXc0VToReUFvJfphRpK001qiweNc/ieFw80jgtSMj3bXQp/eFnpn00W2i1yTkDsFBU8uOKLczA2HB5j1JtCv2eFtOWonjRDyZ9O2gzxyySrGEWAb+XzvS/3LLl1Lt+i3dE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:38.6446 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2267 Subject: [dpdk-dev] [PATCH 20/27] net/dpaa2: improve error and logs for flow distribution X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 39 +++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 1269dd2..7e5ce64 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -49,7 +49,7 @@ #include "../dpaa2_ethdev.h" -static void +static int dpaa2_distset_to_dpkg_profile_cfg( uint32_t req_dist_set, struct dpkg_profile_cfg *kg_cfg); @@ -68,20 +68,26 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, p_params = rte_malloc( NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE); if (!p_params) { - RTE_LOG(ERR, PMD, "Memory unavaialble\n"); + PMD_INIT_LOG(ERR, "Memory unavailable"); return -ENOMEM; } memset(p_params, 0, DIST_PARAM_IOVA_SIZE); memset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg)); - dpaa2_distset_to_dpkg_profile_cfg(req_dist_set, &kg_cfg); + ret = dpaa2_distset_to_dpkg_profile_cfg(req_dist_set, &kg_cfg); + if (ret) { + PMD_INIT_LOG(ERR, "given rss_hf (%lx) not supported", + req_dist_set); + rte_free(p_params); + return ret; + } tc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params)); tc_cfg.dist_size = eth_dev->data->nb_rx_queues; tc_cfg.dist_mode = DPNI_DIST_MODE_HASH; ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); if (ret) { - RTE_LOG(ERR, PMD, "Unable to prepare extract parameters\n"); + PMD_INIT_LOG(ERR, "Unable to prepare extract parameters"); rte_free(p_params); return ret; } @@ -90,9 +96,9 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, &tc_cfg); rte_free(p_params); if (ret) { - RTE_LOG(ERR, PMD, - "Setting distribution for Rx failed with err: %d\n", - ret); + PMD_INIT_LOG(ERR, + "Setting distribution for Rx failed with err: %d", + ret); return ret; } @@ -113,7 +119,7 @@ int dpaa2_remove_flow_dist( p_params = rte_malloc( NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE); if (!p_params) { - RTE_LOG(ERR, PMD, "Memory unavaialble\n"); + PMD_INIT_LOG(ERR, "Memory unavailable"); return -ENOMEM; } memset(p_params, 0, DIST_PARAM_IOVA_SIZE); @@ -125,7 +131,7 @@ int dpaa2_remove_flow_dist( ret = dpkg_prepare_key_cfg(&kg_cfg, p_params); if (ret) { - RTE_LOG(ERR, PMD, "Unable to prepare extract parameters\n"); + PMD_INIT_LOG(ERR, "Unable to prepare extract parameters"); rte_free(p_params); return ret; } @@ -134,13 +140,13 @@ int dpaa2_remove_flow_dist( &tc_cfg); rte_free(p_params); if (ret) - RTE_LOG(ERR, PMD, - "Setting distribution for Rx failed with err: %d\n", - ret); + PMD_INIT_LOG(ERR, + "Setting distribution for Rx failed with err:%d", + ret); return ret; } -static void +static int dpaa2_distset_to_dpkg_profile_cfg( uint32_t req_dist_set, struct dpkg_profile_cfg *kg_cfg) @@ -276,14 +282,17 @@ dpaa2_distset_to_dpkg_profile_cfg( break; default: - PMD_DRV_LOG(WARNING, "Bad flow distribution" - " option %x\n", dist_field); + PMD_INIT_LOG(WARNING, + "Unsupported flow dist option %x", + dist_field); + return -EINVAL; } } req_dist_set = req_dist_set >> 1; loop++; } kg_cfg->num_extracts = i; + return 0; } int From patchwork Fri Aug 25 10:49:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111004 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp813834qge; Fri, 25 Aug 2017 03:54:56 -0700 (PDT) X-Received: by 10.223.150.129 with SMTP id u1mr5477150wrb.329.1503658496615; Fri, 25 Aug 2017 03:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658496; cv=none; d=google.com; s=arc-20160816; b=VIAulJxJu7PEZmUYEXzmDrhL9c+8nePOOFt06tWx3QR5+IiGAHw8T97MRXDRCmfobw cZN+jhLqSCW0Us6eolcxn6pTYE+2krXSLNMSRbIekmQCbicXNjVJXgTkAXSYeOrxDJIS FM/kLcY8aKKai322G+tXuEd1bCQB0x4OmnCPoGwI0yC78jhXEqQwk/kxCCBppA/ZVzqH u39SG2XD1UWZAz9pHMFuvHQyacgonQ0OSZ/xvhxKKy+MSaQdrWVwAx1bK5DI1OoXu7xR +UP8yS/cXUZGO+IdPvGTpHRLcWjvsoWdMqybwzdC1Xo+c1rcUB5+T9mDLYKv1jaDJx4P YXRA== 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=UiwXzzx9m30opVIkzPtKj6+l6mvozB9zGisGPwAD+YFqP37MGaTTL+WQCGS/GKqVMX jiyxxP//ZIijEZk3ja/P9Lolx/IgBkIS8LLRBUExGmhxIeUILHDpmCvboHIuCHeNWWYh 6DG9++xbJ/E+AaCIDM7cPHF49xntfDuENvRhH7NM6M55HMD69fYVhCEnsB1yJTS1rFfk oIgPX+XyVzs48Y6B0xiU5AfuZFRnQz9BUuwGuxfuMRg8ZAJiF7wMnaj1Z7ZBxe5EU7yU dfOB1JXXNjdniIzyWgiHTnswpuIasyrAlj3JA8SkWOQ7gnYafXGNqqXWw0mrxasPSWt2 aRZQ== 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 x42si5074490wrb.449.2017.08.25.03.54.56; Fri, 25 Aug 2017 03:54: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 5C11599B4; Fri, 25 Aug 2017 12:50:47 +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 8DC03999C for ; Fri, 25 Aug 2017 12:50:42 +0200 (CEST) Received: from DM5PR03CA0038.namprd03.prod.outlook.com (10.174.189.155) by DM5PR03MB3323.namprd03.prod.outlook.com (10.174.241.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:41 +0000 Received: from BN1AFFO11FD033.protection.gbl (2a01:111:f400:7c10::185) by DM5PR03CA0038.outlook.office365.com (2603:10b6:4:3b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:41 +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 BN1AFFO11FD033.mail.protection.outlook.com (10.58.52.246) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:40 +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 v7PAnw6P032070; Fri, 25 Aug 2017 03:50:38 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:37 +0530 Message-ID: <1503658183-4078-22-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318407135254; (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)(8656003)(54906002)(5660300001)(8676002)(81166006)(2950100002)(81156014)(77096006)(6916009)(2906002)(8936002)(626005)(97736004)(305945005)(356003)(85426001)(498600001)(189998001)(4326008)(53936002)(33646002)(106466001)(47776003)(2351001)(50986999)(86362001)(48376002)(5003940100001)(50226002)(105606002)(68736007)(104016004)(110136004)(36756003)(50466002)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3323; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD033; 1:md3+H1dCpTFzCrzFlCORTSmzWXZJkcglUnLxnjovFtK8kUb2DljHfoubmJ4ofOdrM1WRRF8gTB8uOiDaMFxrplbQcLOnDlSD4oeCiLBcNZAQYMKiq0CJpKqRjBBDhGb+ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70ce78d2-e82e-46e7-d506-08d4eba720a5 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:DM5PR03MB3323; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3323; 3:8hkYUuU3MO+Ky4Ai3q/7V0lJDQM2UTkxRC7Cl1ui5fNV/1L88dbBj3Wvi/lGlh05OIdhmCxfSu13GuYcerPEYwumEPvO5pzgzvipp/TXWvagw3hycPOLDCq72/U7VFVJw7fpVeRuVIzDKJ8fSIxMPLBRSmfM4sAYWmhGErY2q2EY6/gD+9t4e69dsPebyt6z2CbKNjMvdAM3ktKt1lM22ON2W9gwYBr1E/NJNgoUYNan8+xhctocWTDRiVaBtS+pAL8CrEib29dJ3tMsybglyeGBUWUR7VNgQ3G2c2VwqPGtKePTL3Q5iK8ZYVcc0ReVtEHLCBQ+GUQoHpeD1ahtwwoqyuXrmPvIFLBaNmwbMmw=; 25:U0vrOjB7HUi8JS6ArDpafDuoZrkplIZDZjvf1FV0ac9gmBo72ChDih1/CwEMKPZKxrerqE4Ggi5EzaKnkrEja7OIKa5Fxqcq1aDgg3l2NphveZttCcWxHoxXf7I/bAMdJBqXSJIbj4V7f8AXtyBk81TcAdyvj1XwlbsT+Uxee6rRNofHxaBPWnYCegpz6DzivUe9t6N6foRLGWsx1Wl1qvSZDISRbYuyJ9te9fHV6gjJKZrgAg0lyscnZ+e5+ut2SbveM2HKbXf2koaIieWApJQ4adLSKH1z+aN86pSYRzN2Q0HQqiRfPl0FvBOasoTnI1fRmQXcrSO1gTXkFbBW/g== X-MS-TrafficTypeDiagnostic: DM5PR03MB3323: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3323; 31:PWJlNDaHRMAga05KOmfXccRDGnSzGwxDxtLqdb2I+Kh6srGG8dz/JC3OKHSJCAhN3F4i7A28M1ijTP7Rdkj8Mne2TpnipmQ3tr2sAuaMdI42hfTtvbHGAltP8fzg0uViAh0MlVosl9cPVqj82y2FELfo4LWlFKlvFor8rKlI3mqHJmaT7rOwJKsy44uE0182NReZ3dsxia8/Paynjo/58ncFEDOyN1Evvm29Nu8mz5A=; 4:JtapEkQA+bfWZBftAG4WE/iG3cK/UJuR+zMut94Fg4g30aZIwCpOq6uzmcRS4VLM6F54a6+Bmgjaj3wfUq7bnMv0L7o8LYN2ZlDEjLrXGOgCYBcttDyND+OpHHJEW0JH1zPU12yaEkjL8WK+QkYP2zLtostbkb2v+fsbq6o+njapyYV1aOpKVZS/Y3i1gNSnmvIMGz0kAKA5Durg30oPYUW8rrewJHYBfscv21aaQrDRp2/2O1/M0Kf4PAe7bce7HSCmAiKem2AjFtEk8Z+8Mmos9ZTs72HsrJKClEEyEQQ= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3323; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3323; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3323; 23:8FuS0XJxKgQL6zPxuxXJqHF7nus++Mwx+clgR7ZzP?= 89l1mEgiBpU02bb39Av9BOaZoHn/HjIphqpenSjNUpqIGhkqANQfiHSUTe+YemUaXtkNQkNFVZySesEHeuIV3KnFLtKsxWvBVOhUtjBVJIZbkYzUz2cp22oFlbgTeSWHgc4GcCitOINiBuzwcks8DvEXp/IWKHVwVQqUJDTT0ychRTy0wSC5GPVtj5EAINAOiVXyJ+0cYyiUyy/4lZK+5HX7L3QLuQe856lLL5Niiioe0b/D7Q/pKU90Kzu3vr/DFQEOGRHYaKG0N/GNYs8VaICWDGnyMif1KbkwusjT1Rkb5NLsStmAh2HN0iW3TUn++0yqO4dZaJYrFLZZ/2VMqkZ3l76fhOEIPjkJTxVjiNH7sEQeGECKLRJYF7NqSY7KkT/JMg93xiLbk7EUQg4oC6U9ElK7jbAisl+H8xBxGFQJ9jkiXgLIO+xIo9J6GjWGa4L53exXQaRxBcxy64yKWHj9SKrOXQ8gL5DXQrz6+IhIbxAlvBpzRea86ndtnnWg77rI1SuF32mt26S342DaJJkRriaV4lMAHG898igDa7RrQEzLlALd1G8MfT/+p4MOhavTPBGcRY2+k1myGGSRAaAiATQSyUzhe+8MGp/XrkuPGdWaZSKelFyTShEpmNnmjyQeXcOb5L0y3W45X5JsG5vLYb9VSUJ309S9h7dh4IGne3bQY/lhNDK1J82XkX0H9CV2oz1S5xPr1MkpyYuYixHUDY6gy4RMY7aiAfxYzGr1dxYx0Cbnd6HCSDv8El9p+P9E8KnP/pt+c8JBXjbJ3m48IDhkJQhHt1isEn298hITZ/Jp+Y58vaDE3yem52mOPP7/MZ2+DV3Vz9r1QsvQEybLHSmWx8QNA6NYV93OJ8CpNgv9lhxMm1+PhrT/a4ownB/AzNFHI+QpjDN+iWnc1dN7u0PkWxm4DafPSFeAgBjVz7a3SLo6ehKEvGk1AosXTSW4Mh9zDlrHh2NTo8NC5CMCuWqMRd96TQNrn0J1snD99YoTS3eZMI5C3FXULTma5NHZyPFxW5/sZkUrQZ5nVIP675K1wM5rITQmAll/nIa+Bd2plMUgHgTI3kF6f2yGiw= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3323; 6:Qyy07W2po/ksj6zDVLNnJrJ7d3xMZlHt7Enz5DEE4Mz4VAf5WQW9lAkJ5Ce+3WhYwBtygGFvc+nPI33vS37qNIKhrK6hiybh6WfNFdNKElHLBgcQOz0jyDxzi5wMiLZnnpZoQy0AWrq3VddgV3hf8t2w0+DKi9R0crpuH2eOZXbLr3wgbSpkYj3iZ/jK/yOiZeszkT8AneE6sBXbA7uSwZGM2JRbYIKo2nr4c2oZz1Jdk7rZvk1J9PqNb8OexbTgkeCqd+4PduM2MIikXNXLAhZQrQ1GfAMwS8ArueZoEGWBUVS84ytPkQqXZgl3AYn5msvzdt9LLsI09IBjRsl/jQ==; 5:gBJKpKHAPphKGvcEUmDvECyTCJ446EMPYAebUmgmKw3l/rWj5CZr5JvMoFdA3wf96V3XdQKAnrTIKw1GsKz52Peq0BhgYCdeeJTMmg6hRP3yszL2/dP0hpLTYHacHYGM3GGZxT8jcVrT+qC3l5hUxg==; 24:ATtAGOJcwJ47jYRmW1XdrmC87zefr8+0vthJuas2i4BCKC3efZSE+W57/aNoBofExFe0paFP5+XqXmKrIcMrwhMbkfaXKbHF4ThqWGXtgBo=; 7:TcAD2oBLIM0SDuCRlBIRpK9k15abYjpdZ5MzcQcAms3y6sgMQju04650YL8CBxTNtem/LZhVca7BDE2vKyBDDVMUrzBTck4em38r66t5/EQBX2U79AV06A5UmfQh6TAjLLAueUD4+5Wln24F1eU+2FUoai46Hl39aDMQ+jolJ2UucAOcys7UjNWQNhYFYO8bIMqyQLeA+oeMVT1X9+b8djJRvv9NyUMrChYda+4aIqw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:40.4171 (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: DM5PR03MB3323 Subject: [dpdk-dev] [PATCH 21/27] 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 Aug 25 10:49:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111005 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp814063qge; Fri, 25 Aug 2017 03:55:09 -0700 (PDT) X-Received: by 10.28.214.13 with SMTP id n13mr980522wmg.16.1503658509312; Fri, 25 Aug 2017 03:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658509; cv=none; d=google.com; s=arc-20160816; b=XLKbaWr4qHYOQLvWTPxV+SEL9Oeyw2pXmnGoMeznZ2m+pqyzR32xsUB4uFkVw4+Gdw thkhPP718r86tEJ2SpUK5d2lmKrHT97LARHPJ0glZqLXOL3BgeeFD45QVlGQJ1uxtkDB Wg6t4c6jOqgcSLCs8FSOgoNf0UdFIFQiwHICjHZup8xA50oaMkGXaJTlOniLeyPkPw3b Ehpw1CS1n0oIpd8xb85ORxlsP5BHIx/yWQ3X3UafeDyyrtPQikWT8KjeOXN+sFTvbhLk pUlsWf+tUSZUAkhNI5Kw5fcLfgtFFdcwyrntJSSGksWbM+OE3SiABe7CbWoUY1c9c9zL v/6A== 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=urDDE376wYQJbqFY/n685EvUUb/fLIi+4MypYTOAUNE=; b=MlX0K5djUiWl7lnG3c1Z8OR6n5wpk+jlaJMXAQujfn83WrpYjCyNMoURMgjTM5meJ2 6S3ZfV9wb+wXv7wk3s9T3BO8acUct7gEZzNU92hrgcC1Hy6pW608zWOa7iixUqNaScMu kD3XQsw/SxNe3Gpuh8HhLvKo7RWOiPTptqPWo/xOrRPsWQp4dKcluU62lciEepUF1y/H mg5KEht/KUyrwezUALO0NOv5MA7dkQb9KBtC7hQyXuVfipgnMfk4YUXFOX9Lx1nIBRln OgKpHtBX0+eU3T/BY2vq/voPmb3tCzgrQQND8Aq43QwUXQlp4TO3puJXWZM2VD9msIQ/ VpTg== 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 124si1015853wmp.242.2017.08.25.03.55.09; Fri, 25 Aug 2017 03:55:09 -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 6A71B99C2; Fri, 25 Aug 2017 12:50:48 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0050.outbound.protection.outlook.com [104.47.37.50]) by dpdk.org (Postfix) with ESMTP id B94A59981 for ; Fri, 25 Aug 2017 12:50:44 +0200 (CEST) Received: from MWHPR03CA0054.namprd03.prod.outlook.com (2603:10b6:301:3b::43) by SN2PR03MB2270.namprd03.prod.outlook.com (2603:10b6:804:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:43 +0000 Received: from BN1AFFO11FD006.protection.gbl (2a01:111:f400:7c10::130) by MWHPR03CA0054.outlook.office365.com (2603:10b6:301:3b::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:43 +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 BN1AFFO11FD006.mail.protection.outlook.com (10.58.52.66) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:42 +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 v7PAnw6Q032070; Fri, 25 Aug 2017 03:50:40 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:38 +0530 Message-ID: <1503658183-4078-23-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318425035594; (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)(8656003)(356003)(50226002)(68736007)(8676002)(8936002)(36756003)(47776003)(5003940100001)(33646002)(85426001)(105606002)(97736004)(106466001)(2351001)(498600001)(77096006)(6916009)(189998001)(2906002)(626005)(53936002)(54906002)(4326008)(86362001)(104016004)(81166006)(76176999)(305945005)(81156014)(110136004)(50986999)(50466002)(48376002)(5660300001)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2270; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD006; 1:JLkAxmGqDop3x36jwSpTBVlkPSnduCkQd7bOkQuBFUxIJBfZXF0HXHKU1Z1wnyqmn2R4FfcTb7Tjb+KJWuUFk3u8mWX6WtYBRBaaNsi5Fs0BZSKS013kmluSGFs7Xc25 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 486d0259-4057-4fba-a1e9-08d4eba721c7 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:GbU0qI+OhoYqv+ZXEjy+TRQR9fFxlavf0vRmC44uf824boZM1QT5jabdDgJ2grlK22KrGeo8SrXiXxplgFW2HjvCdui8JSIsbbgqUWrHWhAZEMJc6qkH8iAyqT9fERI/TejBZeoPQlx063rpQWi+6bswvjOGft9yPwfRxR0NDmjlcGryy6hMO6CIaEN8w4Ej+DyBSesqVxPaTDoRJWH6DQl9T25jU9vnKe2k2X5xuB7WHuE28idYGQi55qVk0mnBmM/uC0enXZmBoriUgb4VlK8yBQhELxDcGfLOg43sGOOHgHaO4Bm4+N8j0+MtZPDqjlLmNAnYxFWCPciCHwFCaO0VQKJozvedVcvzoZt1s+0=; 25:x0ne/f/WBjiBHieJ3xxo/7Q6+w93hjl87SGbZgGKZuTb27/dbdf2bRnaWbZzy8sADdDE14NWrSXd168RhafOSuDxsGBG+u2Rd4QNE/3YaUWDPOEy/8IT0ZgVZR4dwWFnPeSMFCbTSoamYBqvIj9MKG1117NgOBbJ0W4LBstq1YdMg/DbQtQxljl+9pZz4JHu3ht54eAl82OolXmHiYuuOJdeL8QkhwFTGJQVfeS2sQuS8zOlbXA7XP/eshGHvhQ9Jgflrv0uoH2sJK3I/oT4BdY5jH1y3GBu7lbdofrWnJWtgW3HQZH3qo/5mj1UCBzrWxy6lOdotsoohWH4jMi51w== X-MS-TrafficTypeDiagnostic: SN2PR03MB2270: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 31:90LEbXk/V/NVydCQKy8fOC0xl1TckMzala7yQO1qv3klI+zyTxh5TvfBFL4/cbRflWO0A0b5eTvtuYmmwfa9V/hv74kiIka6G8NlZyZr+P8fTcsCgaHlBerrKoW6k9iuLhXXmu8UWuT67IbNygZEZnVcfPVPB1rXnwjQyS9mrEdy+kpbo2ftiWMvMq9r+VhiXQLYZy329Z0NK3eZCWLunjvde/fFWO4j1H6qa7ylkf8=; 4:ssZe2QpHUYb/deyDTfc+aoTzoPjqMhw1Yc2HIDz9BvCfMw+E6h0JX81szfCdgGp2HyhFl97a0PVLX6facl2R1RRLyuM4kij7NG68d5PxLT97YlBp0VD5PzE8tkn95BkvpQ8noWeKXK4yfUXGM9olbhcS3IkmTyj4l+7dx3TjGDfh0cSi+r3ku6qRNddh69QTZMCZTKnjxEWLd0QyO8whIBIQeUXN2LZouT9j/ILfhupuf/i5/GX1zDIakbz1MZz2oWhbOnPLHLoglv0eX5b/0MHD22Hran3K+Ji/HVel3pI= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123563025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(20161123561025)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2270; 23:Dl4QKB7ANCGhYdItelBJVJ81gr6NvwswlkeLxZnlU?= w17XV/IROsVCMMI4P7mkFdjyEmhH63Cp5lagLrHGrgNEInKWuFRTaUNehXZI4iweAPQ0mWhigeQZHo8BMCd0K+9sXLZcDO7l68qMBVdYidH/MddZMAy1kQyQjs2WDquu3yqNjCAlAupA2B0eERng2xR5WFEFprHcRjOltKoM4EU7FOXnNH5GREZG+eCgUN0i8MJU4wCOlXQmRq4G3Y8sgMsD/ndhEC/edM/4y3ft4/CDsVGbjrL6lJB1MDzkUYQwKUXTWItbUf1aZNY3cnncwVqWBSQw93S4nrOlYEeQqvS6xCdCcTxdpq1JkI2IvRtg+FNsPIbIxNvWN729HT8OaDRcFM/KHSnO8u52dvLNJNTU/GIKtIgd6o68Nj/tiACOnzAWzWTelfpkg9DoOIQp0ZaO9Yc+XOBKzEZrgGJE7DSQaf/MP6Lg11UjDuQVikxSx8yHlL/CNwIqRq6EELe05w88KpS31k8Irc6wVKYFJjtC+OvHg8A1uo999Ubpese6ijBsCZbhQcLi6Phxc6QskXlgSgnHtFLYhm821sa4NgFmJdMjRWKgnCL5ybPB2MKD/VknV+GzjEYEASaugkJlCwoe1+ayi0OfBpGpywSVfGkudFhNbOUmdDyASGLIZF/mheswirw2yf97QV4DVQkcvJ0GblCpNRmrXHye1Xc+ypFxyM9ANOUGmAmuBpDxayqkA1PbHnIf5feJSW1+GYCzAaGEnD+JfV1WLKbryGdKP+aknBYDFlOXRbgv2+SqBi/RiDojzE3wCvBSuIi3QbN8D3URM5e6lwELAWlruHbotQlucRP332LgbXeLjVuqSP/idwUqpdYBzZLRmbwgJCrn2vfpX76udt5GoIhiLx5lot9vQ+S3pC49Y+fd4vRKz/OBj3VByE85OByIIHwtvDFsNh21p+LhbVoW7KgDAwkLl62Axi/krjtLf4bQs9Y3Nyv6CEo7Ufd2XIq1pSZTUpCkIz+U9E1DCgNN4tPGMx0y0b04yfJk4xsdej4ScjAQEzMI2ixN/0TowKVg5myTiecwIvX2y0m74scXratMAEww9CvMlGItwBpU1bUmSsKr6HJSug= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2270; 6:waOUOiklc3uwXILLepO/+yK8ITszcZHLAjM/DJXHhMcaqS5k5VzC0XRqyDd2Tq90eDzhhuySNftrxjj025ofk/fqqsEa+nWQfOYfIIgZbkiAJBFH3l85tBuGMkhld1CRI8RQN337WWjrWfpMcNe+76mRfOyhVpe/cms8Vm4nWcRjN/KMX2JSXz6laoDBlUbt9MBP+HUyeD5tSP5O8pv/n4eMwRVRC3wgSJIZ8OmYHshHv8QjUYJsSAYWwJ9+7XQ6QG4MG/h5dAPC8Fl0bYZvSaQIhR/mCMu30rzzmqgEcwaGqCa0Do1qvzgM8e/AZWQ0zQRCPnC2zJuEV7X1x1/pBQ==; 5:0PhTYPhR20Ub+wlqEcVoEZNKZAX6oaptC2Qy7fy8WC+W3lIjW3dedKrv7E8RMXDzHRLSkhsbW3ZliPSpnO/dEBD477NnCvUsOYoAYitEm30muSDIHvGCcYS4zFIlR9MuD0yJYfYIJYTii0feTAtzgQ==; 24:eKYlFmA5LUFKBxyiBy0n9CGTVyrh1TBZyeZfRU1govaN9Ul+MbFboBWn55CGDBboUZL1mWdr4e9n57Cgc6kt9j0ELZ8u4iWlY9vVtiAOsEY=; 7:UTOGi3qBX+lOlzTh89OYvW2HUifz/rHjMaRkVWX6eCMIHxVBlXyrztGkb+fVMJ2+lzroUglrON++B2EIGkjqgOSNNh8NFoXe7RPMJ6fpKDY1U131T2V8XcZ6nGhi2McCDzGgTSSjCvMXPcfg3Pk+oAOjsZp27jJzHYczWx5lcXs5KfwQEt0YK61OeIWMZIcHJld6nBBiO+EVks8UUt9aX5N6wiTS2IFXxv8MOwP4yts= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:42.3319 (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 22/27] 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 5e5a71f..dcf783b 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 Aug 25 10:49:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111006 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp814326qge; Fri, 25 Aug 2017 03:55:22 -0700 (PDT) X-Received: by 10.223.166.41 with SMTP id k38mr5658799wrc.284.1503658522661; Fri, 25 Aug 2017 03:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658522; cv=none; d=google.com; s=arc-20160816; b=l5siYhk1xT72fd0j0gMdb9ad4NGVDnBxplMEGaJvfkORPCUBlp0ek03xxFc1KX2QqT nBIvNv+Pli+2TELvxCvIZCpCrMhjrYNYB2qekB1PRp20Ol930cupBaSLEnIU9+1yuLjo PnI3m0lEW8HXckNhr6j1WLAkQ+3ObctvysJ/7na5qa9KSnpqSCR0PqpjOnVzVaWKOgjZ 2jh94+I+e/i7ObvX/3na2HekzjV3LIbC5NLpKXLWLl/YSKGSUppcZULIyEBlzn1uZsVp ELWv9hN2QZCCOtZ/zzcl0NsVy7fLrfKMdknUBLD217mK2lxPcf3DUPa3422YfHplGqQu Z4TQ== 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=V9b+JLc3Nwqe3Fd1gDrv5rhMD3AXyP9Eplzp3EZMYms=; b=ljcJK2aW9IxA1bqhyhh5r1/ooaSCqwJuduX8hD8D39jvVDi3cxRdlUm0BYOlTUn6/0 zi0YYhKuYbGBmTlIZJa0g1yTK500uoUowYjN2Ix/Mt0Fn88tEyKK/529DtZDIPCc+ezr jxNb6v4TGAAxNgJQdBMxX94wiR2xMAf+w/bJFsDHFhSly6PgqYLk+N0VxJ+O/NuSyPz6 i3gEe66EtxS/yjSVhNMPUxqui7nkxMMJM2PPz+VCvsedzTVs+qFiu4QzrEP5xS7m/FmO XggphNFG9yQgIGqY6SM48Ltx9CFdGH8CY8IW8DJqt+Ct4ZWdSZy7a38CztwTG2zEY322 onGA== 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 m6si1061586wmi.78.2017.08.25.03.55.22; Fri, 25 Aug 2017 03:55:22 -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 22DB399C9; Fri, 25 Aug 2017 12:50:49 +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 7B04799B0 for ; Fri, 25 Aug 2017 12:50:46 +0200 (CEST) Received: from CY4PR03CA0097.namprd03.prod.outlook.com (10.171.242.166) by DM5PR03MB3322.namprd03.prod.outlook.com (10.174.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:45 +0000 Received: from BN1AFFO11FD009.protection.gbl (2a01:111:f400:7c10::193) by CY4PR03CA0097.outlook.office365.com (2603:10b6:910:4d::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 BN1AFFO11FD009.mail.protection.outlook.com (10.58.52.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:44 +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 v7PAnw6R032070; Fri, 25 Aug 2017 03:50:42 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:39 +0530 Message-ID: <1503658183-4078-24-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318443723016; (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)(86362001)(77096006)(47776003)(189998001)(97736004)(85426001)(50226002)(305945005)(2906002)(6916009)(104016004)(54906002)(2950100002)(626005)(6666003)(81166006)(8656003)(50986999)(5660300001)(498600001)(76176999)(33646002)(356003)(8936002)(106466001)(81156014)(2351001)(68736007)(8676002)(36756003)(53936002)(105606002)(50466002)(110136004)(48376002)(5003940100001)(4326008); 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; BN1AFFO11FD009; 1:qqyesDRhdIyc4O1L9+edbp+cnfvJ1ViunA18f57WGCJy4snU90Hhr2CQSuGImRVvX8BjX2+3Lihb4U/24AyaDavniKHZBA99kOY37Vrl6ogdpBxh3h2vT+TWFuu6Or4r MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5545ba67-775e-4858-c7a8-08d4eba722e4 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:pgqVKt6/gIP0vpzjyGT6s/eyTda/o69pf4+kTDCWeDagHkGgIS4tJDweGxGkjnWCUufruYI8siQSFPFJCaXH4WhPoPA6yR4sqirP9zH1QIKzuuKugMP30dG4ZBnD08dNZuyzn+M0vPCccVLqRwC9i83USFa+9Uq9pYtAaPMjUx4m4Z0zsQ0Q42cWjrLc1U0kW6I+R3Zj69y9NYFUMYjReVBagEtVa8zux95YQ3DFouM140mAa85MAm80Qhk1w5vT++3EoijP81liY1qy1lcZrdsFgsuUB8XF0IkOIUE5i8+QjbXYBsOyNVR/IXpngSkFSoybAxFTq3CjchthpZ1tRaXiZqF95/2l+79uBIzzvL8=; 25:NwzEaXnbAcburskYYVs3QJ11l1tFOA4uDfrfuTaHAoFOxHYXe3UPJU8LSFH0o+RMJ0bGuB4wmqRlwuy2+GA+D+GZ26fSyGNNtsitChKBRwC1ePqRXD0jLQFOY8gSXawid0k+mCm06edgsrdhVaT0SA1yb63RWPZXMC/mV9F4C1DqMOhRomL8OEZ8T6pZHUKZdGrFn47uAMfTSPJlJaBvKlEk++opetRPS9tmi1m+B8BUJSPq0qU7tDzTyWYIX2x9dmrA83aSPI2SxTcgOLbBj1fDInuffjAM0xg9c19DJpqkdcqlCH6TxAd3akk2oL7LLSn77Y4mliQ+gQSCnM2+Dw== X-MS-TrafficTypeDiagnostic: DM5PR03MB3322: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 31:mE0v5QXAtATgnx8WcdWJwN+8z+mzpfiqaKvCRnE1GKK6WdSpMbA+O3s8ZWEyS7BWSPh2xHF2vicYi/4mhicelE5N9H/uipnWwnfOYTaKQhGQoYOSSMQlJaZr+kR50of+w8eVqPj5cHXQ5bP/1Qw9ckjmFk8RB0BloyNR1UtVvPyggRx9ns6KLXz9TBOOngiZ5b6kKIBkp7oeXYwhGhnohWIKycTmiY5uSl47p24hTY0=; 4:ad4dQC6rAJqET6pf3ocgnt6OiFXkQV6Ak3ow0Uvt9tsvch3gwuCHmdtsxOmUWbIw0+6wsG5a62roEqZpp0dz5a8II/2VwHtOUNZ5Lyr22D24l6nvFo1CeiXNxgn9MldonwfFBlAqjoUgD+f8pn+kD18M8965AlBHXR9KWT4CeIZwlc1r13WzKd3ZxYgee7WLcxmEljXD8VSMwZqlsFclZzQFeS1byAIotoEzxFSeUNZ4fmoNS7cFA5WtEkChsT70pcU8gPH9/L9r/FOIGybSzpNAE9dNAFi5Gv0CG4tH+MY= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3322; 23:kA8f8FxWDRRRHbCDqMkQGdeQvIloqllIMWeN5P0Mm?= nAU2dZyMiD7PDLXJ1x3Q1OE+HA7rvZ/HJTWscFdyISXF0amR5GqekSx3Wi9sNVxN3S9Kt9a+3EyG41doi1YsuegsCIw0ZOgvwedcY9flDloaVYydhKiD4qeSEHfznexMGIQ60pElx0U3wkjBZbu4WAO/MmLcZDZTUvHAEUcJ2UTKO7R4mkxkX3gj7ugFAvznRGN05VwWqGTwuR36bg7fHfn0V4jJcSi66k65h4ELjcziJE2gPvFSWbnqsj+kLtJKCsgAjyVzpuiHMpkBbc2lDoY/LGs4EvfLmn5te2z1/VD2yE4XKua7nXknIQE0fmfYgTt7cp0b1V+fi9a7ojCJG6yzYeHfh3sLu0loDmwuKJ7bHzXraPuhYLue2jbglK/9aXG03g/MglkZtwztSuU7pkQYNpDb9cD3euBUQRnx+4QRR4FfKEo5DJHI+f6aM7ElqpX6wONRK+PTZEfwRb7kAr23Y4neC/rVlFGcNvba6d2pa82zCstVlX+FsClrfbMbNQ5Ropdjvaqd9fkiDLdDY6Mj9QrqunoRnO56CoVZq5WKie9yx7Chh/XE0+xDVpkFoF+CBmXQpxuXrH3uwGi1uj8L2KFzSGZ9llnTlXJ92pgjw3p3Oh3f1zzAbOGeHARAHi40S0t7tEPtJYtjCAyruq5HtCKSwsUtXxpLziut05pd1Rg2n21SPbujw9MhU6mi26TUikE94yA+ZNFZ0z0L36fjb49H5czVjJnf0/3mf1xqo5U0Qch26xqYml0B6aiOcNRl1zcRcuWWu8d/cP0aKAZv0chGNT8mYFcTlPmKrPTpmqwPgIfS0zmqJn0U6FI+SZuG+I+jWnfjGeuA2kgokg9CZ2S8rMoI1pgzvoyVB2D5ORVvxFeAW8ZEC+lVZKUSGHY6tGi/Zky4KtEBwe1Kkm+sUzq2J3tl+pdAxHeI/ikJ4MWkJOcnnq1S/8BWOBJ/U8B7tcIp18hl0M29Tb1rFrTIKejmjd1zm3xNTZ5PuxU0+SvWODmNH08nVwh/ED6GKAkUSCqdKRs7DpY/211TlRtMa+M9PdBAdiZhNZmsuJOihhqvxheAvaCu9JaXyDMin4QsenggzfCDg/C7gtgqAg9 X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 6:LXfQqQ/Q5lvmDPKpMi1xD8+twASZvsMcf8eqbvxoWCiuWhdDJqsQ0wOAdKPEeI5Jt2BC37jBx03/TgwtOgsCPBdwI9kiR7uV6sXQI10Q/546jVEMEUrScolNEd8KqHspatvQ+LRz/3Fcz0SP/sgITqX7q0YdpgHk3797Syr0ex3NkejGPaoDfqeLmRQdFJkNXkuGp7FOC6vdoaCIxzqb5PGCX/7Q+1hw7gesW6UZHO0QumOq+uSc8LrDR0rWoLz4DIcmLHADp8r80/ZpRwTMQ2PEq+eFIAWKg8fMpkPFoPp0LKPqizQcxspTnuHH/uz19uCoPvbGGe2wPW6w8wrsrA==; 5:OpYZH0eFzMUi1W/WIIOjoh8GE0HLIgHrLgXzKPsMVIkjIQ01TFBv/G5Aj+h15nbiyQJWr6Bx60Aw+gpiHErMZAGqKITQ6kJb7HGJ9q9kdh1z65TmdbssxcWKmIoIUGqbCSoiZSD0E5PRG5koWl1aBg==; 24:xGJyrvPye0XxHhxylCZC+mO6rYIkyBAbzqJcAlvHzNhu9GdcJrminpcqWxJc2rHup6OwYRr6zKmbxgt8IuOjd+s+NKCAPhb2tB3T3sdhOcc=; 7:EKyj40VfZMvFY1Ym2ypp+veloymHCSk14WzHBhM7sMGriE9l4hrAty6Rp9I3ymbstQuvKrJxZrBdlVZOBIsDFfdUKg40EZYtSi206mFP3kRMAmiXCh4pi814EI3zkvxNE0xVVLGN/rV+KNQ64S62RgAZkyDj3Pdge1DPEyAJzEkz9I6U61N71evYqsyt0Sx1g+CkyqoN52SB2oOpZQFn9z3/nPCwHA5vwJVCYtwPDSY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:44.1851 (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 23/27] 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 dcf783b..4eeddb8 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1422,6 +1422,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, @@ -1451,6 +1491,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 Aug 25 10:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111007 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp814567qge; Fri, 25 Aug 2017 03:55:35 -0700 (PDT) X-Received: by 10.223.161.133 with SMTP id u5mr6327427wru.125.1503658535745; Fri, 25 Aug 2017 03:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658535; cv=none; d=google.com; s=arc-20160816; b=ofSp1mobEThPINxC7SKPN5Zj2L8pHD0ekb/Sh0ew8NfAgiP1IvG2aaoAbDK2cYkIST rrvo1TsbtVSZKzCTbWtJEImrdxRHskw2xvXaHUD9UZ4FVXBESXKo1CJbfqAReMO+uxiI LgRRMVNFUcT0w0I4Af2rRzVPrHbi8ywpi3mSS/rMpUdTD6iptF3turhih/wgyHvlk+jJ iCSETs+SxBXJuOoM73D3uAnD+JuMk5PswPe7pfy6r3Kt3qXqT/NpHoR5nNj7oE68/zPI w307iVdPltYqkGRyyiLcvac05CFbE7KnNePhNGJEwSJegrEgg14NeYVN1L8yPxX1XktO 4HXw== 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=7bv0STqnebhmwsXud+kqehAxyy6FOrizFgyHp1l2Eao=; b=elD2tEx0d7g/Slx/Ox0iuMT8iN00Ub+rwIjsgSFYT7+g5xHlPrEN54U8BiEA8E2vLu orkrJ1w7L4snvrpELuvF5ruH0I/5jXuAYQH239lmc7US4dWh3MsMjNzCpIHT1PJN7hSH 2hulOlxBJDMu4MwiQThSSPiivBCBbC9DC3ngpyz97gASWDkm+l8AZ4EEhGfxUjse3gzS yxyxj0e8F/pfw7ulgZgfLaW8wLyz5wEFhnnQd4Yh6ihDCl/BzcJiIxDSFA55NKeekVL1 rtyhqw5p/A6l20FHrV2RmQbNqClRsPsh4C8u+egJWF/D6mapwVFP3alJtkcU0IU1q4Au imgg== 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 c30si5151063wrb.552.2017.08.25.03.55.35; Fri, 25 Aug 2017 03:55:35 -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 5920899D0; Fri, 25 Aug 2017 12:50:53 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0076.outbound.protection.outlook.com [104.47.41.76]) by dpdk.org (Postfix) with ESMTP id 6F29499CD for ; Fri, 25 Aug 2017 12:50:48 +0200 (CEST) Received: from MWHPR03CA0042.namprd03.prod.outlook.com (10.174.173.159) by CO2PR03MB2262.namprd03.prod.outlook.com (10.166.92.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:47 +0000 Received: from BL2FFO11FD024.protection.gbl (2a01:111:f400:7c09::110) by MWHPR03CA0042.outlook.office365.com (2603:10b6:301:3b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:46 +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 BL2FFO11FD024.mail.protection.outlook.com (10.173.161.103) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6S032070; Fri, 25 Aug 2017 03:50:44 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:40 +0530 Message-ID: <1503658183-4078-25-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318460927743; (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)(86362001)(110136004)(8656003)(8936002)(50986999)(50226002)(76176999)(104016004)(68736007)(81156014)(8676002)(2906002)(81166006)(36756003)(53936002)(6916009)(47776003)(2950100002)(97736004)(77096006)(305945005)(85426001)(4326008)(50466002)(48376002)(626005)(6666003)(356003)(498600001)(5660300001)(106466001)(54906002)(2351001)(105606002)(33646002)(189998001)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2262; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD024; 1:HX9Aq2KHdCvpoPbuqR/r5zVD7yjKqO0Nj67M8LQPVpiKzyRSEMxUAWdH8blcSvZD8cIXtU9NcwrzjVAXUnmJiAuM8VsYXwpE6+5yGxqJWYHDCCKnFxFt2CsnehlETZT2 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1233e53b-a805-4136-aeff-08d4eba723ed 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:CO2PR03MB2262; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 3:Y0b8xp9zNw5axidDUzD5Fh3dXnSWM57oMJi9y59y1x9mNKgvsgsKU/7FhRbg6d5Av0C8k202oTsU4fCNhh5D9qAhEgUk2PSpDveVfYFoG0STj0A4sa/FNKUeoy/0EBRVbEk4XZcrdLpsg6Yb9sL9qjvCWzrNYE3ZDPWG70wZG9j3b2y1IjozTgkpES1aM7LavBKk9iB4gZgI35iI4A5vCur3S8oLnHSZKizIAb9lf8zrb9W4vXYx4QlTkoAzx4Tl/zCGAa3aZGdLmEFQ2nQ4p/iukpsrGhfqWSNygWfJ3b59GkERWJdkVziaG2mzigZnOdLJKMQqxfst5+jTqZPIpZj9xUn9LVhhWVuEu4JcX1w=; 25:ll/nLjtx3bCeGWzc682DLN/eTSMYz4+ednMU99UY8kTtMIcjs+wLEet+a7v4QWU2NAZTJ57zANRmEs9KDCovb20jOzF3zTwHPfzbaTQenvJlv49fAvgAWwaBHkc3wD5F+LSGHYiQBcITMqeoIvYic6zurgAFv79lBbHEIAOD9eb5Wnr3SrnLdIXTc+X7tMfipRGXDrDkfd8ctbS4uTi5AtLlI4ceNbnoJnr5VhyOgripymNVuExAMy8BMhXTp3HlGoTY+/gJS9tyafo/3ZQIts7kmRVvzccE4XactQ9/LbQvRQS7chxfE4DI7JqkeRVaYNZt8p9TCgaV0OL0elS3fw== X-MS-TrafficTypeDiagnostic: CO2PR03MB2262: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 31:5Nw+hj9DT/aCbzpaY/URDLUyO4Y4fjUVJN80PBzEtXkyTg70jviODDwNkO5hUvpJjdTqXyjQ5qyC9BMs1mV8ab5iAHhHkgKKoQ+jkIWn9GAOhe/qsTMrAvOkk8UajA4n3AoeHbjPkN978a6qS6fWxwb/mZ89mtbrs8K64q2gtncqyN3FYf2MRL7jl1FAfdJH+OB6wpO8SI3BQrouE3W8hCMrqRX94E3vDKedivu98kM=; 4:el1U7YWv2W8nP1fQCz7SjUcNFF1V4sALR/BlqDoPKx67MNS0MUsUxt7VnN7cekOhgMoAorS7tjFgN6upZmJTFyGPAAuxxOC/GDyL3rOUvui4INY2zzGlN0YOFCYG9gRxhVUSmgU6/q2FsaOV6r9m3o550pK2u2hBcKIvcNrXLJEUX+oTg2pBu6+4OSYHmMGFY3tG/AjH9n16KmNx47W6wMJA+FIg2yWNhx5Jbc3+/SC11mEURs6cN9asvaImmsgcob1YMGhZXcg2F90ehW4zc6L2oOmMQR8Usx5NzR1jMkc= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123561025)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2262; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2262; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2262; 23:yd5BLJ6cyKnOzcbRKJcdmfvH4SA52CgUczxl9yLfy?= q3vtHVVPDdZk+7IqDvzGJdGZ3ckI0mtZbFA342y5fQMJf4UL8b8b2j+rbRbf/zwDL0hOobX+BY/wFC5KVcYzBJ/byc2lXwNqBVYJFa9tkR2K2FJsyehJy1ePlpgUnhJGkIS4Lwff7T9f7uas9DUOvFp63Yj+TvKagFHnZPurfBcCLiFDSXyxb7V7FBHxzIKKTdYym0WDy/347x+y2fiLKgBx9Hw5N0Xu7K9Wz0Yh2tEp5x2GiOGGxBVnOpYHpFDVNv82Hq7EYNcSGZxbLJUuAO3hSBix6+fFAQWptmoExkTanXmOioCinlO5LDcBJs2ktSQOSJ90CtzghAu7ZsLcbJcIefjB3s5WlqmLiixwHsAvnPqBgXykPp6xvZ4WX67qlW4FRaG6kiGGbpltMgogX70tHgOlSmTKyZjHZoL/H19AYn84nNx24J4n1LHWxp777Mg6X+zK3SihlPbQM7GQBdLtihNoS8NVJObAM/vERqEVPf+rNRxB96b4FMZYXq9t9pIQ6Gd8rWVX07/HMW0JKonciSdVMDzg4n+f1AjXogdiV27ngR5NxfItXAaA04wSmwiRrEx7lR1RiU2PBX4WDkEvSfmQZf+KMTpnHcUYWgpWj67NLOQY7MqL3mtQZLTT1pZb2KGrIPB85hbpcwK8IIr+eE98S6WxoljhCuh1biGp+P+iF1P10ZtABFVbmrxShUmyYtKfHpAbblI9rgKc5DaQaWeQVWbn/Tm+Hq5M6Qs5+/Q8wBCM6xhx0/Rse3giOJ5WTrfh9EqzV0XCwPvvAJvSWq8X8SWScM28uGeHwDsJXXi1Nyeu/gIagJpfTPPxlNJkz/Ju78en3WW4fyy0Fvs2nXvcQnhs43XsBlYmFDif5PdQCKINT9nm7W8tgvVNIwcUL+eLjAzQ1Yf5X4JOT7qg8svH7m6VpFUJNTVHz4NTltxNax92Hx4mUx40n8KjBx8Ot/FBgksEQsmAibBonMCb9UlnHXB+J0r+bjFb8ts3iBEXJmusJclVOJXeS4jC68tHmHB2FA6ChFOU/vx6mdO67mM9CuOX1LRBSKvjm0ga9gwYCPOHrQCc/uUNVqawPiItaDU2RnGOuojryJdA5ND X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2262; 6:fTrKf1RWuI+m3g8N/yXD04fsVAw/uh2B2WUCpPw1JkakFAeGcmFcyWpibYGgZRRH9wVfkOXwWqpWzAlssQTgC7MBknc1BEhrGUktgVTCYinvjLxn3LPpu5dF8JaMjGprUu38g9JCH5HJ5CGhdHtWfFYkAe3yzJiTPLSqmjfWdxPtCmHHVGo5rz+3aANQNLbE0QWuwCD7hrJwWOjowkAP43YeOnvw6FbYnlYY+q6UdZMDbnG/H6b5xviZK/t6sijzF4ie2a0oKE8IcDMQAZjxu+oDiUGDq0nqcdWSCBACJh6MDFeRl2Yde577CJN5eyu458sSdoicugyn/T9FfXnMTw==; 5:QyLWTerWBFjiYy5X15K8g67il/VrhCIoy/gQO0Iild0Pwirb8jSGHWlyzu87Wu7q0IQJaRtrK2L+6YNpjh3uNguA24OfMM69fICr8Tnny9DM9y0L9en5tIoXlQsejL8UFxRjo58TuE5VOF3bSCA4SQ==; 24:rhFoVi5EJ/OaAnicNhd92lAjjIRrLoRu2KtIDgk/87mbpl5Fgc34Kw/BuukjyIHoYvwDmSbylexeZLvp4AVBRMVPOn+pQasYYumEAjaWvxs=; 7:OgmMFMM5UJ1QWvy78q9D2IgiPj5bf7qJ/3cp0Zxxg2nQ0zWK5z1mR5KUJT9VFlDmevDqoPJzhUwkZTsLbTGGDJePX6EfivQFtNPUGWuuXhHdLHnFJ5qQXYgm1jW+6xzURuCvymJptsrQClato6dYTZPi4A+ErNCIvJylW+JD9WSt4JB2vvCJHsFaKCyEUKN5tEShh93hlIJsXADFOkpEUIQr1wfVmp+hjrr2ZaJ5Ygw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:45.9367 (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: CO2PR03MB2262 Subject: [dpdk-dev] [PATCH 24/27] 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/dpaa2/dpaa2_ethdev.c | 178 ++++++++++++++++++++++++++++++++++++- 2 files changed, 177 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/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 4eeddb8..b71c51d 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -52,6 +52,28 @@ #include #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,155 @@ 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); + + 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; + } else { + uint64_t values_copy[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); + + if (!ids) { + return dpaa2_xstats_get_names(dev, xstats_names, limit); + } else { + struct rte_eth_xstat_name xstats_names_copy[stat_cnt]; + + 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; @@ -1475,7 +1644,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 Aug 25 10:49:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111008 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp814744qge; Fri, 25 Aug 2017 03:55:47 -0700 (PDT) X-Received: by 10.223.178.2 with SMTP id u2mr5078406wra.150.1503658547823; Fri, 25 Aug 2017 03:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658547; cv=none; d=google.com; s=arc-20160816; b=cJxaVC1N6nXAVq2FhBW0nKRVmVlQpkLsQfBf2aOxa03aQuQlABV1tEdcNRUdFrMeoj rhiFSevNTMje/lrgskpeHr5ENzalINmWVnkVk66RTb7QZnnN6rlAQrASSUHxU9PwBffV PSOOVri03c/9V5nHa0iLf1VVMPZLg4pJl6Gy4GWS3nPye/ouirBBtH6oC7z61SeGu9Dl FiHNUOrVBZNYzosFyaDiwSStp1NuUROoP7/vOcRIzfrpJ9zQHw3+C8kHhRd5zuhqP10q 0rCtPj1IKInWKJHSUKlSaF8wms5zeHgSC7M2Cm3BUSLTDRr60KznQySv7SUB/uESnUxS e5Qw== 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=M87USKr7hviFrtfxDBCS5Noss1kOUDrPK0NNN3jEjARfGa246AFUSBENAX25TQCMDL ojCO+Q9q1R2J12cUxrM5jF6HjxuTuk6n0FIjBE+SpMafuSEtmMlQK0Vr+p06X7y0qZ4X +UlkkcLxzbVIt+f95HleXUaT8Ne8jcUrbJgWr8dYpWT6+4KjV4h4tYYQ9f94rMx/yMiJ B55QpS9Y4Gxqq5S+zK+DrKj/f04FtQoNfd7Gp5h3OQIIoEf5TBiW4oVeIxKDSB+RxRTa 74Uyr46B1MLprzLwi4KjouK3cj2vsOEmT8ryi/WcZgBKzcvbp1Yt06JTbwZt+C1Rk9l7 b+dA== 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 130si1040856wmx.82.2017.08.25.03.55.47; Fri, 25 Aug 2017 03:55:47 -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 22C3B99E0; Fri, 25 Aug 2017 12:50:54 +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 A8C3499D0 for ; Fri, 25 Aug 2017 12:50:49 +0200 (CEST) Received: from BN6PR03CA0088.namprd03.prod.outlook.com (10.164.122.154) 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.1.1362.18; Fri, 25 Aug 2017 10:50:48 +0000 Received: from BL2FFO11FD034.protection.gbl (2a01:111:f400:7c09::133) 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.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:48 +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.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50: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 v7PAnw6T032070; Fri, 25 Aug 2017 03:50:45 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:41 +0530 Message-ID: <1503658183-4078-26-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318477829181; (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)(4326008)(5890100001)(47776003)(50986999)(76176999)(626005)(105606002)(106466001)(2351001)(8656003)(6916009)(77096006)(189998001)(5003940100001)(104016004)(2906002)(2950100002)(48376002)(68736007)(6666003)(97736004)(81166006)(50466002)(53936002)(8676002)(356003)(36756003)(498600001)(85426001)(81156014)(54906002)(5660300001)(86362001)(305945005)(50226002)(8936002)(110136004); 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; BL2FFO11FD034; 1:KECJZheR2fodc0n5QMUpLgGtEENwumLY2BfMv+jlJykSgIupxUJbqMTSJnO3WHn4ptcPoAJHxOtF1Vf1l11iJZgW2agf871fkgacc7if7bg3E1q744mm2j4WWBI3qTSG MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ae44218-38a7-488f-32dc-08d4eba724ed 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:Sg5AzmheCSbgrP3DLOIJb4JDRc+RDZ3nDnOrnBGCZ49m7zAXPsY8rhmlez/KjsKQD/SaARjXqINjB7qoigcgj+uAfur2tqugAchaFxQwUGWJFbx5Q9RlnEXwQjC07I4MQeZfEIC9Eh+vWeYZihlYZjXeZXrf3dYzUnlEhWcRuEXiRNMXE65MmnvUGU7lPwusHBPM16x2ydE3yRregvHO/KswUwZZC7z9MsgTx024HNPQZ4Z67nrkaEeUwf2xmAAgAQ7hqnPPm+ihUZA6KnfESPEuL9a9tvOhfvv/6y0gPiS8I1XT+3+r3H+kBD8gQwN05upWufRq+FVDkek9TG0Gf4FONZuVmg+soIGN1WzogEE=; 25:mDVCZP0hQGRjzbajXSm2sjOIuywVToN9T8stMI+1hdE/e5PLCpsC8JeEQXoEO3zil2tlQgA+VB+D2vRvLz+grVrN/EcUb82OQAqdsD400Xd6ZXNbljAlOuE3thqoU+AZzyRn7qVr3c1+ibb9rs8s4xwCMvHm081oGx7nCD/CpbSgAlM2rzsQmcRGFv/8eKomwVbrPmohMhtHi0cGLl82QLtiJiqxpodPWODGdOXIqVGypp32CnLm4KrXMuBPzHt2SjRzp/ux6qn0hmwBy1rGGlBAOiNbwkNZ8mRgyokuhGhy10afCaF6fvUyh0KVHV0N8G3+U36ueHtnmCXOXjKduA== X-MS-TrafficTypeDiagnostic: CY1PR03MB2265: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 31:zaioe4V/p1rP8RL3CPZYjsdl3Lzod+cJDjnuaIYkzeOKdh8eadpAt5nAa6Zn8Fw1Bf2Yr3dPikHxubHHVKtDQ1tbMoYJw6enXTwTGu+aEAWJhvYBG6AtYj/h5Y/rcuksYwFG5BJFQy4ejJ/ryTDRIz8N/Rq5Bqu8PM2GEpCs/biBQWPT+4VQU79VMQLyiLMxpSs0R51ckakxiD35yGDenXyMTrqbtASm3gff906Wkrg=; 4:CASIlbaQFLOTK+u1yGtVPNz/+9p43s1Z7pEESDk4sTW35nMScovy+wIs3ylHibRQisWuFhbPii9qyl3AQz8AWUzamywY3eVbPLmJnuGLTsQ9LaNI5lrEQ3UTQG5cKTxyn1t1K44Kbunh3DEP6ddwZHhW02myP3jMmaUz5l/nPThA47CBcB48iP/gEk+vgR9t8j7GeEXfVFOnL4Q03dHrdyTHxyQ2F1Nr6B2KtvWD8pEacKUt1eLuAiy1nCyxSLVpopTipTVvE7Q2pxGASetOtTzQQ/RJZ10cN7LD17L0Ru0= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123561025)(20161123565025)(20161123559100)(20161123563025)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2265; 23:Ekjab8foaabRBaUY8kRF8NYooLad4LUhA1zcIaNy4?= LhzUJC1s7YHtSlLkZdKvDD9c6Cx/RwHIvFAhw6Ngv5KVoNBCws6eqlTgUZBZbcLspQ8l+ttBf2hmXvdlSt0E8A7JaNdqUDEtlnjCSxU6QMhvLc5gcIwFAZqHxEDiHGMu6ai6jQxFa9fGAiSmj/zje1JvvmImDTTkeVApEk9VmPVT0nJFFxhPPnguwITS9hrYtvorCfrordn86Y92rZwP0pUjKOsN1ePrwgQmCCJBZYrAdbxxeoXFyFlmU+hvz22WN1Vmry3c9I9nA+l03eDfdfIfqxMPcC2ZqDkwDyRKpodG8sa0YHci9hpEJKIdfSa2KCYlJ0HyMZspSVIQMzCAmwkSP3NxWO4oK4gF0ET7ii0NBya0VNWShiBIz06SiPX/w27O6576ng/MsbP3AxNV8eYwxWmT7aSJ/1XJUbcvIWNQvm/BHfKiAgnja/4OYh9faWzd3bVS17mmfXyNrL8Qd+A4OR1ktKCz9kthvxq2lVa75JLIGQwliNOjtF/2VytDWUafulvdUAPJ2OQC79hFgojHSOfcf+Txv2GUl8vdNcRhSFfcPPe7MAKyi8rBV3v3b5Upzrk4vela2/Q/TpCcupjPWulLTM13e6+gRrpMiHVfrWVDG/qpSBp0On/FNiCzPKywHHC1+XUqYX+yeAQzBOQRFJ8ya/PlKXcB0aPtu4UrvkYCpjdGr2rvTk3M7sR1tiiswyWDHZVt+wOq2JWcPsj13O9eX7oew2c0nDGBPcO5Ubvj7VyUNckI1s2Mej/LHYNkYeXCB6xKlVXP7YAjMPKi51P2wEsof0cziFmwfQi2Xk7f2oijcHLp7ETfWE5iF3CV0NKj/KJDrXeI8J8207LcQvmkHNNQqUsk6MaXLF0xsMAdk9EcQaKb6Zlk9CyfWJu9NWN+aU1cU/UswVP6VPupnIw9cfSUvCR+5r0tNsqa/xSuAEIsevhnEZyH9wH+VW9GkJ0z2Bf7qVfY4yntv8a0JU3mZeh5mY3xisKYfu0LGDiuujQp5dtOQ+/RQ+RByT2a5P5hTztP3fPO46vqEmTO9njBuave5xau/mdzbWV9zDc29L8eo5sns82JC0rPrDdNJJWg08KC7LEHpSg/Gm1hC9aI0zTVaYaSLsFqKgpOw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 6:aEGsOXFfBCs1DwGDVUdsUVEuuM0pKuQVJvSD++3AX1zHPGcMq8FOFPjqV4fDlmxAYotuUaXl5ckF7sOcjxM/8GmLU7KRMMtDhUDAEpovIr4MJtmrAcYD2/V3JHcMb8d1nTD0OJ295VpC8gWOzITrGlkGkVZ2v6J7a4g9bsmORrYKbV9IqGu9Btx1sadbvCkr86gNSBazbpzSF9KRB9xF1XfHyBhCuRwMGKR1ByFjtIscX2vvzq4y/AE151yMtzQKQ34f56LM6UQs5JsBlpOI8SaLW0qbLPkWo9IEwlT9DyyaMrTWDm36RZt0T/3vZa5lqlc5/yfnhyTLuC89Tz7n2w==; 5:S6rMlaidcoLAJpoyVdGEAeTK+hNBoKki/RAXETgIlH9tvTF4LYz2YU8/Q3GUUBQuTdhDagiu2nnRN2m85I3WaI/4a5298yau+gLofwBQ9134NONaP1iiA4EvfowEslCqISY9lZWPhzZF3c/KWL/ALg==; 24:tA3RStUhiUWsEa2fJXMFHblndkzUdFKY5J6emFjbe6rec75brKpRBF2+dLdkrYfbuyYXYrlXbzLn2znDqfGEI9oaa1Uz1AIapTUv4ogpnys=; 7:QxWgfWu5M2FOybgrT09iHmKLTF7UBq66/mUFSlQ7ri4qq6RBa2gUp0JGgg8tS+Jt/plbbwqtmLX8nBEdPvEQheONEZTQsYowdx5PpyEmYhRneIk2ZMVezcXHVUs1XT4ZIMYaM6TVs0yNdgm+LLMDtaWLq3oXkAdlbFeI4aOqDmxy7Q3NK3DE7AK1vA7xNUoSD3ZzvnTZ+Q66c3JpEZ11JMdiFIMLmbllJylbrMAS6r0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:47.6113 (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 25/27] 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 Aug 25 10:49:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111009 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp814931qge; Fri, 25 Aug 2017 03:55:58 -0700 (PDT) X-Received: by 10.223.173.182 with SMTP id w51mr6864942wrc.113.1503658558182; Fri, 25 Aug 2017 03:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658558; cv=none; d=google.com; s=arc-20160816; b=g59u9aK9qwvmEA96Np5huC79QAybXdy/tppWwDDjZT25cNdgSwvXTVEBRyD12JMvMq aEXw3y+RG1PHphTRxhefmA7vRZMWW1y4Q0jgDlp4ItQJ03TECUmcdQ7wUr8FivKKhPCx UkGrBehWdBmjvab893gvhlsdpt9WDhagLETtrhwsuxEUOiUSWePWouhARGsW2plrZHyC w9Y8L6EUM9eKL+CEUsZl9SzYdT2Y4GIcSBBzMy97REOOV43FKBjsH6/IGe/w5TnlM3KZ 1g5HYKFWWlFQHRtSM9pHk+CXY60OP9fKeq2HpDJPU9nCbdCB9hUHAh3SAuOUkevBvQwq vQ1Q== 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=mBbqsDm8chPILFAAI2gzB/xm2dFfilwYjtAHqySSYqM=; b=0xDwffmayh1fYMS5tyTSHtEWe8iZqak3JHbzTvFaDzRIP/KIl315PDN2aXftHonxBP cwcHgf1t3BlWxnXTvUFG2xGd4k3Me78fSbylEkqNknQjxSbrI5KRDioMeKpkQTQ1ejJT eBLaLzFEVPwtT1RfpVtSp6PwV6r14v3YDECv+HnXI5gtNAXAN5FBc0qyZu5H/1KPQTST gNvzuSJz70UMGG4tQ563GrgFwt0a7dF/Y5yspToxoIbANEwpM/0t9pnVGITZOXiudWY/ 89QH1HHYkz+quUjU/R1W5QzQc2uzUS24ZozRuXsYcBtsFv2xkXXbtJBM0CMHjL5yxGFg jZQQ== 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 x4si5058043wrd.132.2017.08.25.03.55.57; Fri, 25 Aug 2017 03:55:58 -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 0FF4E99E6; Fri, 25 Aug 2017 12:50:55 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0042.outbound.protection.outlook.com [104.47.41.42]) by dpdk.org (Postfix) with ESMTP id 6CB0899B9 for ; Fri, 25 Aug 2017 12:50:51 +0200 (CEST) Received: from BN3PR03CA0055.namprd03.prod.outlook.com (10.167.1.143) by BLUPR03MB552.namprd03.prod.outlook.com (10.141.77.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:50 +0000 Received: from BN1AFFO11FD038.protection.gbl (2a01:111:f400:7c10::156) by BN3PR03CA0055.outlook.office365.com (2a01:111:e400:7a4d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Fri, 25 Aug 2017 10:50:50 +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 BN1AFFO11FD038.mail.protection.outlook.com (10.58.52.242) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:49 +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 v7PAnw6U032070; Fri, 25 Aug 2017 03:50:47 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:42 +0530 Message-ID: <1503658183-4078-27-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318497035374; (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)(6916009)(36756003)(104016004)(2950100002)(8676002)(81156014)(6666003)(626005)(81166006)(86362001)(97736004)(356003)(50226002)(2906002)(85426001)(68736007)(8936002)(498600001)(189998001)(305945005)(48376002)(4326008)(76176999)(2351001)(8656003)(5003940100001)(54906002)(110136004)(50466002)(47776003)(50986999)(53936002)(106466001)(105606002)(77096006)(33646002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB552; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD038; 1:jJEogGRY3pOgzrrJsKsdSNxN4tlAKh0MWftlJBKgfjMpfsLCq+iB3uRbize8Lh3lkM88+L2aLBlpK6JmN0RrZOmGuv0Aj/xLnAgQ/mAo9ko1M7NNr+1TSn6/OpKXIq07 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 155c2703-1ff3-40c7-430d-08d4eba72612 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:BLUPR03MB552; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB552; 3:GJUsoCBpQP8lI3OcvtVAhHrWFhbcTZjLmQUaN8r8OnucubI6A0TuMJV92ENJeNAY+X/mDfjxR347o4QZuGwQW3/vNzg/T8Jxm8skCl2Il54ShUUPIDEcF/IP66AMX4N88aqKYT/L2TU0butxy5EMxz/xBQCTcsYt2ZageqrRgYU/n1MMqT/t59oTX57MJWDBJb5OwDIgBqiXL+Hh3B3kLb4TMftLazFoR08GCwW1rwYJ6KA07wXaSEDpWPjZG0cCt332Ce02/kHfZ6H9Q9NgqH6rQUC57b+9tCsKoD2ZzdLc76v9s+7ZIGV/fYmaNdCCOlHSFBdDqAD1vWNCJWRgITXcQr8lZAy0xCwtBhsQMT0=; 25:RY6T6tauZDQvKHxI6N9IMw5bnY/eL5vluL3FX8bHoYfHjflDPmrnAipDhdpNmTk8sugXmKOyj/3Se3DZvFy+iVFhMPrIAsw1cKRLjbFF+c4hs4k8SUdW24g3AlwKJS1zupCMo/GvQ+LSegbVDinbpFomfwtVBzlxLo/dlqXM3HXcn+ijPQ5CRf+pa0BnW+pH+mLGF1Y9kHSFTDHgoDfPDUP0gViwy45wywMOXk6kKoZTsqV357/sHBlSygpZCx9lOSpzZjASZ5Jrd8zZ3q1BYPGiMNtvh5a77OOZM2wmwLGczIkyveDcHfarboGBu9KODYFe5dxrL0WWWAXLd5aXuaqQTOJl63HBPWSJnUVBXrk= X-MS-TrafficTypeDiagnostic: BLUPR03MB552: X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB552; 31:9nuhJYRHqsHcpMhptqgVuJNQV9M/L3no2xRJuch/sDaFk3zYJ2YndsKoRofcRNYvFL9P7fB4oKX0EpN7qrrxClgvp91efz2hSQ5+0ET2t8Y9cOlHlEtmUYaF0ExTvlrdnh8vlbJEn26EGxe8KU5ALoN6WWMrAzTgfu4HfsT48GkraSxpO5QRZbcGQVnrk2CQOhVzo13aAnTAVo0MJEQia3nxk5mBMPh8MjIRDXfG2Lo=; 4:kzsNcA9x5B9Reauks5hBhNRbpnRdrGbPWXY+Biz6MHBVtD7mr3L6vTBu7w9Uzi2IFZtmckDRaQgWRv8INWzCLVoHLjPF+fVgZCj6fTJO3dwkpHdmct+cifsL3FrI1fakR6iBRR5Arky18u+RrE4gMPV6OLXFcLY/J/c7MHWfMUdvKbiRTJdIy09kiqgk7RPA4ZBZjzhbKi5BSLvHWxdCWZX8fA7dJ8MNCVk/sC+J4TvbhXbACm/M0fbu2fQcrtNWmE164X7rEmkXewBkCIFeiYNTXPDkPhAYj8a1sxDvUg4= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13018025)(13016025)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR03MB552; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR03MB552; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB552; 23:NjamE0H2TvZWLn7Igztb4FwoeBoqiNV3xIY3i70nE3?= GYUBiYOHzEN8pF+dvO9UCv+/OjDAuPImGMaTbFCszLNVvsMjfDXfLwYPaSwKCmiXUSBex4gke+iN5kP8HkKgLFKVvhnZOqVtVQDEry9UdRCVUtLjq0KCo155IH4b4yHy6mIGNExmLc/vx0O6vSBedNwGLPiooD96prZtAhiABzE3bX5vGc1TYVcXtT0/Ru4JqN+Pn9LT063r2GXCRcZjvkhIeGDGeslKuXL6/TkOluZR5kxl+X3AlQhwLsO84VwPrWkvshs3Dr057jZM1WzGXMejVVtQAS/PM3O/m2o7v0F2SSaXt1gJ3IWCnRDnCg7L4kW8PvcXKgp0vtH1ZG1GVq8BRmTbc/m9ezhNHM2ngYaE5da0kgI87UOwQyk9cKF29A4OPH7qT/iZ3vBKIHr5phVC7wKgwOVm81uRKwzsOVHJfegoG/7MBLVrpFRfk987WSVgId9SqNe3PbF2sLb6B3BXfUpuVqLyyAELYocM4Xp2lQ2kFwnBXFUJ4wX5Uqdj/0H/q2QfOVOh3TnR/5gFmGOEPMs6cO9oGDzTtlRr0niisSiOvu+AtWiVFxt15EG3+xQrUT4YDxmjQU0LK33gQ2+Ug9hgPmewE/ZodxsfWwWN4RP7DWfEPuz78wFgWtX8fn2bdbmDyd8dhTfaXCfzG20+kooi93zVrecXwpClj59pvIWe65bCb38DgN58zBeQcDfqPuIZy+1yReFf/5knQSKu3mXzVu8BQ2rckXYskaYWBz9vsXwY+i10qM2aKSeDhkKe5NTv/6JRVBwe6pwBD+gD7gLnX5V6hGK2tDAgGa9+qG9gBlV1AGs4tCQebmbE1oYMK1szGC5WpLY44croyO0WTdbbFw13FA5QWpM5BthS6JPSp5rZcqSc0CzQQJN6QRAnmwowN/ckqch0lyaLP9ShdEmbepjj+oCtutV5mUxnxM8vCwCfMzbcD4mAi8kTEeoMtqW+SjxvTQQAN4+3BvfWovVpa8AhlHSB46GaaacL/ZkZq2owRe9xetw+9qfETvM3tBZo6vjJv2dG5WSePbv2grMr2hZj1zacbgPIn1yCfPTJv2Dosr9Bqmv7DGDRjWnaxyEhE3Jm0Agy2sM7Jo X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB552; 6:D2owD7wyCWyC6pJ8g77P9PmNShnFl1WXbHoCWczeOWlzwm5Hkts4qhMijcn3069k3gep1EDEujL3P1sIuvFwSXVIkj+FfRQXs04NJy2VRPThGLRCuH+Fx6DHksQSYRw9kPDsq2waFzu7ST0kXJFMiI1Fhn/Bd/gatLbwDyF80ODpJQ61hBJoQ3ldQOJ6Tz6nTWzs9dnAOBLfV7jn6uYRS4v+1f5MjEUOO7CiGMcIcG+IIymf3yiPlVaW9T5fkPvh8vPYRv2S7bx0VNYy4DD41vnmeoJLBm9D3BEZffDG6Sf/e6Qga2si/rKoUaYxC1th4mm3GbrrwsvtxcORz+vMGQ==; 5:FPfNWR0Sh+rrbHdj7yRn4fLbNt/DhJbGKZYB0vVWiP49f4guRMkDSwVPxh+Kg60HLeFuxS0Vl10z7SQKNj/TaQzSPV+mp9rzU/KKgipZfrl2oiVkfFWb2CRKmzBIgol20hNEqDTazTOTmV5S7AB67Q==; 24:j/2Vr4tnkgj4ufqV9E8Euk+UMbmYcdvML8afiBolgqk0fBhy6muL1QTYP9m5ZcTKU3R/kvczju4g5ol75qCPvTkfhnXvE/RUaHMQGKGbfI0=; 7:SfYy5tPriu5dJ4aB2yBveCuFfSgGp0HOTHnRPoPPp7AQ3eH/6CW4zJtjptmV4P1ROkl8ZxVLo5ErB69jm4TWtahjojghMykzeF3DTkcph3+HfFnIfmZV6Aj4oMKlbur0GpV7aZJB/NxpPYC1DBTtMQDMdio+Bbgc6VZXpY6zKElfTE3ZMdhsmgCM53Gf7UBwdsOWpjsBapSIylvwoVjAx33fM/WO7Rd3jKAOrmYeg8U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:49.5163 (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: BLUPR03MB552 Subject: [dpdk-dev] [PATCH 26/27] 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index b71c51d..51498c8 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -387,8 +387,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); @@ -437,8 +437,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); @@ -1802,6 +1802,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); From patchwork Fri Aug 25 10:49:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111010 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp815135qge; Fri, 25 Aug 2017 03:56:11 -0700 (PDT) X-Received: by 10.223.145.106 with SMTP id j97mr6124916wrj.172.1503658570761; Fri, 25 Aug 2017 03:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658570; cv=none; d=google.com; s=arc-20160816; b=MnGR2hwm6MlmpOnfIlGvdU/qogV89sxQfO0vKYxr/tylifFsDz3tbqybjq1qx2Wdwh L6fG7GmFSWN83alWWbtOdcC/hOm8WlWbj7VseRftioXM7SBH03W8CNsePKZ+6xO8d+PJ DNzejYUWPxe0FoPke5osDM/iF26GTuIBFNjHP93ki8EZ3ZOe3KcnCnui9KJG8NYfj05i Ixsm7/CGk4lkL4VmbWjj5O/7fQ5tkKDlI6w6AMlp0NYi7MRHUkuHKzvTNbyGTvSn3iUQ qeIMScPjb9gNY2Yw+0WVi2WrE8jJToWhs3nurP3p0jXMwzCmD14RRFsnnZLU9Gmky56S FLrA== 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=+ka4kiYzHEvtkE6tXjFaNsbBfa6hk5J07Il2tMFgntg=; b=hl123ciryuiqrKYpvq5H3V+olaupUUdM+XzId+Yokz0Qdnq65/8Jfe5zNYGqSQoxYH 8/QEfP0wZI8Sx86MlfcqsQRDppNXfH3YoqzTvckfYRrxpRb+LYj1MYcAc2/GUpnaTeuZ Y2CGhmM90RDvMfrMaaL27gi2bF7GF7k0OFYd0zBo3LPwDFPrRvk3iaHNnk/zTGChyZMe waeayO6pKLsQK+T9pWtggvFrt6O3vdCPDeWWdPLn+PyZaJQHse3BeM6sdKilse+0SpIB y2LeRpyUAok/gFFveJhUbPzDc9hy4mdvj6hMVawr4QpMawSF8Uvcqm8lj2hzxGSdX3wI wKCA== 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 p20si5159030wrf.104.2017.08.25.03.56.10; Fri, 25 Aug 2017 03:56:10 -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 13FC999F4; Fri, 25 Aug 2017 12:50:58 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41]) by dpdk.org (Postfix) with ESMTP id 2B5D099E1 for ; Fri, 25 Aug 2017 12:50:54 +0200 (CEST) Received: from BN3PR03CA0064.namprd03.prod.outlook.com (10.167.1.152) by CY4PR03MB3317.namprd03.prod.outlook.com (10.171.246.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 25 Aug 2017 10:50:52 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::170) by BN3PR03CA0064.outlook.office365.com (2a01:111:e400:7a4d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:52 +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 BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:51 +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 v7PAnw6V032070; Fri, 25 Aug 2017 03:50:49 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:43 +0530 Message-ID: <1503658183-4078-28-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318520484626; (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)(48376002)(4326008)(97736004)(356003)(77096006)(54906002)(110136004)(53936002)(305945005)(68736007)(626005)(2906002)(85426001)(5003940100001)(76176999)(189998001)(105606002)(104016004)(50986999)(47776003)(36756003)(106466001)(8676002)(81166006)(2950100002)(86362001)(50466002)(2351001)(33646002)(6916009)(6666003)(8656003)(81156014)(5660300001)(50226002)(498600001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3317; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:2HgUGwuUA5Wo5trHrMU98O9HPi43jGlkJE7R6TKxQ/KcVqZp8HV/cOymLzHXJ+cJ/B79blcym5iTyTh2+kQdpN7VVWwQfvcv4wyytcJhjtNGBDSfGL9vRmdNGLprPld6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5832eeb5-238a-4d39-681a-08d4eba72767 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:CY4PR03MB3317; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3317; 3:Vk/KHw7iNg4Re1Uxq8P9ItR+eTRNU+f/yixb3fpGZV1xWkW+ZhRHtuTOdoFmYnezo6+3kdKtUXBo+w3DkxVQyCzJDP537lgZD8EWfJ8nTorxjvGCJOd9QZQjPYxkLohIKKhBnHj0pDRkCYzXjHm69SpHDseCaIIKLXAhfl/Cq/u+qelhQ+hWueIp5jAmztjemqDjTtCB8SvWoWEZOPdlozRsZFt7NKN6L1gLq0IIAzcGdJ9aKkS/n2e7oRpF3jze+aUcJKs3ogwvAJDVhyeaklyci7G2gw2u1IdnbeCFrHLs434Tq2y/GUTPmgy6XSecXV51s/3goec3f70wOo3ojh+EeCUR1TEDhASpQ6pjnpo=; 25:FVs3XQmKmC9mQ9nGyU9RRnBtFFyVk7X0e5C/eUgbPReBAMkAc8MYoRqa59MxL3sZ0IcXvlBMS1KBLj8TjMnuVTACBoAJMy6j2dfvhqHgrWUCr+un8+Ahhv1K1gfaLVd2r8DhqQBBKS20tvXxz5LjYN5oLLCql0/sesIYLw2/On9zmNdNWk7z15ol/lUjZRZyQjMQyV5jh8/SUP6/0xaWuyMwsowuq8v5iuTdBCx/jjV+BI4d+RsXQFWDwbp+OLpwED+ZrCbXJjag8qrKh1CCaX5aIALOh6gs9K3Z7qZRmfXVYZZ9lrk1VIFW89rZLVaKZwQS0v4x1ZYBXBCrkIthyg== X-MS-TrafficTypeDiagnostic: CY4PR03MB3317: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3317; 31:7SFBamMtlzRcBtXXepWVtoKKmkOH9zI0B/jjWc+oDv9117aMJdlguINBy5Nu/H0ccnfwYrKU5YWdU91iYWNu7eVP9f6TO924lMWl9ARBoTohhxPG2rC1afVcKzTBHpdNihgZkNLN1JnA6z9lHrhjCxHGNiC93FU6mO6/9IB+OWJDxQ39EH9LlcVSr9A/MHtXSKWG07OE6G3Q+cmi647xVMjrKJAUCOYFaF8+yfAsrXs=; 4:2Swe+OqBuDUEWC4EBlWJLxaKEEevRYbZaRS39TRnD6QqPPTZvHAA/RP/5P+J+HGm07586lvsQfbEiVIFYicxfxLuJsH5lwiZXBnA/VeLiBVSYAorv7VHaIInquAv7D98B9zH2LLjQQQw8sNRYyMqDZT3AE8V0mvh6sSG/vnjUlUfa1g5vcz88myuOEiQNTye2WZk9CBOdrnuKwbewni+aG80cdFM5aFpVVPuzCWpX/WkhiXM9+Y8sgLuWC1PF3lW3+kH3f4JWyhhadY/wMHQvlCJ9Le4tT7BFCrx3tEK9Ig= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123565025)(20161123563025)(20161123561025)(20161123559100)(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: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3317; 23:5aEP5CYJ+fhsgxMNhI2RW463VSCaFSOplP4U7rP3d?= HBs5DXI+WAO23xQHA8TAOpAQgD1lHnkSr5+5/PtNzpMWnYPbXtSIvU9heOBnyaZm6yHfV0dE+Pn1Np8aMRMlGMXx2NQiaInQ+cInJKb8g4drBzmo1Te8ebCD5y82/fbRX2Y7lL3LkRuruyl5kB85cdLQCCsxMll1wEMP6IM9PasOgEzfv9VN2FxtLzIRpT8qizsgtUOuZLODhQVP95aXsXLJ9VzHkhYkbYHBKxtd2QlueMq9J2lzBAEIAIj+mWp4VpJUlmW7lYXGLDgqn0MS3JhgTG+yKqhAcaZQfjMVSktc+IDT0EnRoSheqHoHTMcJWnPA9fEXN5hOYHvwGu1yIlHLuEfWUyE65tr+dvYBDnvfJJVWhkUZZqKsshZ0nHYSeRvL4s3W6kjFISYbEMer10DM8Vvrsr8QL1iJMe+xsN9J6ZcQWTUeCB3Bw5VrnNtCV5rg8nmdARAo4dYNvEDbxIPFA2mnHo0ilFAFVlGIymE49yxViGu+FHC9AAPuonA+02EyoDSoXJpxZncHqwyuutxtrkHa4v8PN+PQZRka3QufBGM2q8iKWnxBTehZhohSbRYAKgi51KK3ecL1GUUhREe9oUIL7uSo2pwegwpCQczMf6DBq5ItVJ+cmwH2nf4jfyxPcpM+CUxBi8jSxrw9FU9Lmk6+1Vl5NqoQq25cwUr9VV4sQ9fTdiweBG7bvNGxtJPe6T5ehW4e7Jv2LMHSxHvh++IyAMFXqItDgVBeKO+hm+2TUSVA9xa0J1HjAWZ4qeuJXwivR7D9vZ5RMiJbmtJD8bnpbYDCVp7ogW7u//2S4YD/wWOIoi+8Y4LC8e6d1IX1YEcxQ7ijnMSKHDOpSkAHwqxkd6dRg8rA9MxQ3gZyyHXgwkQi/czXDbYdaqutlqujk2RyW7hdPqjOwD9uxHWh2m7P9ZgER7BMKIc0BdM9S6EEr9UXkJBuBOczCs02zCf599IA27fdYUUUIcJXAr1ivDekv5e6iuVXofItOdzw/XPWBwOVCZa43hE3BzzAeAH9BiAdOZkZLSGiod1J8INVVFCO9pA0kfo2Yx4Z6pxc+YqEE6dnC52akVrImMrwkTyXQCgaFD1mkYDGB4GXUmb X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3317; 6:nx8YOLFWRaMFc3Veac7KpReifhuaDBUhTZIVDHHdIGVVTN+9eioAjZi66y1acurw1CiZ9VYvYEw1WqEoEmZ+9/KltxQkhjwlaiPojmGQcznjXM8XOe1yCc2LhDoCZVmQODLlm5KLdf3a9evEwc9cblygm6ITw03QoBqHN4Q5fpqaLo1Qatqip0zK19f5VWC0cZP5vVD429CmPK8xR6U5UoR1GhM0C+mTipq54/ylpCQrxaL3ReN2AKUhyGPyt5IqNKG/rz/ZfjuZ85Z3jw/n46OE024fezGwM9EJR7NcQsL+on3rN+BLcEODqpVS7BwALxrj1YlpuQPmK5qkb07FYA==; 5:TTGlbJPoeFgpLio0CONyw9gjLCB+zFD9bsqxnmDpGHUHXaBPHzRijM9ndKjgDz/eldJvOPe6bRoCBsMJX7qyUzAdJOJfAM1GQFTIrUgoeEqlMMbicpy0K2BfJ5339FjAHO9ir1XbJROuaGziaJI79A==; 24:grKsXBsVRbNW1X7Uz/qSqwAwJ2tLqx9a7i0Mp2tC3ZvPDry3rvtCsFVzZ2s6QkX7mP+WVkMWyVGrD69i8Vvi5aS1hiuti9/opbJdudidWgE=; 7:1ykH66lu8AdAYa95pcgg89nqSP3urG46QYbk7WB/4mSDNvNt6hEVu/1aAYiYAbUmE1lUzr5Ll2d2cKWR2rVitX8xI8xYkHHYuxDR4WSNjuAe3moEszKOT4QRkHUB26xoJ7FvhkOVl2Sd2smyggJnCaDYLbz8opvnAf9Ave2E86OzVl2HhWy1qIsVld+UBvz5rTL1wm+iVAQCvjfpFp75CYoN3lffP5PJZXo4FVOddE4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:51.7364 (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 27/27] 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 51498c8..5e1d74c 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