From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: [PATCH v2 26/40] net/dpaa: add support for MTU update Date: Tue, 4 Jul 2017 20:14:17 +0530 Message-ID: <1499179471-19145-27-git-send-email-shreyansh.jain@nxp.com> References: <1497591668-3320-1-git-send-email-shreyansh.jain@nxp.com> <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , To: Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0084.outbound.protection.outlook.com [104.47.41.84]) by dpdk.org (Postfix) with ESMTP id 0CAF47D9F for ; Tue, 4 Jul 2017 16:36:23 +0200 (CEST) In-Reply-To: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index 9e8befc..59ef23d 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -4,5 +4,6 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +MTU update = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 372a4b9..4f39c4c 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -76,6 +76,26 @@ static int is_global_init; static int +dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + + PMD_INIT_FUNC_TRACE(); + + if (mtu < ETHER_MIN_MTU) + return -EINVAL; + if (mtu > ETHER_MAX_LEN) + return -1; + else + dev->data->dev_conf.rxmode.jumbo_frame = 0; + dev->data->dev_conf.rxmode.max_rx_pkt_len = mtu; + + fman_if_set_maxfrm(dpaa_intf->fif, mtu); + + return 0; +} + +static int dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { PMD_INIT_FUNC_TRACE(); @@ -198,6 +218,7 @@ static struct eth_dev_ops dpaa_devops = { .tx_queue_setup = dpaa_eth_tx_queue_setup, .rx_queue_release = dpaa_eth_rx_queue_release, .tx_queue_release = dpaa_eth_tx_queue_release, + .mtu_set = dpaa_mtu_set, }; /* Initialise an Rx FQ */ -- 2.7.4