From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0071.outbound.protection.outlook.com [104.47.41.71]) by dpdk.org (Postfix) with ESMTP id B7348FA30 for ; Mon, 23 Jan 2017 13:01:33 +0100 (CET) Received: from BN6PR03CA0038.namprd03.prod.outlook.com (10.175.124.24) by DM2PR0301MB0749.namprd03.prod.outlook.com (10.160.97.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 12:01:32 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::135) by BN6PR03CA0038.outlook.office365.com (2603:10b6:404:10c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Mon, 23 Jan 2017 12:01: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;nxp.com; dkim=none (message not signed) header.d=none; 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.803.8 via Frontend Transport; Mon, 23 Jan 2017 12:01:31 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0NC07em019311; Mon, 23 Jan 2017 05:01:27 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Mon, 23 Jan 2017 17:29:54 +0530 Message-ID: <1485172803-17288-25-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> References: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131296464913775698; (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)(7916002)(39860400002)(39450400003)(39380400002)(39400400002)(39410400002)(39850400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(356003)(48376002)(104016004)(81166006)(8676002)(5003940100001)(6666003)(68736007)(626004)(6916009)(2950100002)(5660300001)(8656002)(189998001)(97736004)(54906002)(85426001)(50466002)(81156014)(50226002)(53936002)(8936002)(305945005)(36756003)(4326007)(105606002)(77096006)(38730400001)(50986999)(76176999)(2351001)(110136003)(33646002)(86362001)(2906002)(47776003)(92566002)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0749; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD046; 1:n1KHw98X4asThXafKDA93m5o4E9lccnqpVtEDRo8CxkNBRZncaDB8Vx8mrQsr3hvx+ms+AKZ2QqJTHaVPy3IyRRL68oEtE4QHRMSRPAwByzxLmxjZrXzLU1/Qlgw+jAzuWbjfm6AO2HfYacdKS4RVanvhhle7PeCoB0wKzWD0SZtUFELdzPXYIaypezZ/aDb/48vLC2BSWsJ6Ku/TS15hDFLE8AHv2ilHBRm95tixBLzb2RdKLGQHmtbm62ezE1tNk7DGHH1Tq1iQu3nVpfCniacvLGS2K3wzdq1VZXa2wmKWtAKG9oC/4JeQvIrFkVPMLoEUJ/4mMN7O8zNDuyCepgNy0/BsC1OSarBjzca0IjasADkVW75NUq5kF8Nb0sCCe2itJb95V3B/hL20mzCkSG03//QzvZWGmBZ5FgEvEBrzrHK4E0saqDSkOrUVsnCpi1giIsfzeIdL7AXqQXRh8a2GpryXR6GXMM6OalJTVOchW9mBKhNIXj0ITKThFAl72BmLUlLTeniL8RzOB16hQw7IIpE4nzBM1fMe78/u/dW+Cjt3j1tpq7DIGTFqo3GzTBvD2Kb9/b6+DgqXjgmQdPkFVzEyReUNrZq3+hHNcaB3dZYoCKa/d04yLf4eKTbL382LrBhKA/CJQ7dAIreLDKFU26Uoa+Bi2PZ3yJRhIUnIpbWiqZLMBZ1iZ5bvOhp/86Z/ppk9yE/5V4g/QbcGo08eIB1kPCbW6nMXGpNolNmWDU+gszLRFW9EWt9spUx MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 91a359d1-7009-4430-3c52-08d4438791ea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 3:OlPmZ1s24QYb7FzECRDn+YmGgbZcqBHq291UW9gmZVW8iBNAQ+qy0Lkt7U9lpJBtB+QhjwFcCVSslYgPE/shzmUSkqrBbI+YDokVkxdA9lpslN1hpUTGcFa6S7NJx4mPKKxfHVRwa3I+KdvEMSOGBdXiGO7EjfFc72OyyLlZ5iychCmR/Iig7F0L/QlNz1JuS+cEdtML42Sy8P2Hro46VI+gn4qs78DgMK6oh8iwxWCOA6jjeOBXrHye5fHGsLu9XQBzdFGpGNi7IbJuLzr8gvqKjvt00U+pHSU/Hf0FT2XZYVyk7kP5gi9+Ncv4VNFwCxwA0XvMeQySvcNA7GOFeEfMUQjz5U6ZIj88GNAR1/CkMS68HPUXTahnArygNp3G X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 25:tg4BtUZGEbPfnmpUskV6ySyr5/E1P68hpxJiTBTPeXoHIyARB0WveD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3013opaMg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:DM2PR0301MB0749; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 4:NGIS67Ui+L67sXByPLwis6zqxpSi8RrtK6SseNjAMs/n38I6JxuKXzIiXU+gTGogUwnh3avJazahfnLc15d/u9SV8YzDUL+2QScOc0VTVVERU5sRBA11MD5YhAuqwmHJ/r+9iMh5utBzA3VEvhyOmegM/DS7krrr8oQG2EOg+TryQqTYXS+/YbfCCOIl9jW56tnNku7sdSoIauWNpeTzwAa/9sQTXjX7Yx+rdHY2E6E5OHxB1FbOwwIka+WxOva+hHmiP/HhbecQ4W1KTommQbO1BjNIokARiraASja2xpvwv/CrWxXFukgaiIJ30j3o/n7IFt0Q9ON6tmdPuWEqrM7JQ1OgZnyuROjhDvcsQYGI18RA4rFrvPB2Be+gX0GZcwl/ux1oeCLlF3uo52uSna2IWny0WZ5DTNEzpItb3B2a0FP0A7JJsLXepbenTzXzUar8C+UV27NLQt6YgvZjgpiM76D57WiXo/EOA+j1H+d301U8Hg1jBcdCm4Jvbo8yPJ1LZZPcxDhBgWi53pIXp7PU594xrdK0N6FqyB3xaPrcFwGef77Hd07QIVTgfW0pxeeCLIGdcHD5Ds8VFqs1+R6kau5/uf9Cr4+zqsRETaCNjp7d0N0Cv1Dp35uXscXT+BgbFp3vGldVIrpxRjwEXdbmRSN9iZapiJu6LqVQjF4jKJaeJSxNqJiEVdgHtMAG6XHzWVF1tPjPlXlsGFgQdxORR8uuwqZwe74k89J1iIm8bXA1TsCBAnFeygFB1cHrv6Gos5aNy64NZldyNz8rjA== X-Forefront-PRVS: 0196A226D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0749; 23:ggiXSmmTpR8iQCAX5s/2fBwCnK6JGzoeWxax7dy?= =?us-ascii?Q?4vD0q7IVzxxVzAoee4dFl0EDiroAaBd/r0sd7KcC23nUA0BYbwd4eGqLIwOq?= =?us-ascii?Q?ZmVW8nPL+jcls5XPlKqn8H+z8ON273ZyuvLWHz8AL25HmL2l0oMvkE1IQ1Pc?= =?us-ascii?Q?m65dWvN2zzt+zVAzNMMJrhRLZZdIhiIsuYDr5Y4B/t37tdAcAiC0FMKwfMCD?= =?us-ascii?Q?FZsG3rXdGzllNTzRfPqqs+NYu0GQuFPe9FV3oPzjcFnlUxLJW4iQ7gZRDBZh?= =?us-ascii?Q?ZJhqdIxd6V6JXYR5t4U7dxi+HbUdAPZMQcg9ffCNjfFi7bMTI+2kYeagcJBP?= =?us-ascii?Q?ardSrt9EtUT6s7TenW9Jz7QVz9DCWXoQj+afvqtKBewGOBUhZGaSLQPXvPi2?= =?us-ascii?Q?4x/yJQ0WMZ2DMdZsL4duvIVRjL7xrH4NGs600W1huDHYdYtUf+/EQtRv4x0S?= =?us-ascii?Q?n0LfN1/+0oJPrQtD/djXa3ij8W/mjGWzqK+WN35x8A/EPR6CngrnogK6X/W0?= =?us-ascii?Q?q2IicvFWOziPX12Kxj3xd3W6SoxdiI4/Kb2de4nQKkBr/e8mesHov9JSBKgX?= =?us-ascii?Q?ACmkoBlz8qDWEntZDFVuhIGXK8lLFV4OYnIeHze/c4sU52OFQefBHenx1Olj?= =?us-ascii?Q?hM8poThdpfmWfffxNrVX8qVOf+sAgwQ5w4pUzWjAnLkAJBsadl+da2U2Knwe?= =?us-ascii?Q?93TChUX8rTrHDIfBTzlN6xBhlt3I5jenKOdaCr8M42j0YgIWAHeTOntjlj4y?= =?us-ascii?Q?myvzi1YrfJAuPpSIWmcEdLK1gfbKJaULvVOAB0W2l7ui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/wY2+WU0t+b+2zJSvus/Dml4SLpOExNKkGjKRYT9xRN6KAQjOYCkgtn+; 5:sJ9KsNvtDL45Kop26x2cbpTBHzftB8kIwhfNuP41oGnbxa6ZWS/QvOvZJ7KqUVm4BoXx+a/AKNONtQ8WUuKkYFHWLSmV2Ex+tbZPi4dT9UnHW/Z+3TcpkTdZTHWwmj7YMzG1dKAei0Ekf2adxejq7cUd4XYhmnLm5HjibqnD6TVPeC0aAb+XTGSQnLJ6I3H4; 24:AzScMb2Tto/2RVCqTjr23W+ylwHRa4KVbl0MjwuylFqbGfkruAYzKt7/155k37SSHVCQ7yUo0DsBZ7A4jiaubnbNaEJ1PfGU0tovFgds3d8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 7:VTmPDS+4Ztky1uOw+3MLu+YXgLC+Vtj0kSpU9W5Znbg9aQxmQtdRpYfukgCYFZ+M8v78R3laTETuEbdk8kwYBYPXMbs4HbBjfaKXT4GOv2pTnMtjaZ6ak5FN85BlDetisbS5K99PNR2TEkHmsYGZc60jc9/Ny5czqoZhCK2tblMyhoN2B7R3C7Orn3QFOLPUKZlZ7yPzRKnYQ3kDl041pyw8I4uYQGVZcUVbEPzTrWRKIQJEXuRlV6DP93EXzjSGiXoKm+KqUEaTu0DBHGuR3yskqnbXkMRc4fEdnH56sUSFdsACqbkCSxRVB3VWJvXrWwsqQ9jhxOVAa45N2AyaSSzx/bquaIGErjcb38AcbmvI3O8zuK6ZOb8+hWYZ4DTaEWGOyvvLDqO2mn7fIopfvARE0QxXfQnwrZ5r6lQ1xgA+jbBg3cfe27qtHHcOAx9WVdKk9js/GqqXGU5HdZoaDA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 12:01:31.1435 (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: DM2PR0301MB0749 Subject: [dpdk-dev] [PATCHv6 24/33] net/dpaa2: add mtu config 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: , X-List-Received-Date: Mon, 23 Jan 2017 12:01:34 -0000 Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index b7c274a..a6b7964 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -5,6 +5,7 @@ ; [Features] Queue start/stop = Y +MTU update = Y Promiscuous mode = Y RSS hash = Y L3 checksum offload = Y diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 1af93a5..2a8d9e5 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -43,6 +43,10 @@ #ifndef true #define true 1 #endif + +#ifndef ETH_VLAN_HLEN +#define ETH_VLAN_HLEN 4 /** < Vlan Header Length */ +#endif #define DPAA2_DQRR_RING_SIZE 16 /** data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + + PMD_INIT_FUNC_TRACE(); + + if (dpni == NULL) { + RTE_LOG(ERR, PMD, "dpni is NULL"); + return -EINVAL; + } + + /* check that mtu is within the allowed range */ + if ((mtu < ETHER_MIN_MTU) || (frame_size > DPAA2_MAX_RX_PKT_LEN)) + return -EINVAL; + + /* Set the Max Rx frame length as 'mtu' + + * Maximum Ethernet header length + */ + ret = dpni_set_max_frame_length(dpni, CMD_PRI_LOW, priv->token, + mtu + ETH_VLAN_HLEN); + if (ret) { + PMD_DRV_LOG(ERR, "setting the max frame length failed"); + return -1; + } + PMD_DRV_LOG(INFO, "MTU is configured %d for the device\n", mtu); + return 0; +} + static struct eth_dev_ops dpaa2_ethdev_ops = { .dev_configure = dpaa2_eth_dev_configure, .dev_start = dpaa2_dev_start, @@ -484,6 +517,7 @@ .promiscuous_enable = dpaa2_dev_promiscuous_enable, .promiscuous_disable = dpaa2_dev_promiscuous_disable, .dev_infos_get = dpaa2_dev_info_get, + .mtu_set = dpaa2_dev_mtu_set, .rx_queue_setup = dpaa2_dev_rx_queue_setup, .rx_queue_release = dpaa2_dev_rx_queue_release, .tx_queue_setup = dpaa2_dev_tx_queue_setup, -- 1.9.1