From: Hemant Agrawal Date: Fri, 26 May 2017 06:51:22 +0000 (+0530) Subject: net/dpaa2: configure jumbo frames X-Git-Tag: spdx-start~3124 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e16408499412e67a6afab8eca3d7496b770ac0e9;p=dpdk.git net/dpaa2: configure jumbo frames Signed-off-by: Hemant Agrawal --- diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 720c35b6f8..48422f01ca 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -6,6 +6,7 @@ [Features] Link status = Y Queue start/stop = Y +Jumbo frame = Y MTU update = Y Promiscuous mode = Y Allmulticast mode = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index edff04ac3d..efd6064b2c 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -57,6 +57,7 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd; static int dpaa2_dev_uninit(struct rte_eth_dev *eth_dev); static int dpaa2_dev_set_link_up(struct rte_eth_dev *dev); static int dpaa2_dev_set_link_down(struct rte_eth_dev *dev); +static int dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); /** * Atomically reads the link status information from global @@ -278,6 +279,20 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + if (eth_conf->rxmode.jumbo_frame == 1) { + if (eth_conf->rxmode.max_rx_pkt_len <= DPAA2_MAX_RX_PKT_LEN) { + ret = dpaa2_dev_mtu_set(dev, + eth_conf->rxmode.max_rx_pkt_len); + if (ret) { + PMD_INIT_LOG(ERR, + "unable to set mtu. check config\n"); + return ret; + } + } else { + return -1; + } + } + /* Check for correct configuration */ if (eth_conf->rxmode.mq_mode != ETH_MQ_RX_RSS && data->nb_rx_queues > 1) { @@ -778,6 +793,11 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) if ((mtu < ETHER_MIN_MTU) || (frame_size > DPAA2_MAX_RX_PKT_LEN)) return -EINVAL; + if (frame_size > ETHER_MAX_LEN) + dev->data->dev_conf.rxmode.jumbo_frame = 1; + else + dev->data->dev_conf.rxmode.jumbo_frame = 0; + /* Set the Max Rx frame length as 'mtu' + * Maximum Ethernet header length */