From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0087.outbound.protection.outlook.com [104.47.36.87]) by dpdk.org (Postfix) with ESMTP id 414BBFA53 for ; Fri, 3 Mar 2017 08:14:44 +0100 (CET) Received: from BN3PR03CA0103.namprd03.prod.outlook.com (10.174.66.21) by MWHPR03MB2959.namprd03.prod.outlook.com (10.175.136.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Fri, 3 Mar 2017 07:14:42 +0000 Received: from BN1AFFO11FD031.protection.gbl (2a01:111:f400:7c10::125) by BN3PR03CA0103.outlook.office365.com (2603:10b6:400:4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12 via Frontend Transport; Fri, 3 Mar 2017 07:14:42 +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 BN1AFFO11FD031.mail.protection.outlook.com (10.58.52.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.933.11 via Frontend Transport; Fri, 3 Mar 2017 07:14:41 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v237D50Y005035; Fri, 3 Mar 2017 00:14:39 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 3 Mar 2017 18:16:48 +0530 Message-ID: <1488545223-25739-32-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> References: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131329988821531484; (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)(39410400002)(39860400002)(39850400002)(39400400002)(39450400003)(39840400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(626004)(76176999)(50986999)(8676002)(81166006)(8936002)(5660300001)(36756003)(77096006)(33646002)(305945005)(50466002)(48376002)(189998001)(2351001)(356003)(8656002)(6916009)(2950100002)(50226002)(110136004)(38730400002)(2906002)(106466001)(85426001)(104016004)(54906002)(47776003)(105606002)(4326008)(53936002)(5003940100001)(92566002)(86362001)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2959; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD031; 1:3htcDYD3kOD57cG6CLHe9zzgJBsiLENzZGk/YmDThGMfn1yqW67oGUpnmJa9hiGdoKvlib4jUTFJ+kZpl4Mogt4pyjgMf+2Fn+5Lo2CRbIcihxdlwJvDBq513H5QBrXdIqkKdo5QAXgr3GFibVmN3IX4ydX7JUOzyDK8X02GHqgKtgX4SmEhbYo8DoTiwjpa1tWzFmgW2Ilr0ItPd0/+ET/HqKXTX3gPqtQux2OKdGoRgebhX6i4aGw8nS9A/3eEF3rXFpwtz4La3AjLUFlHt2wk8zzmg2P2O5nSqLlXHFUgvx1BLJGT0yPlOOoQ2gwnFoWUS/wLYVqf449aruB0WW2KX/JvP7feHvFwq2m49MtUeeygvXmXisrr293IXrDnHpazsLIWxWsBLun8674w4ZFVZ/uIWxjv58uBzavEKIW/yE+25iDsRqbo16qZhZGvxFVT6AcQBGATPZVfX6fQco1CFg9y/OXdGDFReORQM0zyMF7GiyOBaOmo0gwMWJEZbFdqBkUn8fHueKV+x6m8wpdGims2Z3PvrOCMGt4SQVebk2XGL1QmwqZa9jWCqeilLH91c2+penxIDsJZtwmGlviEm1IHuIkJ8bj+S847sVjQai3ksx2KfSnlBsugQC0ww/3fvecKN0gcVCfTTNO30w== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4f391ae7-d9bc-434e-3b5c-08d46204f687 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2959; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2959; 3:y7VK34zgGaSmC/h6BhnvlUQ3jCY7L3kDMxxPAjGPXG9ZMQG/MUoDar8tLYOppNbdxmxHt3l8wkLSh0s+AhwCQLvAHLGuYqJuZyJMbPeSCVwt9B4LEGsGEArztdmT5wNhKZwde/k8cO02LrEhj0I2YvRA3st/qaK3ukrCgraCnrrgxdm80/VHL8BIhxBjHuQk+BnbFmeElxhtCmQG0clX7yBiJS/bVr853RscV/FLbgKham5pVAUN9haddF7rvT2IKNcFZM1qDOF990I6ikWL6G1E/3xMzs8QirL54telVDhuQLCoe8upOpIv8L1R4bsYCwUI3Ya9SMQpvWUkMX0EaPT5t5ruMRIQDfSiqn9j8SjNlPVu0EQ3/Db74bqY2vdk; 25:opY9OQKtvBUIvUB5t576ftWBNuWIBvxII3/TVWayuAi87xE18ai6CC5AL8gbpvHwLqMZB22i40388JG+jmhgKTV6TlqL7SPmS4lam1u6nl8kW3OcGdabKdwuG3vKmfD91k1lx2tfco4soZu2XWAyUzWePgp9I4zRkdYuMFowMe174pWyRXTGUcmo24UuJ6Q1DB8I9eDOBChlhaz7fCtkDC0jAVmS/Ew637uILebbqBX3D6OZolZTKCtmZwY/xluqPbZF90Xtnc5VGw+WXyJj7iEslBMOLYLBr4A4y1XIqpr30enaGO54UhN1g1DwIJ72Rb8RmYbCnU6qoW4Enx/Ngt26A3m5K90iYyB/t11T4lmchNtfh0cEnQeSFanYkrb7Yvw8fEBBfl4jlMleHfRG8RX+6wkvcaeV6Aa4KPl/GxL8KIcsdR6Xfi7wCo/qJ2qBdNcurViV4Zqhsscxbj5G+A== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2959; 31:r+sIioLDLPh1FSrGsL3byf7G+qnXM76CdgR6favCjX7wzKj9CsG2U7qDSH7M3nAVcuGktClJbYpVCUjf0JWoclExd2IzL1pJ7z/MTw+BdHAWZMOgK76wHREfOJ40dSfFcjJ+OKreUe1S5URf3d39rwulMfEaTwwZpv7yZu2iqXTmlYjwI/36a5iU3btGNG/H2C/dZZkgIYLivpf3JhIwNeIpUm+ySvl0z859nB2sr5pE9reLPWGNZ2zPCH7miE/Y0kemIG2DForB6mBZFJ7lLA== 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)(13024025)(13018025)(13017025)(13015025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123556025)(20161123559025)(20161123563025); SRVR:MWHPR03MB2959; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2959; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2959; 4:IIvy4v/SBxf60iBBvDRDOEXn5QLBiF100P6fYxqvBULspfWn/RSP+HBGn4q7NK6RO+OVQWEA0mnvtOs6qqQD7ITbJLXOLghLuKUX7csfRmcCzFCZKOjziElpiB4i+PtybNnartS8+Uwu9vqvzOHC/mt1hFLqYtpi4o2wuxDueZcqm5aYkwJMWLuij7WWOb2vm/n3P+nUfRjRy2gv8DfWVLJFls/zP0NAXlnVEPrjOTE4V5f/d8f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D8WRose5qE3qUzGUOVfXuc2juA3?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2959; 6:0PULLlPd+V9XdKzEzN+b62M2sP1lZdwxAa1Hx+Uqw3KOawj73cFP/vYXQVnWPRvBQhY4aEgOHR0YeWc7Iev/nvq0SagqpW2wWPaTd0eWUXt4tRKfYwr8Dv2nYRDigl9GhZVESZpY+/bZIvyyY8duiSWci7RD6WuXjrAWeOgB6/F96U5oYkz//KWnkfH/U1AoAenZnaDSXa0ISmbWCjEx/4WQCLxVdhCvKThtrkN6/s1iE9nsljyAR71WJog7YF+0Ay3nFi2rww0+KZBiqnWIevVH3KahM27sZABlyKw8d1eOBAKh1wk4lRuPQSZsNhHcp09TAxFX1ESyKuiJvzFV6o0Zy1VEKKQd2HiiJz8Y+q17nRsIzFmmst+ZUudKYm1DJl8r6WMbV63rfOlUsspmqWlZmJzkiDIMl1Xxp9vticE=; 5:u2uSuRw/Js8gTw92Emnv3c8pQyJGuU54w0Eb8BIywvxgMfWTHTGHOWchuO7iNeGzr/6/gLxrHmJsNM0uwZL3SoyuhcR6Mq6Ewi8jkJGHKcbR84yJVC7bN32Pt6yA+yLhsISZKInXdYOqIKQLGvb98p8MSMQS/C53lqDKJVfuKIusaObuuqan3kMBCuqnvdPi; 24:BhETUAkg8EpFGmPvtib5oaj35nyEgWBX8wQF+BJau3lgmv7uDVW1YCAREk7gY5kUpWjhAcFr1R+OU+fU9JNnoYG9RuqdnFnbC4JM2XG6weM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2959; 7:UhCaHQKhvKk1/2LCilUp7gzsfRrUWDjO/NBQ7Nnhw+ns9j6pmGy5S4SlVUUwE6xgRQnhROMj5TovPu4gmg3WGAZpRoJMHgbHG+yBHNCqrdlssuVj2fzD/YVl64DCk2DL9Rl5rtlXrNQu4YkrbV+uAcN2K0bmzOap6/JyHfizAomcOEE1TreiuiXqrudKxdMagc6I7Bov2KHEbgqUPUeEcYXfBFaqiZXASSNIM3xYc5C+O+Z1weVTL60OANy58O7HSBUc2k+ipvdWQOF8xFb6OudV7izoheRKwGskBB9fWTbt/XeKF6BHAT3oCDK8I+2BQUCvwPYYzZEvVR8M4zAREg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 07:14:41.9659 (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: MWHPR03MB2959 Subject: [dpdk-dev] [PATCHv8 31/46] 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, 03 Mar 2017 07:14:45 -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