ethdev: move jumbo frame offload check to library
[dpdk.git] / drivers / net / txgbe / txgbe_ethdev.c
index 9949d4e..cc1d4a6 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2015-2020
+ * Copyright(c) 2015-2020 Beijing WangXun Technology Co., Ltd.
+ * Copyright(c) 2010-2017 Intel Corporation
  */
 
 #include <stdio.h>
@@ -16,6 +17,7 @@
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_alarm.h>
+#include <rte_kvargs.h>
 
 #include "txgbe_logs.h"
 #include "base/txgbe.h"
@@ -105,8 +107,10 @@ static void txgbe_vlan_hw_strip_disable(struct rte_eth_dev *dev,
 static void txgbe_dev_link_status_print(struct rte_eth_dev *dev);
 static int txgbe_dev_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on);
 static int txgbe_dev_macsec_interrupt_setup(struct rte_eth_dev *dev);
+static int txgbe_dev_misc_interrupt_setup(struct rte_eth_dev *dev);
 static int txgbe_dev_rxq_interrupt_setup(struct rte_eth_dev *dev);
-static int txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev);
+static int txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
+                                     struct rte_intr_handle *handle);
 static int txgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                                      struct rte_intr_handle *handle);
 static void txgbe_dev_interrupt_handler(void *param);
@@ -138,8 +142,8 @@ static void txgbe_l2_tunnel_conf(struct rte_eth_dev *dev);
  * The set of PCI devices this driver supports
  */
 static const struct rte_pci_id pci_id_txgbe_map[] = {
-       { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_RAPTOR_SFP) },
-       { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_WX1820_SFP) },
+       { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_SP1000) },
+       { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_WX1820) },
        { .vendor_id = 0, /* sentinel */ },
 };
 
@@ -469,6 +473,71 @@ txgbe_swfw_lock_reset(struct txgbe_hw *hw)
        hw->mac.release_swfw_sync(hw, mask);
 }
 
