From fa869940dd9bb459ac599fe80c26c9d3e720fd31 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Mon, 20 Apr 2020 23:25:22 +0200 Subject: Add support for vdev tap devices This commit adds support for the creation of tap devices. To create a tap device, and associate it with a DPDK port, add within the port section: vdev= local ipv4= will appear as a kernel network device, with an IP ARP packets received from the network on the DPDK interface will be forwarded to the kernel. 1st packet which needs to be generated to a new IP will cause an IP packet to be sent to the kernel (using socket sendto) forcing the kernel to send an ARP_REQUEST. In this commit, there is no notification from the kernel about ARP table changes. This is subject to further commits. Two config files, gen_tap.cfg and swap_tap.cfg have been created. They work one against each other. *** Note however that they do not work if running within the same host (with the port being connected back to back) *** This is due to the fact that the kernel would bypass the ports and use local interface... Change-Id: Iadeec0d99e3c693472ea44bdb9163a3bf97df2fa Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/packet_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'VNFs/DPPD-PROX/packet_utils.c') diff --git a/VNFs/DPPD-PROX/packet_utils.c b/VNFs/DPPD-PROX/packet_utils.c index 96d9074a..b0bc6da9 100644 --- a/VNFs/DPPD-PROX/packet_utils.c +++ b/VNFs/DPPD-PROX/packet_utils.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2010-2017 Intel Corporation +// Copyright (c) 2010-2020 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -253,6 +253,7 @@ void task_start_l3(struct task_base *tbase, struct task_args *targ) tbase->local_ipv4 = rte_be_to_cpu_32(targ->local_ipv4); register_ip_to_ctrl_plane(tbase->l3.tmaster, tbase->local_ipv4, tbase->l3.reachable_port_id, targ->lconf->id, targ->id); } + master_init_vdev(tbase->l3.tmaster, tbase->l3.reachable_port_id, targ->lconf->id, targ->id); name[3]++; struct rte_mempool *ret = rte_mempool_create(name, NB_ARP_MBUF, ARP_MBUF_SIZE, NB_CACHE_ARP_MBUF, sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, 0, @@ -333,6 +334,7 @@ void handle_ctrl_plane_pkts(struct task_base *tbase, struct rte_mbuf **mbufs, ui break; case ARP_REPLY_FROM_CTRL: case ARP_REQ_FROM_CTRL: + case PKT_FROM_TAP: out[0] = 0; // tx_ctrlplane_pkt does not drop packets tbase->aux->tx_ctrlplane_pkt(tbase, &mbufs[j], 1, out); -- cgit 1.2.3-korg