From patchwork Wed Dec 13 12:05:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121743 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5383157qgn; Wed, 13 Dec 2017 04:07:55 -0800 (PST) X-Google-Smtp-Source: ACJfBovdpOXOzpawxVQPPd9nPqhZgEWwoP89o1TO5gJNt1bJK1gkLu1p6TAtW6TvFx947LdJU3Vd X-Received: by 10.28.35.80 with SMTP id j77mr1844264wmj.109.1513166875744; Wed, 13 Dec 2017 04:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166875; cv=none; d=google.com; s=arc-20160816; b=zj4qUUunFAlUpM2yli5JbNxwPEvvhC90krO7pZBLTlDPPmhxBX/NMt3H4zyMTwtVOM V3ClOvpq5Ki1u3/+YAn6yNQbYLxm5I4zbFZf5SjE7CkRcMdWaaofxEi+MuBpFEi41Zcu ZW9N5Ugz74gferkNbRvD8anNbC/Bz/4oEfj6VlbgZwM7KZXLzCFVWTDxZZiq8qk4y5QJ XqOWT1NCFDT8F8S9Ynx/qe0dntuqkFzObO7rwCEqpFK4D6puTXW+G/iZTuliHAVv6loZ 0yOs7SvnO2DkS23ECz9BLaxfpY0gTxl8XwdyufhkaEiV10Rmt56wbVYmXcr0GaaY4bpo 1arw== 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=J3E/ZANoNrfIxA1N9fQprDPtUOKR/lA+CQUcokRml/0=; b=Q7oQxwBcg3C2lkX8wBy+RAEAQZYip2yPNGRZUvYYT48qtNx6mR942F6H8qTJ3dQfDS V1WSZBNlQw31jP29hWxWE8eI9RgNyyAzqoyE9q3Bs4cZyneJ/gpS/BMxA2ksB6AmMxmm JEQo1a0e3gifYiPho1xI0opGx/7nux4wXrv+HItVH2ulCi+JOKdM4G3PLeXJvIckKE3h wBQTq7Nf5Yb1qA0TuPAegMkkPjxS6NKPHnoNklntGS21cAQAWbGylFgvs/QnP+vImO+5 J3NXP+zvSyVSjtaClX5Xzwdn3QY12tJ74+eE2qdqyiyNs7NBOH3fD/sxi8STvSG8xt2f xRGA== 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 l6si1342385wmh.51.2017.12.13.04.07.55; Wed, 13 Dec 2017 04:07:55 -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 664337D4A; Wed, 13 Dec 2017 13:07:12 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0073.outbound.protection.outlook.com [104.47.37.73]) by dpdk.org (Postfix) with ESMTP id A67501AEF3 for ; Wed, 13 Dec 2017 13:07:08 +0100 (CET) Received: from MWHPR03CA0044.namprd03.prod.outlook.com (10.174.173.161) by CO2PR03MB2359.namprd03.prod.outlook.com (10.166.93.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:07 +0000 Received: from BN1AFFO11FD030.protection.gbl (2a01:111:f400:7c10::148) by MWHPR03CA0044.outlook.office365.com (2603:10b6:301:3b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:06 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD030.mail.protection.outlook.com (10.58.52.168) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:59 +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 vBDC6t9P008652; Wed, 13 Dec 2017 05:07:04 -0700 From: Hemant Agrawal To: CC: , Ashish Jain Date: Wed, 13 Dec 2017 17:35:46 +0530 Message-ID: <1513166759-13466-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404199057827; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(39860400002)(39380400002)(376002)(346002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(76176011)(104016004)(106466001)(50226002)(77096006)(5660300001)(68736007)(51416003)(4326008)(2906002)(8656006)(105606002)(2351001)(356003)(498600001)(85426001)(86362001)(6916009)(316002)(36756003)(97736004)(305945005)(50466002)(81156014)(53936002)(54906003)(81166006)(6666003)(16586007)(48376002)(8936002)(47776003)(2950100002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2359; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD030; 1:2ksAiXTuKWgJxqoZ4maxlhY0cLi4irIIkKRVcxXEKeLEi/Hi4iJW2cfqJoRg6lZDEPLI/nj6BqeWNWKNd+9fsVc9YLczAITMnSUuWURUHPNtoPFTZbZ7aodPZ5cTXnko MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80d61de6-fc90-45e7-a9a3-08d542220392 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CO2PR03MB2359; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2359; 3:ouI+QIl5WwSz+v/UqZAAVIJ7sL+D6zbIqZwBp+jsjbBTZFNV4yUedyFnY/wZwzeyMyVF6o2vOQ/ayIIjifH4MNPSePlV3i2D8rmQR8mMk044VZbsfju4cHQW3bvapc1xn+tSp5XUqs2sWP1hVxMtSz4OjER/zhY1kfH35SoZZ+Ve36Leqck9NtrJD3VH+NBkU4A+DnHFGZrXpTvdv5kMuwqU4zJIPCPxLiI+3Khw1puPuFmz7yB3U68EptkAIA8zd4y/y7tkwMjR/GMh83uCD/C1YhntC+VKYNINPznkISt58ZdsmNqxgs+kdsxSL1MyQmSSJgw5DMA2jXB9DUmUe0KjBIiazo1/ORBB5IeV3Vs=; 25:q+QQTZfScZ46PxYLAs2M2uYiq0LcqekoXbRXRuMemOLsFeyleMDECM1oA26nhEJdA+ANids7brViBlJhGUQcE+dJAqqvUWYuap+3o6kf8UPZdIiS0CQHnuLt9lMWpcF/jWPi3r60UTA3sHdg7Eb2g+6h5DlrlQYfn5Z6o9hvjaenWol18AzzpLLLWNTagkNy3Fj958LEv0pY8YVYJZshTkEIC0xFbHfs/dJgValWSztIL5sfdMy63ae+CP4P//Mql5EY8MYvugBxZ3EXeLQryeB+9ZiQSybre2Bxb3DiOrkBJYouD1XlCLtY44yK8FmgFMsQ+0JoWpp5cwLAmSe9dQ== X-MS-TrafficTypeDiagnostic: CO2PR03MB2359: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2359; 31:8Pgtp2UAj/nGO/fl3IFBms9cmN5vR3+/6X0jOFGeLQo9m4BCfsjiEzkXAJjTCpnAHuBR9idLW8cQUOUtsdNBIkfNjnvz0Hp7q0vUjBlpxY2NRw7Vv296SZD7GtvelJUCwdb2yrN21/imzB44YuME/NrtoqIpC4rfMdfyLJhlUhh2VYFPbLVLrxtOK8JiExzcdJjojj87M268Z/S5EJ1zjGzGw74o8e3RpsEesUx9fwU=; 4:5Gshaomj6pkQ3ngLcw6/eNGAfIVbIhl8SKNc2PCXLMvGKRJcupc77k3O6DNgwdDzTmD18EApMIH0UIAeydyb8sPdrd7ggBfQYSJWVlTbDKtImivq9q62Ja7KK8anYoYYmml1O1rwdxNBXz5v/DCU3AmQ+9sTtXIbr7eXkkAtQ9RfeIbM7hBTJnX+bMrthaAfIHVuM4ZPlngqyNg9Ijlm3t1+gUVjQKcCyNLXxIw+H75dYtV4VLYqgQxy58J7XDD53zNOvubO/4y2OLov+lrZd3CsjCG1JVif8qYamgwXg1JTwzQSIuB3CDkNn/K1+Imn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123559100)(20161123565025)(20161123556025)(20161123563025)(201708071742011); SRVR:CO2PR03MB2359; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CO2PR03MB2359; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2359; 23:mTvVhonv0J6Oub2HtUZTdDCKMIXqYIoR/5plMFnaI?= 8lftG7FzActY/F2u3XGFWHk2BNk86XFCWyUBvwZNgI3vmArbwTfxc1/L4mOCBni5UsLqVFBRjaP7KRdEuhd+8oB3K6Vwa+vKrKJKCqz1YWzcUCce8LI8Pu4Nf2JJa9+duXS3//CZS16I4EpsjhTAnJooWVm7l9huYqK5PyzONm1i5W16fIo7TiRcUkvkMQrfGdA5EaQI/8AG50HOEhBSUKaTA2xq4RGz5YEyJDZk4pi3YTk+qk0+rZaIxFXOFOqn3tjtvzvHvXWjZ+zAWgDtB37ZE2kuyy9iClkQg1sngqzPgPVc3pESblVaMcPYggqSTcummjGn3TOimBx1Nw4BdapyqEzVRT7LOeaASeYBHonVhfQJsQBGO14viOuEtFdGnDcJPbrQDpE2uEfy1xpGQO/LyOq4GrvkuSVrEDUA1TUsKXa3ao7mwPSLEpCT4hX2Rwe6E4FmHmbZaDRWPi4mYazfQIeBgNznKFaTA4JPUqykvqsRSqVqSqKL/GUDKhrpjbp/jbBxfaZKYAU1nM/XEukqJWV+I/tjhn0hgN9ricLVyU1xkoaIMvSPnqpGzNijEa+vFmx1+S68AX5xE52ALt6tHC8z8RGgOw5PyMJ3V2wCuZYwfOpLR+AVQyMWTZRw13z71ouZAbU7esQdr51RTRPpLbp39BrOfKwPjTedHKQ91xXLt8f5/849bR/NJjWRoNzppjTcAZl5G3KkuvCeDqHEoGyfo0vbcgFwW2yFxhlQBMaAzb25tUIWOWcGK3jMn0jsEFP3VNrII3gxHDSviOgRUVQs5zJMHR5zJGAnUF9VMSw1zPFds2XxLy4a7FEEyhnbwL2/m+ka7V8l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5q363P9VInodbPEJHeANf7O6kjrPmwv8TtJSlEsyBGQGQI9aj/S7DujX2Ap7VXq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:59.7341 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80d61de6-fc90-45e7-a9a3-08d542220392 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: CO2PR03MB2359 Subject: [dpdk-dev] [PATCH 05/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 4ad9afc..adcc219 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -111,19 +111,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; } @@ -131,15 +133,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 3f06d63..ef726d3 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -71,6 +71,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