+static int
+txgbe_handle_devarg(__rte_unused const char *key, const char *value,
+                 void *extra_args)
+{
+       uint16_t *n = extra_args;
+
+       if (value == NULL || extra_args == NULL)
+               return -EINVAL;
+
+       *n = (uint16_t)strtoul(value, NULL, 10);
+       if (*n == USHRT_MAX && errno == ERANGE)
+               return -1;
+
+       return 0;
+}
+
+static void
+txgbe_parse_devargs(struct txgbe_hw *hw, struct rte_devargs *devargs)
+{
+       struct rte_kvargs *kvlist;
+       u16 auto_neg = 1;
+       u16 poll = 0;
+       u16 present = 1;
+       u16 sgmii = 0;
+       u16 ffe_set = 0;
+       u16 ffe_main = 27;
+       u16 ffe_pre = 8;
+       u16 ffe_post = 44;
+
+       if (devargs == NULL)
+               goto null;
+
+       kvlist = rte_kvargs_parse(devargs->args, txgbe_valid_arguments);
+       if (kvlist == NULL)
+               goto null;
+
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_BP_AUTO,
+                          &txgbe_handle_devarg, &auto_neg);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_KR_POLL,
+                          &txgbe_handle_devarg, &poll);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_KR_PRESENT,
+                          &txgbe_handle_devarg, &present);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_KX_SGMII,
+                          &txgbe_handle_devarg, &sgmii);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_FFE_SET,
+                          &txgbe_handle_devarg, &ffe_set);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_FFE_MAIN,
+                          &txgbe_handle_devarg, &ffe_main);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_FFE_PRE,
+                          &txgbe_handle_devarg, &ffe_pre);
+       rte_kvargs_process(kvlist, TXGBE_DEVARG_FFE_POST,
+                          &txgbe_handle_devarg, &ffe_post);
+       rte_kvargs_free(kvlist);
+
+null:
+       hw->devarg.auto_neg = auto_neg;
+       hw->devarg.poll = poll;
+       hw->devarg.present = present;
+       hw->devarg.sgmii = sgmii;
+       hw->phy.ffe_set = ffe_set;
+       hw->phy.ffe_main = ffe_main;
+       hw->phy.ffe_pre = ffe_pre;
+       hw->phy.ffe_post = ffe_post;
+}
+
 static int
 eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 {
@@ -537,6 +606,7 @@ eth_txgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
        hw->isb_dma = TMZ_PADDR(mz);
        hw->isb_mem = TMZ_VADDR(mz);
 
+       txgbe_parse_devargs(hw, pci_dev->device.devargs);
        /* Initialize the shared code (base driver) */
        err = txgbe_init_shared_code(hw);
        if (err != 0) {
@@ -862,34 +932,10 @@ static int
 eth_txgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
                struct rte_pci_device *pci_dev)
 {
-       struct rte_eth_dev *pf_ethdev;
-       struct rte_eth_devargs eth_da;
-       int retval;
-
-       if (pci_dev->device.devargs) {
-               retval = rte_eth_devargs_parse(pci_dev->device.devargs->args,
-                               &eth_da);
-               if (retval)
-                       return retval;
-       } else {
-               memset(&eth_da, 0, sizeof(eth_da));
-       }
-
-       retval = rte_eth_dev_create(&pci_dev->device, pci_dev->device.name,
+       return rte_eth_dev_create(&pci_dev->device, pci_dev->device.name,
                        sizeof(struct txgbe_adapter),
                        eth_dev_pci_specific_init, pci_dev,
                        eth_txgbe_dev_init, NULL);
-
-       if (retval || eth_da.nb_representor_ports < 1)
-               return retval;
-       if (eth_da.type != RTE_ETH_REPRESENTOR_VF)
-               return -ENOTSUP;
-
-       pf_ethdev = rte_eth_dev_allocated(pci_dev->device.name);
-       if (pf_ethdev == NULL)
-               return -ENODEV;
-
-       return 0;
 }
 
 static int eth_txgbe_pci_remove(struct rte_pci_device *pci_dev)
@@ -898,7 +944,7 @@ static int eth_txgbe_pci_remove(struct rte_pci_device *pci_dev)
 
        ethdev = rte_eth_dev_allocated(pci_dev->device.name);
        if (!ethdev)
-               return -ENODEV;
+               return 0;
 
        return rte_eth_dev_destroy(ethdev, eth_txgbe_dev_uninit);
 }
@@ -1141,7 +1187,6 @@ txgbe_vlan_hw_extend_disable(struct rte_eth_dev *dev)
 
        ctrl = rd32(hw, TXGBE_PORTCTL);
        ctrl &= ~TXGBE_PORTCTL_VLANEXT;
-       ctrl &= ~TXGBE_PORTCTL_QINQ;
        wr32(hw, TXGBE_PORTCTL, ctrl);
 }
 
@@ -1149,17 +1194,38 @@ static void
 txgbe_vlan_hw_extend_enable(struct rte_eth_dev *dev)
 {
        struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
-       struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
-       struct rte_eth_txmode *txmode = &dev->data->dev_conf.txmode;
        uint32_t ctrl;
 
        PMD_INIT_FUNC_TRACE();
 
        ctrl  = rd32(hw, TXGBE_PORTCTL);
        ctrl |= TXGBE_PORTCTL_VLANEXT;
-       if (rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP ||
-           txmode->offloads & DEV_TX_OFFLOAD_QINQ_INSERT)
-               ctrl |= TXGBE_PORTCTL_QINQ;
+       wr32(hw, TXGBE_PORTCTL, ctrl);
+}
+
+static void
+txgbe_qinq_hw_strip_disable(struct rte_eth_dev *dev)
+{
+       struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
+       uint32_t ctrl;
+
+       PMD_INIT_FUNC_TRACE();
+
+       ctrl = rd32(hw, TXGBE_PORTCTL);
+       ctrl &= ~TXGBE_PORTCTL_QINQ;
+       wr32(hw, TXGBE_PORTCTL, ctrl);
+}
+
+static void
+txgbe_qinq_hw_strip_enable(struct rte_eth_dev *dev)
+{
+       struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
+       uint32_t ctrl;
+
+       PMD_INIT_FUNC_TRACE();
+
+       ctrl  = rd32(hw, TXGBE_PORTCTL);
+       ctrl |= TXGBE_PORTCTL_QINQ | TXGBE_PORTCTL_VLANEXT;
        wr32(hw, TXGBE_PORTCTL, ctrl);
 }
 
