鲲鹏服务器 跑dpdk 添加vxlan失败

 

 

 

原来没有实现udp_tunnel_port_add接口

net_hinic: Disable promiscuous, nic_dev: hinic-0000:05:00.0, port_id: 0, promisc: 0
net_hinic: Disable allmulticast succeed, nic_dev: hinic-0000:05:00.0, port_id: 0

Breakpoint 1, rte_eth_dev_udp_tunnel_port_add (port_id=0, udp_tunnel=0xfffffffff018) at /data1/dpdk-19.11/lib/librte_ethdev/rte_ethdev.c:3552
3552            RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
Missing separate debuginfos, use: debuginfo-install glibc-2.17-317.el7.aarch64 libgcc-4.8.5-44.el7.aarch64
(gdb) n
3553            if (udp_tunnel == NULL) {
(gdb) n
3558            if (udp_tunnel->prot_type >= RTE_TUNNEL_TYPE_MAX) {
(gdb) p udp_tunnel->prot_type
$1 = 1 '\001'
(gdb) p RTE_TUNNEL_TYPE_MAX
$2 = RTE_TUNNEL_TYPE_MAX
(gdb) n
3563            dev = &rte_eth_devices[port_id];
(gdb) n
3564            RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_port_add, -ENOTSUP);
(gdb) n
3567    }
(gdb) n
vxlan_port_init (port=0, mbuf_pool=0x13f9aac00) at /data1/dpdk-19.11/examples/tep_termination/vxlan_setup.c:180
180             if (retval < 0)
(gdb) n
181                     return retval;
(gdb) n
204     }
(gdb) quit
A debugging session is active.

        Inferior 1 [process 36899] will be killed.

Quit anyway? (y or n) y
[root@localhost tep_termination]# 

 

ixgbe_dev_udp_tunnel_port_add

 

/* Add UDP tunneling port */
static int
ixgbe_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
                              struct rte_eth_udp_tunnel *udp_tunnel)
{
        int ret = 0;
        struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);

        if (hw->mac.type != ixgbe_mac_X550 &&
            hw->mac.type != ixgbe_mac_X550EM_x &&
            hw->mac.type != ixgbe_mac_X550EM_a) {
                return -ENOTSUP;
        }

        if (udp_tunnel == NULL)
                return -EINVAL;

        switch (udp_tunnel->prot_type) {
        case RTE_TUNNEL_TYPE_VXLAN:
                ret = ixgbe_add_vxlan_port(hw, udp_tunnel->udp_port);
                break;

        case RTE_TUNNEL_TYPE_GENEVE:
        case RTE_TUNNEL_TYPE_TEREDO:
                PMD_DRV_LOG(ERR, "Tunnel type is not supported now.");
                ret = -EINVAL;
                break;

        default:
                PMD_DRV_LOG(ERR, "Invalid tunnel type");
                ret = -EINVAL;
                break;
        }

        return ret;
}

 

 

ixgbe_add_vxlan_port  
       ixgbe_update_vxlan_port
/* There's only one register for VxLAN UDP port.
 * So, we cannot add several ports. Will update it.
 */
static int
ixgbe_add_vxlan_port(struct ixgbe_hw *hw,
                     uint16_t port)
{
        if (port == 0) {
                PMD_DRV_LOG(ERR, "Add VxLAN port 0 is not allowed.");
                return -EINVAL;
        }

        return ixgbe_update_vxlan_port(hw, port);
}

ixgbe_update_vxlan_port

ixgbe_update_vxlan_port(struct ixgbe_hw *hw,
                        uint16_t port)
{
        IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, port);
        IXGBE_WRITE_FLUSH(hw);

        return 0;
}

 

posted on 2020-12-23 19:22  tycoon3  阅读(280)  评论(0)    收藏  举报

导航