From 78c7149eb087fb93893960916ca3a3a09990f23c Mon Sep 17 00:00:00 2001 From: Helin Zhang Date: Thu, 5 Jun 2014 13:08:51 +0800 Subject: [PATCH] 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 --- lib/librte_ether/rte_ethdev.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 2.20.1