From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0062.outbound.protection.outlook.com [104.47.36.62]) by dpdk.org (Postfix) with ESMTP id 53C08CFA2 for ; Fri, 17 Mar 2017 14:09:32 +0100 (CET) Received: from BY2PR03CA049.namprd03.prod.outlook.com (10.141.249.22) by SN1PR0301MB1968.namprd03.prod.outlook.com (10.163.224.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Fri, 17 Mar 2017 13:09:31 +0000 Received: from BY2FFO11FD041.protection.gbl (2a01:111:f400:7c0c::191) by BY2PR03CA049.outlook.office365.com (2a01:111:e400:2c5d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11 via Frontend Transport; Fri, 17 Mar 2017 13:09:31 +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 BY2FFO11FD041.mail.protection.outlook.com (10.1.14.226) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 17 Mar 2017 13:09: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 v2HD8peY021077; Fri, 17 Mar 2017 06:09:28 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 17 Mar 2017 18:38:34 +0530 Message-ID: <1489756124-10805-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> References: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131342297716790527; (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)(39380400002)(39450400003)(39860400002)(39850400002)(39840400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(47776003)(54906002)(105606002)(5660300001)(305945005)(2351001)(189998001)(356003)(85426001)(86362001)(50466002)(33646002)(48376002)(50986999)(106466001)(76176999)(2906002)(4326008)(110136004)(5003940100001)(2950100002)(8676002)(50226002)(6666003)(38730400002)(81156014)(104016004)(36756003)(8936002)(6916009)(77096006)(81166006)(8656002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1968; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD041; 1:6DA8nWpKh9tfEXKpDVfc/PN8aKmLX04w+DP2OHqe4Y9VwaWrFxmeA39Ovsfc+MSsN9Z1QGFeHkCJwhGatl99O82e2cECE2yFIPPGmbiM1NMCHEZtBfy4zMtjfG9JQRDtZ94pkoFsFcMMl6nOjKAZ3BbgXH5zIxU7qG+jad/O8n653dMHV1YmSSgUq8tho7+esAdlb/B1gPpLfz4+5MUrRbKjo9woPjuLnHGV3/v0He11Kybg+e3cBTodF0lVFm2qRgS6YnqW224TvDbss8x+rsSfqVdlLvUY+23bdJO5zlixzVJ7T7cHXjAc2nm+p6nD9JH14tBZQA+z4QleSCbhLDj5Pq3auCny/1FWB4jN2IQOUAi+1Y0iuluxDtIWgQnJFr6gyB6n585G4ODLcVrCI2l25P0GMOOKJsZL6a2pn++QA9wMAA5BH6MIuQDXw9pCqkoi1MsRkPBCbIP4jldtE6aVrcOXCRKzPHPim5mrt4KOuY8Q4pj2j3CArOykbW2LsPkQ7C3PgUj0vhCEC1LP+C7DDfs8E7nrqCoDaDujn+zl5CjIAlAqLqLmpQRqFtPCjD43XYMXFwIH6MO6Fi1G3ENkTim2jBeKYJ40k26VGPwlPNJ811R99zUkRYdwzhSyDyqNC4m8zSOVjMyaJBYx+A== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 2c9ea402-42e7-494d-eb58-08d46d36d9ca X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN1PR0301MB1968; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 3:m7wCzUV/WlhoIdfYJSzGuPmHENVt9m5pZFCNs3nDVnQmpK9AT1Sqaw1XyZTH1MIl0UwHADTZsqjXPFLXYVaUJT4JVTZd+W/lFJHcL8hB2UOKIJphbgdXXax68LcAJYvJGkaB0z46yicqZVBy8XQhlat6r24Vkgg6ByM8LJRGtb5dVPvi3ld6xooeKJv7w3VquEU3NHxe/ln8a8hOftpPGfu6RckCzWw/dpEZsYcZYdua13U3KFwt+4BpiAmYge/ORvc6HwVBgvVg7D4EK994mZeBQgtT1td8FQbAVnNQcvSMnxb5mFOy/jjHABGgntLgKKdjZDw2fr9WjpYwGnficgOkD0hIBychT/sy4P+0z3mfSPmSEmtOXWFaq75aazpF; 25:m+wBzeVMF9ZthGBJ/Ekp5kTOZeZ37K+FzMldX8SGbxBZ5ZVTVD867PRUHNtl2jOuIEDOZFbW/qtSR96nwVor+oQoEdcyePLxKlkxyukp9Rus0+EPkYxVOR1fsKFFdWyNRgPHmE/Oyfz/pVEpRBU0jK2QKJOM8CMvJzX0q2D7h9hp5JJS9ty7RiQ94QrK4SZzQT2HWFAgmY/4gr+6CFv3oyKhP3wYCX+Bt3V/BnWq+j3o0Urx28bx2RmJp5IUWMUx47Av8KxTArTVZbBUI82lEh//FuxVzKPrf6pOI4HPmVsfprMJmrw2rLyUV5R7/ypn5hudlRQbGAjfkuqq1x9IxTJjcev65vs8l/5bE3Ke29jI/a4nOBjy5ZFkRPbw9mfaCdfcCbVxFiJdRjcM9B6/rf5REd/pv8/REmjx9UU1BtWSSAo+yWFzNCPtzmEjeIZkpmY4W2Q4n84n2Y8nFnK0TQ== X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 31:9nCba0lgUu8w1F2pGDudId8SWcf16pA8qY/qbaBJUJ70+agMtwGJxozJyWpXmPCD8d8HpyYCKoufV/8wAcs3HRt2RVpUdAmtiBppFzTfupW+xrZOMV1VH+rsGgedajCFSqBaqxVt557R52ne4vF5VMCrow5A3xdu+1ISeAZbstdEhBzY2NolIm0KSHKTJ/UZOwGn2jLLnzkG8d4dMaS6X2HDuoosZ6YUbxftW2klVkaGhep6CJYNTdOH9fikB+gioIRNYjuSIlx827S9YOmWHAo41PhuZMHvrScvFL3MwmA= 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)(13023025)(13017025)(5005006)(8121501046)(13015025)(13018025)(13024025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123565025)(20161123559025)(20161123561025)(20161123556025); SRVR:SN1PR0301MB1968; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1968; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 4:FC1zegw2f0TIr4XqKqc9rpCQ250WxzFzilvdmGHjIQGnmFktxkLvCz3alZ6UhrwR36hIaPc6LCTCwMtruYutwa8qZhQlqKSuFdAlUTEMWWkF88oKgQekrsNKh1z/6dkmRp7uAjsDJQ0uIOO0FPIKncds3o/DsFNtI2NB0E2H/M+kwPYFkKprjuGQ0UQO0N+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P5rg?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 6:Et6wQ+PbRlCxrkYjjPC+ydJj8Tm1TC0KT2a5Sizlo1AvZ6/gpk2EkWw8w4OThwnQ3PoeTkSbEk3v5eEOK6rbdUA/ingv6ec0uwduu3haMT1L9i67QP/o73ntgrNfOPZJ38l352veSYe94RrpZUeX1SYa10WCh+e5O4aQhx+2w57jQEY9ntjRYzs/l0FxIcshjG3YyccHzDgAs2hSIdmV8RCcPYcvViEifzwk/mmCMXMQHDEP/WLHX26rY6NHiL86R7qw2XbFvLWfa3UNlJhd+R6DDpqnbLQWre2Fk0fXJJcyhT0JtnSvmiisKI2+fsJm3Qh/1b/M4mlXafd3iV0PA6Qm9cVaLQb8jAJLj/LV0ODRcV1vy+BJ+nsrCLfuQTA2lZ+eay1j7BXu0Ijay7j+UbZj2gj+/5xfD3mVn2tbzlU=; 5:+j86fXFbUmlnArDKhoJvUCwj3IzojGd8FMu1pgdonEl6c78PWcrbtTdNHURx5QGcyrAA93f9N4vfuim55moPR4or9NwQpudR3j34tY07udCU0jHokLCSQsB6EG4OPH0VFqCGLjA9Q9gCPdfjJNfVc6oLD1sAErw5V1ydTmxOXa3XUx8mS8Vnjp9BqQmrl5KT; 24:S3HOZh4fQLblyzjxQDVIDf4WWhgLkCJi/3menvQhg24U2VCW04WzTJjuCVxIgct73E+6trXoKDSpSRrcgUIRA9Yo8minUPNJle+S8KfU2H8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1968; 7:jEMG6rWdPHUHf3FvPqJg7HmUVyS91Ii501FsiFVPPU+MdhrSrvf35+PriX4juLAMygvyuiGm6aYnCfFzFQuKYfHaEqS+v7xtMOFcGlsRzf73OIUvzGYPEAzD7p2XhGDEmasduNo2tCHpiuUO+PsZSN4yXrcuN1lF50yU/rdGhccG7FQFgZJSraN13mJ5LcHCjEnwQ6pFWJGWkSYRVKq7fHpn1UI++wsi9tupUsmN+3OdPDwNkgsolcgNrf/svhC7h+qSFzuqiYDoaFw/84BFkFj+Qa4e5joIsoeWUyXOHhJn7l+70mBxJasVFiUBoyU2MhdgAuWCI6GMgXiHkoT06g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 13:09:31.3670 (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: SN1PR0301MB1968 Subject: [dpdk-dev] [PATCH v9 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: Fri, 17 Mar 2017 13:09:33 -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 c4557d6..70c8701 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