From f9b0da859a9f2a6556f0437d5cff42a0648dcab2 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Tue, 22 Sep 2020 12:42:06 +0200 Subject: Report failure when tap port is not mapped to real dpdk port. When using "vdev=" in port section, a tap device and an additional dpdk port are created. In most cases, we still want to use a real DPDK device (i.e. bound to an interface such as virtio or a PF or a VF). PROX will now report by default an error when the used [port] is not a DPDK bound device. An additional parameter "virtual=yes" can be added in the port section in case one want to disable this error checking (e.g. specify additional parameter for the vdev device). This patch also fixes a potential endianess issue when configuring IP addresses. Change-Id: Iffdd9552308be3b77cfe2067630647acac2c01fe Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/handle_master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'VNFs/DPPD-PROX/handle_master.c') diff --git a/VNFs/DPPD-PROX/handle_master.c b/VNFs/DPPD-PROX/handle_master.c index b55db77e..ddaab521 100644 --- a/VNFs/DPPD-PROX/handle_master.c +++ b/VNFs/DPPD-PROX/handle_master.c @@ -169,7 +169,7 @@ void master_init_vdev(struct task_base *tbase, uint8_t port_id, uint8_t core_id, src.sin_family = AF_INET; src.sin_port = rte_cpu_to_be_16(PROX_PSEUDO_PKT_PORT); for (int vlan_id = 0; vlan_id < prox_port_cfg[vdev_port].n_vlans; vlan_id++) { - src.sin_addr.s_addr = prox_port_cfg[vdev_port].ip_addr[vlan_id].ip; + src.sin_addr.s_addr = rte_be_to_cpu_32(prox_port_cfg[vdev_port].ip_addr[vlan_id].ip); int fd = socket(AF_INET, SOCK_DGRAM, 0); PROX_PANIC(fd < 0, "Failed to open socket(AF_INET, SOCK_DGRAM, 0)\n"); prox_port_cfg[vdev_port].fds[vlan_id] = fd; -- cgit 1.2.3-korg