From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0063.outbound.protection.outlook.com [104.47.36.63]) by dpdk.org (Postfix) with ESMTP id 6344FF97E for ; Thu, 19 Jan 2017 14:25:35 +0100 (CET) Received: from BN3PR03CA0100.namprd03.prod.outlook.com (10.174.66.18) by CY4PR03MB2472.namprd03.prod.outlook.com (10.168.165.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Thu, 19 Jan 2017 13:25:33 +0000 Received: from BN1AFFO11FD008.protection.gbl (2a01:111:f400:7c10::100) by BN3PR03CA0100.outlook.office365.com (2603:10b6:400:4::18) 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; Thu, 19 Jan 2017 13:25: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;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 BN1AFFO11FD008.mail.protection.outlook.com (10.58.52.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 13:25:33 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0JDO4f2015351; Thu, 19 Jan 2017 06:25:30 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Thu, 19 Jan 2017 18:53:51 +0530 Message-ID: <1484832240-2048-27-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293059335544980; (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)(7916002)(336005)(39400400002)(39410400002)(39840400002)(39450400003)(39850400002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(36756003)(189998001)(97736004)(356003)(68736007)(104016004)(92566002)(53936002)(47776003)(38730400001)(54906002)(8656002)(85426001)(77096006)(50986999)(48376002)(50466002)(33646002)(110136003)(76176999)(81156014)(81166006)(50226002)(626004)(86362001)(6666003)(8936002)(8676002)(2950100002)(5660300001)(6916009)(305945005)(2906002)(4326007)(5003940100001)(105606002)(2351001)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2472; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD008; 1:bIrgC0m7wVNNcQkcGd9/kyDEplPSoG3esMXXD+itaM+kXgGGSsRPtJjiep+leuUbtEyw2f2Qy8A08UFl7jpUR+GhOQrto2MheERiGjlBjYry7f40vkf1Z/y4QM/gnBRstrpTyTt9IonUorkg3yLsJQSgIDae08wXSGr6Ke/IxtZekGU9mtLqEKTPVA6P77YtcNLbpFRWSqRBhlKjQInEuGbPGm55z+4F9rS1DRrkfU2/4dLsw/673u//OxEjtFSnLy05Q843x6CD73Eqp6fYT3TgFXDz7EhQwxidXF00iItA+CFGnmMTF/pv+tGxZnaHSuEqm4pTuPVdWd/Ef7wud4hbyNIdY8EeqmdjP1enobyoaOBkOCtGcpvS+Wpf6XP1Rg0cHKZdKCkJLR8RSkU5hl+il59V5AXl0ccsLVRvIzQ5nKQ9D9wi3R/Xmb1PzzE8gT8SX3NeNNja41/Rygeqytqy4gKAtglRuxyrHX52gkcf39g49u51UMKxAJcfQTtpAVuz/mp6ojdsLf67l0k6AHV/Fxrr1E5jrFYw3DPEBxyj8+kdQfJILuXbZJXe3pIH+HfzH2gBPsuv8YHywg/WvsggWSh0WzQk8BOwkNvz3G48TobAsWEpGKUy2T3RrJKsoNqn8ABiamRdUSXA8G9B+ruiGw8ZyQ5qSezO3Xknn7IcOqXbsM4K237fL3pGSZgm4YFMiIyBTo46X9tp3aXN8AKsJsZSfkdfWpeS14rDU08rIYMw1xEEMQgqlKD9p6e8 MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: af1f3fc3-e3e9-4131-ff37-08d4406ea59f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 3:sYzK56KRK08Frl8a0Nx0bKa+YMI0hs/tjOI1JfkMmxcxRLT/+JFB+n8NlHJX2AU9D/mP6c4szau432WirUAxnJcHJ6ElkKOIlsNjPsvRYye8OqCbABmh4hmWSurNOOu/Tth1Bfx3UxW/yNXAnvujHpYj5TrX8G3ClVyqzCBkqpKRgjM4/VBV0d2URII9N2MK2S8/MCYqAiKTyKByT8lj/6gK1tydDSXAstyXUhgrFIDLRRl40RLHw7ZVh8fiANZISr3EUTLpkwch97inH8LJzlQ4wbb/z1b8iZwHwGE463oQYEvprza7QlvgNclgf90cOZAWp9ymh/nFpj3fTWDD7ORe3TTHCufKtIWCRrdblRV+iOdYbwTC082RMGotQSpX; 25:I39+U/F+NMVW+Rzy+vltuw97rOpZ2TVvEBo8AM6itnyMaCo6ztKwrDKSOvu9ruQfGKK3r/Mx40x8gU8c/uEdNORlgleT4jHpjCOcBsqtAilVOD3yOQeWX6NkLlMdMzVpD6tXAZaum4jzDPC6XpaE+wA6HX0sbq+/7UOqq9uQlHRGVGZauTt/+Wk/AZLMwLo9l2OVZEg5fuAD8hkSKivj/9FxqilAxAUfhLEq7E6XR9HeLAy+um0CoVCbqmowd1CsStXA1PCs3FYtEhSk+eB78wnPJ+YJjJmWliJ2Qp8Z5xPBdlFTjo4zJ7TMrz9pzP2t19U+lHJ0gV+XE4nhuwz1M1cbnEVlWqkcPCFbC523H7mjpVyZ3/G/D55AxVIJ6UnECxySyDCEwqARrOqgfL3LONLiKjl0Q7dU+U4azKCQ83Nd2uHOSWTZhSiS3A3dJf5aLgrYYNOifF5n/3MkRtV46Q== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 31:YFurOvp/x0E06DkDtkex6zH3pyQ7NrZwOiuzVv/Lk4L8WwVmcLm0VLd76cnIOGmEyxup5qEJ3s+FkZUuSWkp4Q6qAMSPcP300LuRZK7X/Fxbn+9xMLsHiT1y77gNn+1uVe4x4FBuYCBdYzylxKpc87bvJ5oyKtrWXWK7I/TpNK52eEDXotrg5fS6HGfptxOGXb2/OBY3OR2JraVN9UEFNiHhULZiFgpS1qAyVPkF1ET+DW2vEURCoNpScAShQzj+XoZBZ7zbwLjqmSuSqotx/JfOkl2qDPak+9LqtN7KoHo= 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:CY4PR03MB2472; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 4:fpPMcRvlpn7nkyjjzETzyZyCTEH6GD/nAs3sHR8Tzed/JsHCm5GZve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NjeY9gGf/tIonBxs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 7:ouIfLKXwF1TJs3Cg+XJHrVyJDKr0Ry7hCF2KCnFCd3X2cEhQt7hQKsEEQ3vO0I+rMo/iOCEhs6rXQD9N0ACrDzn/UfN2zsA6u0HHG/6NQZhHIbvnfF6zgojmofWQHhwMmr4nVANQImd6mNEkzRdQUxEdxMXbe/Z9O+R8mdFz9HX0x63MXc4V/54lfVlrTTl9vM62tgZ/9qZwTrgPFeXSW6nri1htwoLhYgKa45iX+OWWDdP+WmwKHY9/N0Eh4GxaVKdIVEETxHwadSblnO0MbpAKwY8o0PUx5SNROHaBaljM/p7bMqkVoil0XKLGkfgG48RpebnvtTmXkTfUa4CPTJcfCZQ05QXQTlhGHbEenrmsKKQPugPMNkGa2xTGdRppC+7VWJZ3GXx/Pk5U3BEA9T6juZ/Mjbk20cOt5CabGvasK1ueZnSlNA7+CjAyeultdrvm4uaxvzARonKg9zcTZA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 13:25:33.3673 (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: CY4PR03MB2472 Subject: [dpdk-dev] [PATCHv5 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: Thu, 19 Jan 2017 13:25:36 -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 71361a4..7c6cc7e 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, @@ -485,6 +518,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