@@ -1226,6 +1292,13 @@ txgbe_vlan_offload_config(struct rte_eth_dev *dev, int mask)
                        txgbe_vlan_hw_extend_disable(dev);
        }
 
+       if (mask & ETH_QINQ_STRIP_MASK) {
+               if (rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP)
+                       txgbe_qinq_hw_strip_enable(dev);
+               else
+                       txgbe_qinq_hw_strip_disable(dev);
+       }
+
        return 0;
 }
 
@@ -1456,6 +1529,7 @@ txgbe_dev_phy_intr_setup(struct rte_eth_dev *dev)
        gpie |= TXGBE_GPIOBIT_6;
        wr32(hw, TXGBE_GPIOINTEN, gpie);
        intr->mask_misc |= TXGBE_ICRMISC_GPIO;
+       intr->mask_misc |= TXGBE_ICRMISC_ANDONE;
 }
 
 int
@@ -1560,17 +1634,6 @@ txgbe_dev_start(struct rte_eth_dev *dev)
 
        PMD_INIT_FUNC_TRACE();
 
-       /* TXGBE devices don't support:
-        *    - half duplex (checked afterwards for valid speeds)
-        *    - fixed speed: TODO implement
-        */
-       if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) {
-               PMD_INIT_LOG(ERR,
-               "Invalid link_speeds for port %u, fix speed not supported",
-                               dev->data->port_id);
-               return -EINVAL;
-       }
-
        /* Stop the link setup handler before resetting the HW. */
        rte_eal_alarm_cancel(txgbe_dev_setup_link_alarm_handler, dev);
 
@@ -1591,6 +1654,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
                return -1;
        hw->mac.start_hw(hw);
        hw->mac.get_link_status = true;
+       hw->dev_start = true;
 
        /* configure PF module if SRIOV enabled */
        txgbe_pf_host_configure(dev);
@@ -1689,7 +1753,8 @@ txgbe_dev_start(struct rte_eth_dev *dev)
                hw->mac.enable_tx_laser(hw);
        }
 
-       err = hw->mac.check_link(hw, &speed, &link_up, 0);
+       if ((hw->subsystem_device_id & 0xFF) != TXGBE_DEV_ID_KR_KX_KX4)
+               err = hw->mac.check_link(hw, &speed, &link_up, 0);
        if (err)
                goto error;
        dev->data->dev_link.link_status = link_up;
@@ -1702,7 +1767,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
                        ETH_LINK_SPEED_10G;
 
        link_speeds = &dev->data->dev_conf.link_speeds;
