From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0068.outbound.protection.outlook.com [104.47.33.68]) by dpdk.org (Postfix) with ESMTP id 66E88FA41 for ; Wed, 15 Feb 2017 20:07:21 +0100 (CET) Received: from BN3PR03CA0104.namprd03.prod.outlook.com (10.174.66.22) by BN6PR03MB2946.namprd03.prod.outlook.com (10.175.126.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 19:07:20 +0000 Received: from BY2FFO11FD009.protection.gbl (2a01:111:f400:7c0c::132) by BN3PR03CA0104.outlook.office365.com (2603:10b6:400:4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Wed, 15 Feb 2017 19:07:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none;caviumnetworks.com; dmarc=fail action=none header.from=nxp.com;caviumnetworks.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 BY2FFO11FD009.mail.protection.outlook.com (10.1.14.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Wed, 15 Feb 2017 19:07:19 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1FJ5fM2020023; Wed, 15 Feb 2017 12:07:16 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Thu, 16 Feb 2017 06:09:31 +0530 Message-ID: <1487205586-6785-33-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> References: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131316592398872945; (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)(7916002)(39840400002)(39860400002)(39450400003)(39850400002)(39380400002)(39410400002)(39400400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(54906002)(104016004)(626004)(8936002)(81156014)(5003940100001)(8676002)(2906002)(97736004)(68736007)(92566002)(5660300001)(2950100002)(8656002)(81166006)(4326007)(6666003)(77096006)(6916009)(86362001)(85426001)(2351001)(36756003)(50226002)(53936002)(50986999)(76176999)(47776003)(33646002)(105606002)(189998001)(106466001)(110136004)(305945005)(50466002)(38730400002)(48376002)(356003)(389900002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2946; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD009; 1:wOfzQlp/CA6gVjRtL94sm3hysOt/c/Rro3WW9rhxMra5ktJSOhbLOM7QVD1W9hqVMG4U5/4F+IeM4qEzFwZKtBaIyELrFJMxABgeO4ai7zBZG9ByUXTQXSHq3aoDIAcq5+vKrXY4lkEzCtiVrkiSK/q6fUEHJs2SLoaMdmCWmGhonSJk9J2xXN4sNhvHvunuEIETEeX9KLss27A1PbU/KQSU3Js60MIV0mYMg6USi32NaNLPB+q9SabKQMR3fS5v2FWmHan5ZVL394BiFxoCSSvLwav9gDZoJRxdjPilkCWZG5yQCGiTzK/kja5jXw/VJTqMgT7hx3LzO72D1iXEYEuexV+ERvFOEmrFr3BQ04mti6RFX5ucQ2+zBi79Idi0on9/5BuutnRfe+vn1GMdGL7MCedqHzixU7itbdabDl/pG1Q9EAVUen3jvqopf/2mLTcHO4JQFyoSz1y4ASWNi/KcTSdpOTG4Ald7UiYTVO3g29hz5dmxqRiaKeyFwlwAfHDbyRQ499XS5PNwRM66OHdAZtqhF783OmQAOkKIC4OVs4llm/JVn6fIYEkOSfpy4aPyUdqCWPo2923sl39eZN3zwxbCF+xD5iSDgZLsr46wFvF7d9c7sB9bl3sPMPlFC4FbM4Ng/4zKzigXbSpTHQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 582d6fa2-a923-4ba1-500f-08d455d5dd81 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2946; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2946; 3:c/1kxKXR6MKnZG6tqrvnja4LryaNu+cx8Komktxv/1FOqc/OyDllc/fHMwyocDyATlYQQDoZ/6YbzPcUGYyXKHlZvQrAIC6rYFJeyBusy41xr/goCx10cUb+ESpveqSNA2ldtEwlu8lGQjlaS9CPlaQ9Rweb5wfW6ldl6E0VrzarRBOHm1ZiLynhX14NZ8gLVOt0HC/S80I4WxgTXNvK71AVH8krpb1Mi5xF2xibz0folDcP8kyeYoi2YRsF2ma6y/s5NVfl8/imaUhI/TbkvCl+ebJWcV+NkiNLEmsuUgiy6ttcxjeNKffpHeiHT/v9oUumuhSFUy1i1XTK4Fgwzz6JdpJjOvCjucPdgetWz1wYB6RtRWJI0w3lnIn4Oju2; 25:bz8Biesb4UlqTLzITpEY3ZRcqBGd7rdkiEloJj7KqoMRqn6S0aSlm4zGOo+uoA49FRCylBX157SVxZLABElZndjg8s+g6+VawsWdVnrB43ALdvkJ9nrEmuQkgR5qbowfJHVBcRXFkermx+ZsN2fXd+ivx7mbJLssdA2snMOFh2Xbgh2HPsDmBm3INPyFpSCc3v8+ZglEf/3PhdQsj5jbAYl9qyQ4aZJgWDlw2gdweCyrkxwv8NTc6QoRO2vTu5gr0PSF5PWIbIjRv1emGnOpMDM5wtOpG/6JGFoRhdwxSOlVaDNBJMOgvb0vktGpjrahS9ntm8DpRV566VuWVdePkI6oIr/+RbleSuywwAzYDzgfEluohHFieMdBjy5PloYifo53MzQvKpaPUYYdC8G0aCIuFsFc/ek+AxSJNli740rlkWEZyncEuKeAvDl9IwR+VghJYWxLCO6+79kzmVRv4Q== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2946; 31:TBmYKYbBmyofmxFTelhOWVCJn+VCK9y+aBpjcC5pEYhHvGrp+GZc3W18J4Q1xnCYquJIHtqHHIxKIynTERsEhSMDIUXR1W+i8uWCPyLN3/GJmpkPslWaN5zo1+LIfOaIIXqgKWT09RQYH8m8mtk7j/F9fj+4p2tX5MddfteVO2brGoQOL6ZxTPgSQGZN5om4ww3A/hrBPfMRaINt9YC5+V3IfjFw3/WMKnney+nq9y8UReuN46Lavp2Zn5a2o7Co9ANXV3OGDoAHyDWbf0PwFCvOQhvYZQ7AxVkLY4uVHLo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13018025)(13024025)(13023025)(13015025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123556025)(20161123559025)(20161123563025)(20161123561025); SRVR:BN6PR03MB2946; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2946; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2946; 4:FfNjfY7SCrCO1VI723DK7j/zOzeZFi6a9yGbUTBEAlKCQ1OoTbvmeDKBfxv/i2Dpee5RlOlUVp6y3EQHuQmeAnff80FsbCf82Af8VEGxNqYJMPl7zFhn+AMLSiwr91x1vlmlZXMWiykQtDJAssM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iagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2946; 7:msz3cy08IYRrLENe67na1IcVu+LEBaHVXxxLm0/w4xqpPmM1kuDlcD4ETJz7UmHG2xTC5b1UAw2eVn6OqYTexxmsUbJrNCkjsFmfAN7waBIQSrjhALLKvR7U+n8WphQeDyzxfLC74Ev8BYnbZ4Trnp1m78ibCs0bpW7NzuqVglTy+Y+CR7NbNUlHmkJahR5qbXy/P1IWs97Ti+F2NtzRjhCEFx4HxZHDUjyQE/9qDWGB2ZnDvgUeMmYTn4qAR6ubGCy9cZlDz8UCSI8d5GVzJ3xk14275WUhqThAWLiOvmnG212AoEigBv0Em+JCh/2ZtZu5kuYbmIf2QMf3TMi6vg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 19:07:19.6844 (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: BN6PR03MB2946 Subject: [dpdk-dev] [PATCHv7 32/47] net/dpaa2: add MTU configuration 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: Wed, 15 Feb 2017 19:07:22 -0000 Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 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/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 05c7e94..53987cf 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -476,6 +476,39 @@ if (ret < 0) RTE_LOG(ERR, PMD, "Unable to disable promiscuous mode %d", ret); } + +static int +dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + int ret; + struct dpaa2_dev_priv *priv = dev->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