From bf7567fd2a5b0b28ab724046143c24561d38d015 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 3 Jul 2017 15:11:03 +0100 Subject: New upstream version 17.05.1 Change-Id: I8a23679edd6c9c593ceebecf7d2bf1b489e14ccb Signed-off-by: Luca Boccassi --- drivers/net/liquidio/lio_ethdev.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'drivers/net/liquidio') diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 436d25b0..c7f1fb64 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "lio_logs.h" #include "lio_23xx_vf.h" @@ -1348,7 +1349,8 @@ lio_sync_link_state_check(void *eth_dev) static int lio_dev_start(struct rte_eth_dev *eth_dev) { - uint16_t mtu = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len; + uint16_t mtu; + uint32_t frame_len = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len; struct lio_device *lio_dev = LIO_DEV(eth_dev); uint16_t timeout = LIO_MAX_CMD_TIMEOUT; int ret = 0; @@ -1386,12 +1388,29 @@ lio_dev_start(struct rte_eth_dev *eth_dev) goto dev_mtu_check_error; } + if (eth_dev->data->dev_conf.rxmode.jumbo_frame == 1) { + if (frame_len <= ETHER_MAX_LEN || + frame_len > LIO_MAX_RX_PKTLEN) { + lio_dev_err(lio_dev, "max packet length should be >= %d and < %d when jumbo frame is enabled\n", + ETHER_MAX_LEN, LIO_MAX_RX_PKTLEN); + ret = -EINVAL; + goto dev_mtu_check_error; + } + mtu = (uint16_t)(frame_len - ETHER_HDR_LEN - ETHER_CRC_LEN); + } else { + /* default MTU */ + mtu = ETHER_MTU; + eth_dev->data->dev_conf.rxmode.max_rx_pkt_len = ETHER_MAX_LEN; + } + if (lio_dev->linfo.link.s.mtu != mtu) { ret = lio_dev_validate_vf_mtu(eth_dev, mtu); if (ret) goto dev_mtu_check_error; } + eth_dev->data->mtu = mtu; + return 0; dev_mtu_check_error: @@ -2055,4 +2074,4 @@ static struct rte_pci_driver rte_liovf_pmd = { RTE_PMD_REGISTER_PCI(net_liovf, rte_liovf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_liovf, pci_id_liovf_map); -RTE_PMD_REGISTER_KMOD_DEP(net_liovf, "* igb_uio | vfio"); +RTE_PMD_REGISTER_KMOD_DEP(net_liovf, "* igb_uio | vfio-pci"); -- cgit 1.2.3-korg