From: Helin Zhang Date: Thu, 5 Jun 2014 05:08:51 +0000 (+0800) Subject: ethdev: allow maximum packet length to less than 1518 X-Git-Tag: spdx-start~10678 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=78c7149eb087fb93893960916ca3a3a09990f23c;p=dpdk.git ethdev: allow maximum packet length to less than 1518 In ethdev, it ignores setting maximum packet length to less than 1518. The changes is to remove this limitation and let less than 1518 can be set for 'maximum packet length'. Signed-off-by: Helin Zhang Signed-off-by: Jing Chen Acked-by: Cunming Liang Acked-by: Jijiang Liu Acked-by: Jingjing Wu Acked-by: Heqing Zhu Tested-by: Waterman Cao --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 42333ee3ff..3d5d64c269 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -661,9 +661,13 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, (unsigned)ETHER_MIN_LEN); return (-EINVAL); } - } else - /* Use default value */ - dev->data->dev_conf.rxmode.max_rx_pkt_len = ETHER_MAX_LEN; + } else { + if (dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN || + dev_conf->rxmode.max_rx_pkt_len > ETHER_MAX_LEN) + /* Use default value */ + dev->data->dev_conf.rxmode.max_rx_pkt_len = + ETHER_MAX_LEN; + } /* multipe queue mode checking */ diag = rte_eth_dev_check_mq_mode(port_id, nb_rx_q, nb_tx_q, dev_conf);