-       if (*link_speeds & ~allowed_speeds) {
+       if (((*link_speeds) >> 1) & ~(allowed_speeds >> 1)) {
                PMD_INIT_LOG(ERR, "Invalid link setting");
                goto error;
        }
@@ -1732,6 +1797,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
 skip_link_setup:
 
        if (rte_intr_allow_others(intr_handle)) {
+               txgbe_dev_misc_interrupt_setup(dev);
                /* check if lsc interrupt is enabled */
                if (dev->data->dev_conf.intr_conf.lsc != 0)
                        txgbe_dev_lsc_interrupt_setup(dev, TRUE);
@@ -1858,6 +1924,7 @@ txgbe_dev_stop(struct rte_eth_dev *dev)
 
        hw->adapter_stopped = true;
        dev->data->dev_started = 0;
+       hw->dev_start = false;
 
        return 0;
 }
@@ -2374,8 +2441,8 @@ static int txgbe_dev_xstats_get_names(struct rte_eth_dev *dev,
 }
 
 static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-       struct rte_eth_xstat_name *xstats_names,
        const uint64_t *ids,
+       struct rte_eth_xstat_name *xstats_names,
        unsigned int limit)
 {
        unsigned int i;
@@ -2505,18 +2572,17 @@ static int
 txgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 {
        struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
-       u16 eeprom_verh, eeprom_verl;
        u32 etrack_id;
        int ret;
 
-       hw->rom.readw_sw(hw, TXGBE_EEPROM_VERSION_H, &eeprom_verh);
-       hw->rom.readw_sw(hw, TXGBE_EEPROM_VERSION_L, &eeprom_verl);
+       hw->phy.get_fw_version(hw, &etrack_id);
 
-       etrack_id = (eeprom_verh << 16) | eeprom_verl;
        ret = snprintf(fw_version, fw_size, "0x%08x", etrack_id);
+       if (ret < 0)
+               return -EINVAL;
 
        ret += 1; /* add the size of '\0' */
-       if (fw_size < (u32)ret)
+       if (fw_size < (size_t)ret)
                return ret;
        else
                return 0;
@@ -2632,7 +2698,8 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev,
        link.link_status = ETH_LINK_DOWN;
        link.link_speed = ETH_SPEED_NUM_NONE;
        link.link_duplex = ETH_LINK_HALF_DUPLEX;
-       link.link_autoneg = ETH_LINK_AUTONEG;
+       link.link_autoneg = !(dev->data->dev_conf.link_speeds &
+                       ETH_LINK_SPEED_FIXED);
 
        hw->mac.get_link_status = true;
 
@@ -2652,12 +2719,17 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev,
        }
 
        if (link_up == 0) {
-               if (hw->phy.media_type == txgbe_media_type_fiber) {
+               if ((hw->subsystem_device_id & 0xFF) ==
+                               TXGBE_DEV_ID_KR_KX_KX4) {
+                       hw->mac.bp_down_event(hw);
+               } else if (hw->phy.media_type == txgbe_media_type_fiber) {
                        intr->flags |= TXGBE_FLAG_NEED_LINK_CONFIG;
                        rte_eal_alarm_set(10,
                                txgbe_dev_setup_link_alarm_handler, dev);
                }
                return rte_eth_linkstatus_set(dev, &link);
+       } else if (!hw->dev_start) {
+               return rte_eth_linkstatus_set(dev, &link);
        }
 
        intr->flags &= ~TXGBE_FLAG_NEED_LINK_CONFIG;
@@ -2787,6 +2859,20 @@ txgbe_dev_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on)
        return 0;
 }
 
+static int
+txgbe_dev_misc_interrupt_setup(struct rte_eth_dev *dev)
+{
+       struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev);
+       u64 mask;
+
+       mask = TXGBE_ICR_MASK;
+       mask &= (1ULL << TXGBE_MISC_VEC_ID);
+       intr->mask |= mask;
+       intr->mask_misc |= TXGBE_ICRMISC_GPIO;
+       intr->mask_misc |= TXGBE_ICRMISC_ANDONE;
+       return 0;
+}
+
 /**
  * It clears the interrupt causes and enables the interrupt.
  * It will be called once only during nic initialized.
@@ -2802,9 +2888,11 @@ static int
 txgbe_dev_rxq_interrupt_setup(struct rte_eth_dev *dev)
 {
        struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev);
+       u64 mask;
 
-       intr->mask[0] |= TXGBE_ICR_MASK;
-       intr->mask[1] |= TXGBE_ICR_MASK;
+       mask = TXGBE_ICR_MASK;
+       mask &= ~((1ULL << TXGBE_RX_VEC_START) - 1);
+       intr->mask |= mask;
 
        return 0;
 }
@@ -2841,12 +2929,17 @@ txgbe_dev_macsec_interrupt_setup(struct rte_eth_dev *dev)
  *  - On failure, a negative value.
  */
 static int
-txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev)
+txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
+                               struct rte_intr_handle *intr_handle)
 {
        uint32_t eicr;
        struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
        struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev);
 
+       if (intr_handle->type != RTE_INTR_HANDLE_UIO &&
+                       intr_handle->type != RTE_INTR_HANDLE_VFIO_MSIX)
+               wr32(hw, TXGBE_PX_INTA, 1);
+
        /* clear all cause mask */
        txgbe_disable_intr(hw);
 
