From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0081.outbound.protection.outlook.com [104.47.34.81]) by dpdk.org (Postfix) with ESMTP id 0812BD08E for ; Sun, 9 Apr 2017 10:09:56 +0200 (CEST) Received: from BN6PR03CA0036.namprd03.prod.outlook.com (10.175.124.22) by BN1PR03MB284.namprd03.prod.outlook.com (10.255.200.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Sun, 9 Apr 2017 08:09:54 +0000 Received: from BN1BFFO11FD038.protection.gbl (2a01:111:f400:7c10::1:167) by BN6PR03CA0036.outlook.office365.com (2603:10b6:404:10c::22) 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; Sun, 9 Apr 2017 08:09:54 +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 BN1BFFO11FD038.mail.protection.outlook.com (10.58.144.101) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Sun, 9 Apr 2017 08:09:53 +0000 Received: from DTS-02.ap.freescale.net (DTS-02.ap.freescale.net [10.232.132.223]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v3989Aop015502; Sun, 9 Apr 2017 01:09:50 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Sun, 9 Apr 2017 13:41:13 +0530 Message-ID: <1491725483-6619-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> References: <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131361989943465796; (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)(39840400002)(39860400002)(39850400002)(39410400002)(39380400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(5660300001)(33646002)(356003)(2906002)(36756003)(8936002)(50226002)(8676002)(110136004)(105606002)(106466001)(85426001)(38730400002)(104016004)(189998001)(2351001)(81166006)(77096006)(4326008)(6916009)(2950100002)(6666003)(47776003)(575784001)(54906002)(53936002)(86362001)(305945005)(5003940100001)(50466002)(48376002)(8656002)(76176999)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB284; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD038; 1:qrI1EAw1K8iwksgsYN8AatyswlqTKIo2wU0bU4Crd/5pgkneUMwqz403UFcJdviWaOoWloK4GYTTNYxOsj1eCFKsX0qlp8CAckIlFfJ1PLKxYtdOM7vBrDRyNtdYyaDPRGvd8cEPeeQdVSSPWLcIeNpNUu+ldHCDK62FCCl3n5V48E/Iynoy9SNxO1NwZ4VOQLSjtCSWrJVWTw8RDHmtOi27Qr7T+ZmFMdyuccqOB7uA3l0IkkEIkKtLQEZO8BLnlfcBdNIL6SDofCr4WFZL9U2G3jRknZqUjzqQIdOPSHMlnTIIUPWS4lPi9SSWvTd615hu777qAohChGAs2uQAef8tNOoqZqPcpIgJyMDupme7OscHoeDC90SV07oBk30aUMKNKvZJbwAqG61CDmWqslZj81Sg1lHaizOtg57T55k9dht2sEOSWnQhwo6DMW3fTel9OCmWtQZ09igZpT6jzqyP2lqz3FEFHQVPFco5wO8E3RLql3suYjV2jonVvUg25fR2KjQmTI74jsGlH6tnuz+hhchKByoYhg/xhOmLcjt11kWxnXHf2D90eD/ni8idfSGhPf0WtiBn1RtI2NYfPApsfShLO/LmJFn18njqWIlGNdQ//+K7OaW6T1o3Hc79gG9z/EfIjGwADJiGogdXrHsI87qR/N0Y4KjeZxXIUcU= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: b1b3fcce-53a2-4ff7-c970-08d47f1fcdf0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN1PR03MB284; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB284; 3:jcsAQLubpbq3ihzSV/eH0ISEOUAqKcqnbch1F6cUeN1cpzyVl5yt3pes8i6SC5V0fwtjVqXM3Xh900r+qb7C2+mBS24o9mqCsN2gbZDezZcVUbW15DsijvImU1dMrSAOAapDeJHW/h9JHEkBzy+uMNqxM8GUWDLPk7bhwd/Jk53wsOGM1J/5kP6xv9JY6tcI6koB2TDu1PuNJ9i4NcOr4+iIyWEJMJr4pw59KQ+WpF/SiWk2kUKTagFZ0tLM2L6k5Lbi/LZgIzDUhDF9AyUi1PmcfL1FBKC4+aovmBJXzrxsHCHeLlGU3HJr6tzVhyao3Zfhk4mtnYC+NzNg3qv+bxTxwUeumweG02SrlXzv+u7ueHm/BvJuGXaY4sKheZ/iiXGOLIIT+WdpGzgkOJbBBbenMLZRe0stEUH5I9uM9v7ALz2X/tMoPczVtHXCSZlo; 25:dFCy2JFRVmGYI/rc2+3J5UGcQn/qxK0ak7qQ8m7V3J50BrSHpmXk/ByaDjUZIOAkNROF6yk+NMkgbNmPsqA2NR4xWwzIxiRM6/XApt4/N3EzlMnJgjK5PL0i2h8KcZol5kQBAOUVRV+l6cL4yC13CiUjiqxjTyFHzU8xLyIAJrzpm7uDMvLSZfNHZU64G5y2KgvLvi80Cd6YQksymYuw+yYrvo30/IGkVEpfhMaUImLF/JVCOHwHfjky/9+9e/KLkLfrooHJ74SZMWhEdLyefX7mH6dzVxyO3N2F3btwCVHPZ5oSP83JomkzgFsPDzS/xesjTDzvLE+UWB4h4F9KKOosHlvxlvvAMXQVKV1//31yBtqbHsn6oITItT7GhhhjKCV9K6YV5s4ui/OGr3NRKeiPCcW3U4aGrz0BdqDDpOZkLq9tx6E2TloZRUfD249oCQmd9LRJsBOlb5gzSZLg+g== X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB284; 31:oQ2Kpky4d0gJ6QzWT8YSFx2cYbRVCKeulHsbM9FVRUp6+DzgE22ghR9aanfzm6hSN01b38jHLN9It2LpJ4jRUqrifLWXbgMd8/mCwcaKTZ2E3l/tlbncMqlcxv+FANfm0TWqutUrt6TDq/UKsZOEMy27hK7vq6evEXq1hwWPpaQmacYCZ/u+KcPQkau8/pOAlc1sCSjWOwDD204fOgMG/PT6WGO51YdmrQvmuzCpo5xSKb2Pe1RsL2elcZlQXlxYRyHNifp/mItNAFZeYJwPJQ== 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)(13015025)(13017025)(13018025)(13024025)(13023025)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259075)(20161123561025)(20161123565025)(20161123556025)(20161123563025); SRVR:BN1PR03MB284; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB284; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB284; 4:aQa/pS0x3C5xPFPBhESEF2OTJFLyGQefLJuagJVqtNWbB1W/uRA4T8+gKfiC1Sa6eoiTPLzo2aaY2G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V2i4cmCoqspAbFf1CMcYdvWVYK6VL+dmdilQdK0uE3t40= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB284; 7:RN0qurt+rwkq3fFQpNGyBLxPrOm5He4NFwYVsXErw0qrcHuoxOtRMtlYElFont4Edett64o3XTWd2C7RzJP080+BLl+VHZAHpDtlBcUICUVIYt0mLw2c3Oc+8i9OVhMpTyC9mFIouZtFLIGQmiOzKPhAEkL8hlYdLPwtv9TZhTtaNtefuiyDIuTUoP/HzgofH44xuMoHhpumrFEuZHs6asbvkRBAtXZv8C1DJ08EJSH+PYdrAJbCk/UOU0AhEsfPUcX6rHFIdX4+xxUgQapjwE3XWaiK0OGWwSOs659o/l+GBk45UethhSeU68Mr6vtEUxWb0y6WZIFbqikIh/h/kg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2017 08:09:53.7693 (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: BN1PR03MB284 Subject: [dpdk-dev] [PATCH v11 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: Sun, 09 Apr 2017 08:09:57 -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 fc46c0b..d1c1d26 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -476,6 +476,39 @@ dpaa2_dev_promiscuous_disable( 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 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .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, -- 2.1.4