From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0071.outbound.protection.outlook.com [104.47.36.71]) by dpdk.org (Postfix) with ESMTP id D359FD250 for ; Tue, 11 Apr 2017 15:50:30 +0200 (CEST) Received: from BN6PR03CA0093.namprd03.prod.outlook.com (10.164.122.159) by BY1PR0301MB1285.namprd03.prod.outlook.com (10.161.206.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Tue, 11 Apr 2017 13:50:29 +0000 Received: from BN1BFFO11FD021.protection.gbl (2a01:111:f400:7c10::1:116) by BN6PR03CA0093.outlook.office365.com (2603:10b6:405:6f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17 via Frontend Transport; Tue, 11 Apr 2017 13:50:28 +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; 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 BN1BFFO11FD021.mail.protection.outlook.com (10.58.144.84) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Tue, 11 Apr 2017 13:50:28 +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 v3BDnjG1000706; Tue, 11 Apr 2017 06:50:24 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Tue, 11 Apr 2017 19:19:28 +0530 Message-ID: <1491918578-4902-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491918578-4902-1-git-send-email-hemant.agrawal@nxp.com> References: <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> <1491918578-4902-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131363922286678456; (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)(39400400002)(39410400002)(39850400002)(39380400002)(39860400002)(39840400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(54906002)(5003940100001)(110136004)(36756003)(2950100002)(8656002)(77096006)(33646002)(106466001)(2351001)(4326008)(50986999)(76176999)(53936002)(50466002)(105606002)(48376002)(104016004)(86362001)(6916009)(47776003)(38730400002)(5660300001)(305945005)(81166006)(189998001)(2906002)(97736004)(8936002)(356003)(8676002)(50226002)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB1285; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD021; 1:dOCCGvGdPDSagjMs1xhFAVof7QJ5IYCfbuV2DK0skySRkXW91EjyIw3zRt6pIgvtfdP8xsNfhLRvw3f5LVBOLjsbTukaWvLqvh4FkEr3dJXRLYrRRPbOVAqJwveILu8UCJEnxCtOouNvVWXWoDBB7V7SXwoQ5BxkqM49wLl2YpavdnRyl0MZpCkLCyj8Lq+50XuyxExpKet+5GBSKRQBeuYQvwlkh8MoCA4JEWTXnIm+TaG7Vm03e+JAqzFerGZ4vm5L9gbqKwfq4n37PQhewCjc6qApEWtOiiDaNZukAVABmmKR7f/sec2oAcIAaiXJUvqqyP2xgt0m6+83Y539SG9khrXhAfSfqVSECx2ZfIvIJPuUaL1dtdWXXYDURzzzsJk6g5CiJtn5SQ8n1S5BmBjZv4SK5xztvbkCxjyIrQ/VS7ubqvX6cunapzthvM/foGUHRKe1Q54jke3NTzi9yNBU9dGUGUeFHrHEWgMO067ZQ4p2L/7fX8KQSTeOwxss6H3Gah8B44ymHqu2ANVqikt0yeAIA3D4OFDQV6xZ7iiba3a3hTNfqoBMQszrpgi4ZaL47T+GwZHMJsavH37crxAFcfHn4EbakzL6ULzCvBPI1t35j1UwDYEvf4sonhr1wpsOfbxaTOmxwfQWijoJm70slozlt4B4+7A70WRj52U= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: fde45462-7436-49bf-b057-08d480e1b6a7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030255120)(201703131430075)(201703131517081); SRVR:BY1PR0301MB1285; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 3:Gc96cb4ggFN8oj0TbJJdXleJ9vPW/eOQ/d6ad//fKRUKMoMZfjmR1Qv4VqNtr7teHzkTdgjdV3lQtLtdfaLZBXBfM+3bp6AouLvv7yvdQJMMwcnmlN4BizFXN4Wk+ZMPbxbXGknsbUu/e09TKyhmTKactDtv+8veGUQVj5Ry5mKyJ29rir+5acPdEqU56obbbYd7LKUKhVAAHjfU3G/6i8FbKmW7M0C5q5gD2o4GUP+w8htF8Y4xsgsjTibereVoqmwGID5t1BEedKywtoA9w39b018kpWIGoOrYlEJR2ei5/O+GkzZl7t5767aYz3T+h7LYl3+bmI/0WoKe6fppRUw8qvevEYOPLZYyLAkwXjJZg0dHwemLP9EBncEV5LIiY4A5cDvbjv+5hoqb5QnskVPismif/DbfcJMgWqINOobH6a6k3y1ohajOutnPB1xwFeYbuLo9x7h6cEoICia7aQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 25:26OipAUYV+WV4klq0UjkpfOyfqvniQliYEM1nh67cwno8dtSry33f8ULKCxcMNG8o5kA8I7ES3/ejlKnHc6oX2rMXjcuB2Upv3T2H3fwuZWn0uwMaLu/rp+RJOE1BZ/yptAPiMuQH2mo6+IlGWe/w4dOibvP+qoz6zO6n1Bl3mQJWuQ5v8ik2DQ8Tbrs2iMGv7ey0dr4ZADxdRzx1m1MNwKhv/KJxFFG/ZHJy87bdmw+RU255JoOipyCLB24pyCcWFIE7QK7CpZcoGe6H4kd4VrHttPfFr4pjddF6FPv9H2hvJcPDgatMKyvx78yONUenv+ExUQ8lC6Hm0ade7Rr1Jhtis5F1akxOKg308kTTzvwGa1hoMZ71IPcU20PudSVinmg1MsXZJz9lGkLMywETiGNsZTry7Tqq+MIDEmKROh7T+WbICtEBXLeaWBQuOSpL09E0paqI75Vwc10UUAQmQ==; 31:Ul5FLzGtEdlQMjNo11UCifnvKHoPrJ17jHfR82ERxElEQvIY+1ThphZpzFsu6pnFGWDXj+mpbe1uvLobZL2sEykP/UeOEEqw1xZUzWumaGuZBToIWf2NMD2BrRFJEmM/T3wLumHMwW1Fo8rFvZiF1oiBhvhcDhHEoRuWKJdbnnxYz17RbzRCx5SNN1f3wEu6XKg8JNuviIjgj5ymTeGTCus1uOEP52SXKHTKvqR69Z5YsSQ7MqTYrgeQHwAXgo9q+SWg66y5IiVoOYF04KU7EA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(8121501046)(5005006)(13015025)(13024025)(13017025)(13023025)(13018025)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259075)(20161123556025)(20161123565025); SRVR:BY1PR0301MB1285; BCL:0; PCL:0; RULEID:(400006); SRVR:BY1PR0301MB1285; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 4:fZFvIXnO5Qvs17XVyRoKqa31NS+IZHAsy8IxVr8P/oCL3VbWF677yet0fql9po5prjb5bqtsu9KbFYsmcGOx+wh4sjE+4hev7k6ZZEuMlCG3opPGPoa5DVnkS4nniQNv0AQJj6SYaraudiO/c2l2Vq1eql88PvIdAIEPNvPulPaIoJZCnWHjYG/i88U5xUvONh7wmRY2cvtjjNbNgul95v5D12oMBeEkBGn9fNWwaRIZ72xSx37pIKk5L8FvQW6fXw+5BJgZwi0nbw8Lk1ADAQZUJ1iKq/9316Htp6qvSis6vM05K8gcCYBWyr+yH/HgwqMtaxEtRsPuuNp8M43J+PP7kqLe1wzzEoZg3oav6l1oi7pEEyGyWHD805vcYtIIaXuY2wPb9H8K3k6ZlF4yffgzzIsUPwUHF/pytG6qhh5EA26SbnRmwoURymqt18x/aFuLToZlfoz9PZRv0xfCSRd0KhCFIps2Q8e3Tw/x/VuopiaqNsdY4wtROY2ow4CQiMTvMamIuc3Lu3qwmiGK5myhb/JdiVWuu39wYqUZZOKJSlb2+2ccZUuI1a+27dPZlNl4ISGUSPZRUX4vDkcYOyvjH159YM5iG9By+XsTKMialHO6UndDkJNWXXqT5B6niao+N0dVco0TZaiEAfSZIoAdod3jtbrnm0K70kL8cD8dMFACcmby1mRXdLHjkp8+zgxLqNu57UO5wGH9HC+CL3P4ojr8usVzfpWWAO8FstBawvvoUKegKXL58Trc9Zhu0F/jLntrTeuf/TSFz9qMMi6xhPkQaHokfZgfGfbrKXC4baMCgjlxpKD4rQlOoWy5Uj15U8geMo88FgKKpw5PbvV2nvIyjy2X1Goq4RXGRkbwVg7WEh6lhgeGSFFqv9OvhZxU2g/YuQDB7eImYJASe8qephLMie+vjathD4oyi14= X-Forefront-PRVS: 0274272F87 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB1285; 23:9wBdI/xhF2zznFbdvZbCYmVgKiUJZq6kozLjLeW?= =?us-ascii?Q?P1Llk6k8v+xCZtq0O2ZbLZ0S/UVhEvvWl5n0quc+/RpskHE0QpiweUjmyo9I?= =?us-ascii?Q?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vMbc/QUvgKZ2mi2y5ZY4d3A8k5r4tLI68qn/odGMqHdZwOQFROjx4LmVZU+Sbh8P4lvLcdA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB1285; 7:8GeAV51rPiwluso6Aq86mOW3s+JdHYnWY9dv52G07EmoC7z9/WQFgbW9Pn/hEV9d7NKP70dLlahf7gvU7SM7vhmDauD+MQvrWL1fv5ZeVjRYPexc64f51Y7+lfn3e4RpNzje2dK1XMi8pJqX9KFJKZy8ff244piNMGBrtmw9A67vJcAtj6rKeXIn7kH4IlewbPVbezF4497V5syYcyuz9aBnxOv9raWKXUVfgQsa/+zVOf/uuHYGFXVsHV/UO3XD1Fx4Ts8KEapeO89cplSdqJQdrG9x5h993oXfIxmnGW4ZIxf/9OoCLRbs63LTfV3hSsPSKvFGGcHHfwYBtl8k6A== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2017 13:50:28.4650 (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: BY1PR0301MB1285 Subject: [dpdk-dev] [PATCH v12 12/22] 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: Tue, 11 Apr 2017 13:50:31 -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 a3b7020..e037bdb 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