@@ -2860,6 +2953,9 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev)
        if (eicr & TXGBE_ICRMISC_LSC)
                intr->flags |= TXGBE_FLAG_NEED_LINK_UPDATE;
 
+       if (eicr & TXGBE_ICRMISC_ANDONE)
+               intr->flags |= TXGBE_FLAG_NEED_AN_CONFIG;
+
        if (eicr & TXGBE_ICRMISC_VFMBX)
                intr->flags |= TXGBE_FLAG_MAILBOX;
 
@@ -2937,6 +3033,13 @@ txgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                intr->flags &= ~TXGBE_FLAG_PHY_INTERRUPT;
        }
 
+       if (intr->flags & TXGBE_FLAG_NEED_AN_CONFIG) {
+               if (hw->devarg.auto_neg == 1 && hw->devarg.poll == 0) {
+                       hw->mac.kr_handle(hw);
+                       intr->flags &= ~TXGBE_FLAG_NEED_AN_CONFIG;
+               }
+       }
+
        if (intr->flags & TXGBE_FLAG_NEED_LINK_UPDATE) {
                struct rte_eth_link link;
 
@@ -2950,6 +3053,11 @@ txgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                        /* handle it 1 sec later, wait it being stable */
                        timeout = TXGBE_LINK_UP_CHECK_TIMEOUT;
                /* likely to down */
+               else if ((hw->subsystem_device_id & 0xFF) ==
+                               TXGBE_DEV_ID_KR_KX_KX4 &&
+                               hw->devarg.auto_neg == 1)
+                       /* handle it 2 sec later for backplane AN73 */
+                       timeout = 2000;
                else
                        /* handle it 4 sec later, wait it being stable */
                        timeout = TXGBE_LINK_DOWN_CHECK_TIMEOUT;
@@ -2960,10 +3068,12 @@ txgbe_dev_interrupt_action(struct rte_eth_dev *dev,
                                      (void *)dev) < 0) {
                        PMD_DRV_LOG(ERR, "Error setting alarm");
                } else {
-                       /* remember original mask */
-                       intr->mask_misc_orig = intr->mask_misc;
                        /* only disable lsc interrupt */
                        intr->mask_misc &= ~TXGBE_ICRMISC_LSC;
+
+                       intr->mask_orig = intr->mask;
+                       /* only disable all misc interrupts */
+                       intr->mask &= ~(1ULL << TXGBE_MISC_VEC_ID);
                }
        }
 
@@ -3024,8 +3134,10 @@ txgbe_dev_interrupt_delayed_handler(void *param)
        }
 
        /* restore original mask */
-       intr->mask_misc = intr->mask_misc_orig;
-       intr->mask_misc_orig = 0;
+       intr->mask_misc |= TXGBE_ICRMISC_LSC;
+
+       intr->mask = intr->mask_orig;
+       intr->mask_orig = 0;
 
        PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]", eicr);
        txgbe_enable_intr(dev);
@@ -3049,7 +3161,7 @@ txgbe_dev_interrupt_handler(void *param)
 {
        struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
 
-       txgbe_dev_interrupt_get_status(dev);
+       txgbe_dev_interrupt_get_status(dev, dev->intr_handle);
        txgbe_dev_interrupt_action(dev, dev->intr_handle);
 }
 
@@ -3370,9 +3482,6 @@ txgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
                return -EINVAL;
        }
 
-       /* update max frame size */
-       dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
-
        if (hw->mode)
                wr32m(hw, TXGBE_FRMSZ, TXGBE_FRMSZ_MAX_MASK,
                        TXGBE_FRAME_SIZE_MAX);
@@ -4887,7 +4996,6 @@ txgbe_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
                        break;
                }
                wr32(hw, TXGBE_VXLANPORT, udp_tunnel->udp_port);
