From patchwork Tue Jan 9 13:22:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123945 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4019462qgn; Tue, 9 Jan 2018 05:25:17 -0800 (PST) X-Google-Smtp-Source: ACJfBotMxaOOwniWp/8jA0IIj6nGaejoyq+CKaaN345MZkuJPhBMw1aCdZ584gqcxOvc7KLl1mKF X-Received: by 10.28.134.193 with SMTP id i184mr1458269wmd.57.1515504317559; Tue, 09 Jan 2018 05:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504317; cv=none; d=google.com; s=arc-20160816; b=RZ2g3cyu1EFMIlgAbB4bOVMJzfR7HjMUT9+JyOImWxOOf6nBPh5LPX2UDcLYF+oDKl 6spQ8c73xQXcb+18RhJyb6tT5pF86NXSUzeHeRTN/HVCN6MVfmhvzd5WWnwMB4ak/xI+ 3avXjnLN7AZ0Gh37hWAG0mwa+hzyZ+7GdWZHjEz8LPXlDBmrFmBPwx3D1tm5SLbRNSd6 OgTi/z/bB5j0PVUrkSHmukdnnTU2qlTLo9js9uSn3RhLvOQLpHl9uYPmPTV5Gg4pdFdj A3lZCj+HzV6Q0gykCcJiNqPvkL8ttFBtnje5++qydzrfVMiqhScioR3XbbG1mlMkxwYe yyBw== 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=CtElO0gBWn2gqpB+l76kxxBLWJyBChQUyKCirl/Mkjk=; b=ATYCpdm+AUl4IE4jPuZs9oxRRyd5A9pcu0IyoU8p8MoaGcdexzVyok1qFhdQR0VUpX /UQ5883xi1glstiZb8X9D7IVnWyw1V5XCxZQXTJPU/5r+aM86AeNIQqnYB5N+i9p3XvJ 5/e8bRS3LaxLWI1JHpxXMaO1WxwMinwPnwaGOfLsTRg164PmlcCGAyYiWutZb4ZXUOOB R9OiO/olNw6LTf4MO7c0XIdJU0OPzNJhLVv2JlQ4TlE+oJOu2KsNaIJechoEKWRRRF3f bHRKA1WtoUXMSZulG/Ta9yeGLB6PXED1mxL6cUgJLaQtcCLrpSe2YBH/1mZwfzrsWpzy gTaw== 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 u9si9527920wmb.20.2018.01.09.05.25.17; Tue, 09 Jan 2018 05:25:17 -0800 (PST) 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 [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BDBDD1B1DB; Tue, 9 Jan 2018 14:24:32 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id 0733A1B1CD for ; Tue, 9 Jan 2018 14:24:29 +0100 (CET) Received: from BN6PR03CA0085.namprd03.prod.outlook.com (2603:10b6:405:6f::23) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:29 +0000 Received: from BY2FFO11FD025.protection.gbl (2a01:111:f400:7c0c::147) by BN6PR03CA0085.outlook.office365.com (2603:10b6:405:6f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BY2FFO11FD025.mail.protection.outlook.com (10.1.15.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:52 +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 w09DOAVm017638; Tue, 9 Jan 2018 06:24:20 -0700 From: Hemant Agrawal To: CC: , , Ashish Jain Date: Tue, 9 Jan 2018 18:52:52 +0530 Message-ID: <1515504186-13587-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778324079417; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(396003)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(86362001)(36756003)(6666003)(81166006)(8676002)(5660300001)(6916009)(2950100002)(81156014)(97736004)(4326008)(498600001)(51416003)(76176011)(48376002)(53936002)(85426001)(104016004)(8936002)(2351001)(305945005)(47776003)(54906003)(106466001)(77096006)(50466002)(50226002)(16586007)(356003)(8656006)(68736007)(2906002)(105606002)(316002)(296002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD025; 1:MfxzSD3F2zs9LmWOJ38eWuEKn7JxytD1xvX5ZnqoVm9xdKgye0QSeLk8NL/uKoMojPNA9tlsatSElyCfUTkjLMBc/kCbuzs9tnexTVYNlR2kZF/7ENc42+9CxbUybWQY MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ea4fc2f-a2bd-4bab-e339-08d5576439fd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:bkRVwJVOEaXpFxsV1V62LmLX6pZcaJLxExp0Afvxh0o1UVFj0KYAn9dAr8vJ00SYB0fwKtH7Mdwa+iE3doxpbasiWtOPA+66/OEQ3WFyYOSTO3qwcoJ7jdctdqmIOnS9jLZ2VHKIn6mFrte29KRZA1/UejEfX7NVAAImIyguRNLbYihXvbDzeijWkBIZBwyTibTdqhUSAAM092sAW/eLWxLEovMXfHpErkMy+mVx/EIFsDiCx4DJma804Ai3lI5sK9kfxqp3iF4BRkZl9UE5sNLBmT5iVpw1CuBjz7T/r+Ddk0ldjf+7txzpR99V++N8t/O1p6smae50f3TeiLHABQ++iFamJ3SgaGwBjDWR+E8=; 25:q1NhgOwkdi9gwj52N/90RO23GsQUHv9EN1t3IJwhWTFgyFCAyMHy53HoDzy64s60skNM1EmN18dSHW3A8H4We5XaB00xvtRqKfsLG/S2kjVQElXvjou4v1jmWLhmdyt3bjILNkOi9jNKSNlsGLDZawIohLERuOkarKehSnpBObWkI3sRYzTIZykjSgAOkv8D4WuHehE1dlgGUC1k9ORxBvwkGcWt4FKFBAhwS1BN/fdryw9EdZ9YYcZji89l+rUF6tWgMtnSqztKwL8S0OCDdJYnCGAXddIFxxTkCoSXrdqawQI3mJPbomR0CeGEHafCtM1GhLOFaAf6YYd8d4RjnA== X-MS-TrafficTypeDiagnostic: SN2PR03MB2365: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 31:pgWFd7+Lho9yKIypUFXXbQ8RDDoqoVW9/f4ids1VPQLpzJsGG2Xlr4EsNOLGpsiz29s8nBZOOTyDic2Wluj6iVPoyu1jGHloKHylQ/FIBjAJHs8GUM2PWwvRTPDT+o+AV7HJFbnMQNLqzZp6NIKvKST1Sb0/OvRH516WlROok6pL7aUtgPcsUUeto++kL6WcDnxcx46t5vMBd2dirhLz/rVnazG7pjgDalEZ70FJk4E=; 4:XjCMmBf1RYCVBLiECpoW8dE7eh8hL1T+dvvGQUKkn3wXO8L5TFLxC6yZ2wVDF9f19W4F9XhRi9C085/E/ZwZqVFMXpJyCZH3+GzcyS3264bSQ/b8zJquzhuXPDy0pSAD4gGbqapHL4dS5uFfYqsh+Wgepvj1xPuRkhsxYQH8B5OuuC6WdZymNR44EvKyZlIcIsFQqbNp2yeoNrx7o191Qqb+cg9/2qn1bH4N4daOX5nq8uyNkzxDzcOzOEyjRZvOtZlqD5s8VOnM5n81nCFH37fBQ2hHq+AgqvuoyJmiaZ5cJLYWrTNQcUMsIqMSoQjj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123565025)(20161123563025)(20161123561025)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(201708071742011); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:+g4DXC1DLlspetZhFrx5zSnybPS8iYTNxxO++ggB/?= 9UYF+QzE1nw7K8UiB8wceiB5jYDaUyRQiJZYaoQBdUCzP02LHDZtkpc7XNAW/kujnMUUBDgKfVWsNJVKc7jS1h+j5NLDV5KAOAF/RcxvRvxI5Lxy33lsPGww1y0t7yBwolFm1or+75A0fSq6yAHE1xNXIuJkYXd8keQc6lqfwdDewMn3/A9UxOajhvxW0bi33I39WBcqmqcidkKn4+5PsYx7na3iNqgpS0CXg4ui2ThYZg6m55YuZwrNm0ijVwuct2F4jQ4pbVxZevV/xThaGEgZotZSg6YiwzJ7LEGOlY+exBSJ36gjNsHOGu4NYaoDOEtMyDmpn/kj5yQ/561g/VamB6hqi8Ru5EXgUNu5NKqCULq38bThdQymkG2/hzalX1mKjWDTHDtQf9bbyQrmscEGr8yvfXdpIjRT9DbowofP0J30treifLrseKSxB3uD8XYrIGO96x0IZYi73R9VYUNtI/acp/T8DDQD3h+3ZbN/Xjv8jUhDZ2HyVsxlAG6RDLhBxWnbiNauTK99xP3SwBIDRKkVZhhLmxikRet4JHWh7bSnkwxwuwBVJgx3iM0H51qoeQf+U0vja99YCC4kWZP7BXeXXE/E8azWFg3XkLA94voj538IvHArnmT4fIeXWVNpypu5l1Pta2zvBsy9xK3KWyXlyJXPqDji3/07ik8u0mHHyE4y99pqQKvnjgKCZjhmenYnYJ76BXjA03Jsn3Z4hbcaqS9bsz11NgYd17x02c//SksTos/sFeh8f1GnNIYSgNcW7o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ZRYXqbwjJlIM2LnT1Rg64A0eiWvPJVoY9VsxI76/+G1owbVhZBmPIkZe4bvubFU9FiB1j0cH71aBHY3EDfYBUqt0p2A/oMZVp0YKAhEWkb1GHNmAdAnI85dqSlOMDE/EhQndS5AD4sao/wQmFdPS2IB+2Ih4j SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:52.1895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ea4fc2f-a2bd-4bab-e339-08d5576439fd 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: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH v2 04/18] net/dpaa: set the correct frame size in device MTU 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 Setting correct frame size in dpaa_dev_mtu_set api call. Also setting correct max frame size in hardware in dev_configure for jumbo frames Signed-off-by: Ashish Jain Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 20 +++++++++++++------- drivers/net/dpaa/dpaa_ethdev.h | 4 ++++ 2 files changed, 17 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 24943ef..5a2ea4f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -85,19 +85,21 @@ static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + + VLAN_TAG_SIZE; PMD_INIT_FUNC_TRACE(); - if (mtu < ETHER_MIN_MTU) + if (mtu < ETHER_MIN_MTU || frame_size > DPAA_MAX_RX_PKT_LEN) return -EINVAL; - if (mtu > ETHER_MAX_LEN) + if (frame_size > ETHER_MAX_LEN) dev->data->dev_conf.rxmode.jumbo_frame = 1; else dev->data->dev_conf.rxmode.jumbo_frame = 0; - dev->data->dev_conf.rxmode.max_rx_pkt_len = mtu; + dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size; - fman_if_set_maxfrm(dpaa_intf->fif, mtu); + fman_if_set_maxfrm(dpaa_intf->fif, frame_size); return 0; } @@ -105,15 +107,19 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { + struct dpaa_if *dpaa_intf = dev->data->dev_private; + PMD_INIT_FUNC_TRACE(); if (dev->data->dev_conf.rxmode.jumbo_frame == 1) { if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= - DPAA_MAX_RX_PKT_LEN) - return dpaa_mtu_set(dev, + DPAA_MAX_RX_PKT_LEN) { + fman_if_set_maxfrm(dpaa_intf->fif, dev->data->dev_conf.rxmode.max_rx_pkt_len); - else + return 0; + } else { return -1; + } } return 0; } diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 9c3b42c..548ccff 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -45,6 +45,10 @@ /*Maximum number of slots available in TX ring*/ #define MAX_TX_RING_SLOTS 8 +#ifndef VLAN_TAG_SIZE +#define VLAN_TAG_SIZE 4 /** < Vlan Header Length */ +#endif + /* PCD frame queues */ #define DPAA_PCD_FQID_START 0x400 #define DPAA_PCD_FQID_MULTIPLIER 0x100