From: Shreyansh Jain Date: Thu, 28 Sep 2017 12:29:45 +0000 (+0530) Subject: net/dpaa: support MTU update X-Git-Tag: spdx-start~1824 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0cbec02719ae348bb71e459fb005bef51d985a15;p=dpdk.git net/dpaa: support MTU update Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index 9e8befc450..59ef23dc06 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 4996daa93d..4e07661f00 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -75,6 +75,26 @@ /* Keep track of whether QMAN and BMAN have been globally initialized */ 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; + + 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) { @@ -197,6 +217,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 */