-               wr32(hw, TXGBE_VXLANPORTGPE, udp_tunnel->udp_port);
                break;
        case RTE_TUNNEL_TYPE_GENEVE:
                if (udp_tunnel->udp_port == 0) {
@@ -4905,6 +5013,14 @@ txgbe_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
                }
                wr32(hw, TXGBE_TEREDOPORT, udp_tunnel->udp_port);
                break;
+       case RTE_TUNNEL_TYPE_VXLAN_GPE:
+               if (udp_tunnel->udp_port == 0) {
+                       PMD_DRV_LOG(ERR, "Add VxLAN port 0 is not allowed.");
+                       ret = -EINVAL;
+                       break;
+               }
+               wr32(hw, TXGBE_VXLANPORTGPE, udp_tunnel->udp_port);
+               break;
        default:
                PMD_DRV_LOG(ERR, "Invalid tunnel type");
                ret = -EINVAL;
@@ -4938,7 +5054,6 @@ txgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
                        break;
                }
                wr32(hw, TXGBE_VXLANPORT, 0);
-               wr32(hw, TXGBE_VXLANPORTGPE, 0);
                break;
        case RTE_TUNNEL_TYPE_GENEVE:
                cur_port = (uint16_t)rd32(hw, TXGBE_GENEVEPORT);
@@ -4960,6 +5075,16 @@ txgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
                }
                wr32(hw, TXGBE_TEREDOPORT, 0);
                break;
+       case RTE_TUNNEL_TYPE_VXLAN_GPE:
+               cur_port = (uint16_t)rd32(hw, TXGBE_VXLANPORTGPE);
+               if (cur_port != udp_tunnel->udp_port) {
+                       PMD_DRV_LOG(ERR, "Port %u does not exist.",
+                                       udp_tunnel->udp_port);
+                       ret = -EINVAL;
+                       break;
+               }
+               wr32(hw, TXGBE_VXLANPORTGPE, 0);
+               break;
        default:
                PMD_DRV_LOG(ERR, "Invalid tunnel type");
                ret = -EINVAL;
@@ -5221,17 +5346,27 @@ static const struct eth_dev_ops txgbe_eth_dev_ops = {
 RTE_PMD_REGISTER_PCI(net_txgbe, rte_txgbe_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_txgbe, pci_id_txgbe_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_txgbe, "* igb_uio | uio_pci_generic | vfio-pci");
-
-RTE_LOG_REGISTER(txgbe_logtype_init, pmd.net.txgbe.init, NOTICE);
-RTE_LOG_REGISTER(txgbe_logtype_driver, pmd.net.txgbe.driver, NOTICE);
+RTE_PMD_REGISTER_PARAM_STRING(net_txgbe,
+                             TXGBE_DEVARG_BP_AUTO "=<0|1>"
+                             TXGBE_DEVARG_KR_POLL "=<0|1>"
+                             TXGBE_DEVARG_KR_PRESENT "=<0|1>"
+                             TXGBE_DEVARG_KX_SGMII "=<0|1>"
+                             TXGBE_DEVARG_FFE_SET "=<0-4>"
+                             TXGBE_DEVARG_FFE_MAIN "=<uint16>"
+                             TXGBE_DEVARG_FFE_PRE "=<uint16>"
+                             TXGBE_DEVARG_FFE_POST "=<uint16>");
+
+RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_init, init, NOTICE);
+RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_driver, driver, NOTICE);
+RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_bp, bp, NOTICE);
 
 #ifdef RTE_LIBRTE_TXGBE_DEBUG_RX
-       RTE_LOG_REGISTER(txgbe_logtype_rx, pmd.net.txgbe.rx, DEBUG);
+       RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_rx, rx, DEBUG);
 #endif
 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX
-       RTE_LOG_REGISTER(txgbe_logtype_tx, pmd.net.txgbe.tx, DEBUG);
+       RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_tx, tx, DEBUG);
 #endif
 
 #ifdef RTE_LIBRTE_TXGBE_DEBUG_TX_FREE
-       RTE_LOG_REGISTER(txgbe_logtype_tx_free, pmd.net.txgbe.tx_free, DEBUG);
+       RTE_LOG_REGISTER_SUFFIX(txgbe_logtype_tx_free, tx_free, DEBUG);
 #endif