From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0083.outbound.protection.outlook.com [104.47.33.83]) by dpdk.org (Postfix) with ESMTP id F0415F92F for ; Tue, 17 Jan 2017 14:20:33 +0100 (CET) Received: from BN6PR03CA0030.namprd03.prod.outlook.com (10.175.124.16) by DM5PR03MB2476.namprd03.prod.outlook.com (10.168.233.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 13:20:32 +0000 Received: from BN1AFFO11FD020.protection.gbl (2a01:111:f400:7c10::107) by BN6PR03CA0030.outlook.office365.com (2603:10b6:404:10c::16) 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; Tue, 17 Jan 2017 13:20:32 +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 BN1AFFO11FD020.mail.protection.outlook.com (10.58.52.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Tue, 17 Jan 2017 13:20:32 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0HDJ8mV021741; Tue, 17 Jan 2017 06:20:29 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Wed, 18 Jan 2017 00:22:45 +0530 Message-ID: <1484679174-4174-25-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> References: <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131291328321901537; (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)(39450400003)(39840400002)(39380400002)(39860400002)(39400400002)(39410400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(86362001)(81166006)(8676002)(48376002)(81156014)(97736004)(50466002)(33646002)(105606002)(38730400001)(36756003)(54906002)(2906002)(356003)(8656002)(305945005)(77096006)(92566002)(4326007)(6666003)(47776003)(2351001)(5660300001)(106466001)(85426001)(2950100002)(5003940100001)(50986999)(68736007)(189998001)(110136003)(104016004)(8936002)(76176999)(30001)(626004)(6916009)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2476; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD020; 1:2PN8sJ8qJEEUv+mImTThGkqz1O2m3r4QO7QcAmTp85HOJWLvpWYlMulymgQ0HSQnAFWizeIBEhLBCnOECXwMPZir3QMTNo/SF+XPSM+4qyjePrx0QSbVTaxMAGaRCwdEAUUXki7JgspNmTbLrOciUu54ymZMFdv7jGtduua3VaUxv5IvK8FjgzuKu7+WnmtekDIdeQUD6SjDHEg9TQxvv1b6KptpuGBdxtX9wCneCUFm1KNCLKcmHFVDiRuN7OD8anhhH+R8fGIwF7DhHZFz/DWTn6XkFSLxRiaLJrQpga8nbF+7HRaf9DlEuIbsk0MzUrYloVsDIcX1831oYRfNTcEIIEq0a4LR4kp5ZuMIxXDdE2kIbjXl+u8n8O+/5bBIXeBHNCuFT+nya63aUPNaykTOa3+gH3ZvEWSkESFoL4eUqEh7Pp9Oj3RQjpqcFGYFbvoiPSUi8hckba3orbJNVyHIRBTpymoIwzmbGQoaLyw79mwnQeOBMBnCC2t7A2FaZB7NGfzELcXGShN8Xtzv7d0TsQh7hX35Py+csbDnszpBgSzYSRX84LHHPbKIEmlYKAdFtycDZIZH1n2uksReRQNnAvue9PGweBD8Hb20udMejEtAx5EnEEbh/qcMTwGTD8ZupsYSBTgk4NUcj1XcKr6TFB2xeLM1sWPpVlHlMEHtx7jvusdXYF6KSqM1+ns2fjsQGXU7ODK06sIXq4IjxCWnSpDQlKHty8yazqU+2f1H2XjImefYJB4+HMC9NPPg MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4eb5e3b3-f18e-4186-53e1-08d43edb9d2e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2476; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 3:J5QYr+nqnA5VjoNPdPTFd9qBbPA45VUi94BzXh+OrB2PwxRA+Ofmo1Ak3UeFqycoinxCQ3qLPyNNGOKLFaLZFH5JDua3V3MipfEJo/8jPMjU3MjKjZ4lp4ipVqQXEcZowRxSEhdqMbJQK7MFIep48qm1WC28i6HfOD2epGy7WvJVCWAbUTLoZypJclxt0/ySKt6ouyFeBYbxUoueTt2H0hRfEiNxe/CD3AHfVjCQG4AvLebO9KJuwnnmo4OmBXHehX+glUh9uL1DVUjX3GtG+tm3EZBaLlsLK+2bEzN/GmIZL5kHgZOQgJ0YB/uM23a/7z5DT9WIwdNRUBXuFQAWw4E+N26KUF40mo7w3wGnlo7gPKyEUahzcpo1EPfY9gSe X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 25:ouUPWxAnWcpHPCjGXdmqAaZm2VZNEQ4W5lhsGIudHW9GEiBQiXYpRV0d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antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(8121501046)(5005006)(13023025)(13017025)(13015025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123559025)(20161123561025); SRVR:DM5PR03MB2476; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2476; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 4:caPKuJcqtqeLhkWCLgrXAsbg7XrNym5D4QpCrWsZZr19MX47XamAbx6lMfCGgSbIuVas8l5dzeVcHSD4peyokAIEDWnYC4ujoK8Ih6E0055Sif8qk7Mxso6SbNpfY6qv0m3gic//ma38KaCh/VH7ZMC3GO+3q0wt8PHMxJ9s44Je3peduy91+eM3N61Kylt41rkKRc+POs4xxwfSlQ2Qpf59uy2OmJVOzvzF877optvR6cbOknqDMLBlZAXSlbHfbQzRjCQhDhF6ezB6bj6GUjGqpy2PMaZkFlO3XSEgL2+uhiWjHELFo9UrWoPRvI9csG2AX+OhriY7UFVW7aqsQ1f4d4zNxejEPzE32wDmf2PbKNF3K8R2HQMmpz/aVvUIWDv05tk6tgVvd2+P9+IfKyBoYQ7EbvnENWNKDIFXb2s5/mD0L7QItVkuL/AA0fWwn00lZ2tPW/GTrJ39UOWN0mEjC7TTMFLynAHceEdWjfMsjquXUY4aytR3FqkM+951kT7MdEF/p0/PkQk9YZhoViLzCf4M6pe6GGCfpaU5OOw0OB4pe8/aOSRa2lBHs7IVDAj1t+E5VUa3sUf0czby0EELa/S/Ltg17DQMxzsE/8s+L62J7ZUpuey5xcueY+aF9syKDXPNHQcHGDQjnP1jXUFFPB1pX/nggzaJLgLDwaSKhw2uKTi+uaey70PqXQLUszeC6TtgPQf5QXH1i9KSPwMx3ONEgwd7ahZUBXzvV2kvHccU8mu4LLg7LYtOmpqEEUmatk5Ve1WYoCm12DCIJw== X-Forefront-PRVS: 01901B3451 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2476; 23:Dv8nKibOho4Xl0T0bZD4HoKAkEeW5jAYRyIu8GJ8Y?= =?us-ascii?Q?a3lnJvEY1qvtILPZa3BoCMewfeI28ocWCt7/lDlZiYEU47mEoBGhPpNN7xgq?= =?us-ascii?Q?oxui/ozcFBwe8/10IdKW7FzTyjJ/ZSqbXM4bdUyVJpbsp3/OPUNWMs/SRAbQ?= =?us-ascii?Q?HA6PGhzqjPjbXRS041jGHfrWdBuJMm4dmc5jvbxul/8UAG7BtMMzuIerB6rR?= =?us-ascii?Q?8q2lm9Z2uiSjqE0HDbtQp2Xkkxsc83bYjSaoM3AF+hz/HaKdZT2Gdap6ZUg6?= =?us-ascii?Q?+S30VGPkyBdlJO64pgQhS7uZrvhofBVX35TZRW8jhEyVbXdyB5x3Y3csUfI+?= =?us-ascii?Q?CtrzoBDSkWX6dADuZlncTODAiofhSayt7nj9w9oVriIQLfgHad9OJ69UfAYB?= =?us-ascii?Q?NudNLhmJFzrbPAhBe3WB5o5n3u4YxveLj53zljjyyXbGlnXlAYOHYcMPsAtK?= =?us-ascii?Q?NZsWJUi6/xTmMfknZMYz7v67q9d7lbZCfIPx2yptTy9um9EwsZWphOwLBsou?= =?us-ascii?Q?BLeAJQyjiZlTw+6H3BywPa77cLsuy8aoYQf4KdJkpo9uElS2gPwh4zS+xjjI?= =?us-ascii?Q?uCNU1Wf8q8EsivamLsD1ACdL1wURGGugr/dWZk05YKqYENXyAZLtaez2UWtX?= =?us-ascii?Q?chwAzFKeghuZKF/PhFAfRy1L71mHbeZ7H21GtF6wEZ8wSaCP0Xpzs+svMSQQ?= =?us-ascii?Q?q5rrwxHxiNFKD5hp5wliB5SmAWXQoI8pEn2/5FfClxa+01BGW3yfuUZyY7iS?= =?us-ascii?Q?mjjjGEAjzZSkrArkAaOal7GogRJK10/s0AGq9fZSCT7B4VvKJ4PgtVH6j+7e?= =?us-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zwsIQ+sF6gPK; 5:JrVCmJk7y9FDmfNP9fJVQM3ssPwYgYV7fv1WK4HhZv1+IeG5YzX/+IX0YYGfVHtNs5l8+ureSGShIrqo6GygxJ1IoAvrpdVxD7F8V9TcDoL8dBbZSci60z3vncML90/40BJWWOUk5uTomMcdZcSmznGEAU1mky3kHZc8H+kIhUMQkf31ivELFOyjtJDYEdNG; 24:xGvFrsw+9wpesT/sfVTwWsXtkmCB1yXxVg5ElNsZEzWdYYjZR5ITd00PzhPWLCg/zd0suf723lyIuKjQOMfOi8huO7ajGRGvg8E6xdc7pmw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2476; 7:BjcyIdIhkeDmqq9WnerPV4+vM2Ou+Q7TD9qcf2rGBBYyT0u6M2Uk6fOZWzW9kyGtdKDkPDDkPmoTDz5lXSp6t9ztB1UBdQJVIm431NunZfHlhBNLUB9lmGVjd2GpTQkUOep0rvCDYpuH7SAjkRtOHY8Ur54oslN3Bfxs9SDRLxViDaWYlAx92TDUn9YzxAo02ZeOVNMTU7T2c8BqENNU6FONO5NiOQmKMQiasSTYlsivMzO8Cko0ZspgAAhLOIwZ8tyLBxewV7U7NQLyHH643phIdZbY19bCH1DX2QCeebTIlWAoMeqw54CSj14Rw+HzCdIXgQwqPIxOlBEqXU/CsUmGn0z6vEklhfTfhYtFFwKkc98O2vlKkUekMbKjUyz/jrOi1NsSWhzio6ZHcZGzZnTSQjqAVxum5iyEYY61TSFPr28rnFwamQZJ8m/XSZMeNSm7eDleB/WNM+L4RaNYiA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 13:20:32.0029 (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: DM5PR03MB2476 Subject: [dpdk-dev] [PATCHv4 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: Tue, 17 Jan 2017 13:20: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 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