net/ixgbe: add VLAN info in queue info msg to VF
[dpdk.git] / drivers / net / liquidio / lio_ethdev.c
index 94caa90..5f3c05e 100644 (file)
@@ -36,6 +36,7 @@
 #include <rte_cycles.h>
 #include <rte_malloc.h>
 #include <rte_alarm.h>
+#include <rte_ether.h>
 
 #include "lio_logs.h"
 #include "lio_23xx_vf.h"
@@ -1367,7 +1368,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;
@@ -1405,12 +1407,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:
@@ -1540,9 +1559,6 @@ lio_dev_close(struct rte_eth_dev *eth_dev)
                rte_write32(pkt_count, droq->pkts_sent_reg);
        }
 
-       /* Do FLR for the VF */
-       cn23xx_vf_ask_pf_to_do_flr(lio_dev);
-
        /* lio_free_mbox */
        lio_dev->fn_list.free_mbox(lio_dev);
 
@@ -1910,11 +1926,6 @@ lio_first_time_init(struct lio_device *lio_dev,
        if (cn23xx_pfvf_handshake(lio_dev))
                goto error;
 
-       /* Initial reset */
-       cn23xx_vf_ask_pf_to_do_flr(lio_dev);
-       /* Wait for FLR for 100ms per SRIOV specification */
-       rte_delay_ms(100);
-
        if (cn23xx_vf_set_io_queues_off(lio_dev)) {
                lio_dev_err(lio_dev, "Setting io queues off failed\n");
                goto error;