summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/main.c
AgeCommit message (Collapse)AuthorFilesLines
2020-09-21Add git version.Xavier Simonart1-0/+2
git version is now printed in prox.log file. - git_version.c is always recompiled - If source have been locally changed, the build is shown as dirty - If git is not available on the build system, a message such as 'make: git: Command not found' will be printed, but the build will succeed. Change-Id: If551832c6079f5e3bd04cd4d8ac5f8204e6be8cd Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2020-09-21Added support for multiple vlans in ipv4 vdev modeXavier Simonart1-3/+3
When the following conditions are met: - ipv4 - vdev enabled Then multiple vlans are supported. Multiple vlans can be configured using the vlan_tag option within the port section of the config file. Multiple (different) local_ipv4/prefix must then also be configured within the same section. Note that for ipv6 multiple vlans are not supported (yet) Also, when vdev is not enabled, multiple vlans are also not (yet) supported. Change-Id: I38b6cd98ff2a0f484d1bf0910b15413ba21ae6d6 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2020-09-21Added support for reporting packet (mis)order.Xavier Simonart1-2/+2
The "Latency" screen has been updated with 3 columns: - mis-ordered Count the number of mis-ordered packets. - extent: Gives an indication of how mis-ordered the packets are. Receiving packet "x - 5" after receiving packet "x" will cause an extent of 5. - duplicate: Count number of duplicate packets. Following commands have been added for the impair mode: - proba no drop: replaces the former "probability" command. Percentage of forwarded packets. So 99.5 means 0.5% of packet drop. - proba delay Percentage of delayed packets for the impair mode. - proba duplicate Percentage of duplicate packets. Similar parameters are supported within the config files: - proba no drop - proba delay - proba duplicate Note: it is recommanded to use the signature when measuring packet misorder, as otherwise unexpected packet would cause miscounts. Change-Id: I037f606f264d6e2bd7f123df5ed57ab7df8386d7 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2020-08-18Add all_rx_queues port flag to use all rx queuesLuc Provoost1-0/+43
In the port section of the PROX configuration file, a new parameter can be added: all_rx_queues. The default is all_rx_queues=no. When the rx port variable of a task is listing a port name, all rx queues will be used when the all_rx_queues is set for that port. If not set, only one queue of that port will be "consumed", each time the port is referenced in the rx port variable. When the all_rx_queues is set for a port, you should NOT reference that port more than once in the rx port variables. Change-Id: If9662b1ac07adeec9db88d2a25ca68aed0b9e213 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
2020-05-29Added initial support for NDP (IPv6)Xavier Simonart1-21/+31
Following messages are now handled by PROX - router_solicitation - neighbour_solicitation - router_advertisement - neighbour_advertisement The following parameters are supported (through the PROX config file) - sub mode=ndp This will enable handling of router and neighbour solicitation and advertisement. - local ipv6=xxxx:xxxx:xxxxx:xxxx:xxxx:xxxx:xxxx:xxxx This will configure the local IPv6 address of the port. This parameter is optional. If not specified, the local IPv6 will be calculated from the EUI. - global ipv6=xxxx:xxxx:xxxxx:xxxx:xxxx:xxxx:xxxx:xxxx This will configure the global IPv6 address of the port. This parameter is optional. If not specified, the global IPv6 will be calculated from the EUI and the router prefix received from the router. - ipv6 router=yes This will cause the core to behave as an IPv6 router i.e. it will generate Router Advertisement messages This is only useful in back to back cases, when no real IPv6 router is present in the setup. - router prefix=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx The router prefix usedin the router advertisement The prefix will be used by the node to build an IPv6 global address in cases none were configured. "Unsollicited NA" parameter has been added within the core/task section. If set to yes (Unsollicited NA=yes), then an unsollicited neighbour Advertisement is sent at startup A same core/task cannot support both l3 and ndp mode. Those messages will be generated or handled when submode is set to "ndp": - neighbour sollicitation - neighbour advertisement - router sollicitation - router advertisement An example configuration is provided: config/ipv6.cfg in which port 0 / core 1 plays the role of the generator and port 1 / core 2 plays the role of the swap. Change-Id: Id0ab32d384448b4cf767fb4a1c486fc023f4f395 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2020-05-29Added support for secondary process & virtual devicesXavier Simonart1-11/+14
A virtual device can be created adding the following option on the eal field within the eal options section: --vdev=net_ring0 This will cause a new (virtual) dpdk port to be created. Such a device can then be used in a primary process as other DPDK devices i.e. a [port x] section must be defined in the configuration file For a secondary process, there is no need to add --vdev, but, of course --proc-type=secondary (or --proc-type=auto) must be set within the eal field. There are two ways to use such a virtual device in a secondary process 1) Using the DPDK port number. Note however that the DPDK port number of virtual devices in the secondary process might not start from 0 and might hence have to be guessed e.g. if using 2 virtual devices in primary process (--vdev=net_ring0 --vdev=net_ring1) the port_id will be 0 and 1 in primary process and 2 & 3 in secondary process. 2) Using the port name, as defined in --vdev in the primary process. In this way, no [port] section must be defined, and the virtual port names are directly used within the "rx port" and "tx port" configuration e.g.: rx port=net_ring0 tx port=net_ring1 Limitations =========== There seems to be a PROX leak causing DPDK port id to increase when restarting the secondary process (causing the secondary process configuration through port id more difficult). As the primary process configures the port (including the number of rx and tx queues) based on its config file, the secondary process can't setup its own queues. Simple configurations (such as using gen or lat in primary, and swap in secondary) work as PROX allocates a RX queue even in gen mode and a TX queue even in lat mode. Better configuration/support for secondary process should be designed. The use of dpdk port names is only supported by PROX within "rx port" and "tx port". It is not supported by other configuration fields such as "tx ports from routing table". The use of dpdk port names in "rx port" and "tx port" is limited to only 1 port. Change-Id: Iaa606625da471403713a21df79d3ded4bb91b91e Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2020-01-29Prepare for DPDK 19.08 supportXavier Simonart1-3/+3
This commit prepares PROX for supporting changes from DPDK 19.08 Mainly, the "sed" listed below were run. In addition, - some forward definition have been removed, - prox_compat.h has been updated - prox_compat.h has been included where necessary. Hence such a commit is rather easy to review and to reapply on other branches if necessary. sed -i 's/struct ether_hdr/prox_rte_ether_hdr/g' *.h sed -i 's/struct ether_hdr/prox_rte_ether_hdr/g' *.c sed -i 's/struct ether_addr/prox_rte_ether_addr/g' *.c sed -i 's/struct ether_addr/prox_rte_ether_addr/g' *.h sed -i 's/prox_rte_ether_addr_port/struct ether_addr_port/g' *.c sed -i 's/prox_rte_ether_addr_port/struct ether_addr_port/g' *.h sed -i 's/struct vlan_hdr/prox_rte_vlan_hdr/g' *.c sed -i 's/struct vlan_hdr/prox_rte_vlan_hdr/g' *.h sed -i 's/struct ipv4_hdr/prox_rte_ipv4_hdr/g' *.h sed -i 's/struct ipv4_hdr/prox_rte_ipv4_hdr/g' *.c sed -i 's/struct ipv6_hdr/prox_rte_ipv6_hdr/g' *.c sed -i 's/struct ipv6_hdr/prox_rte_ipv6_hdr/g' *.h sed -i 's/struct udp_hdr/prox_rte_udp_hdr/g' *.c sed -i 's/struct udp_hdr/prox_rte_udp_hdr/g' *.h sed -i 's/struct tcp_hdr/prox_rte_tcp_hdr/g' *.c sed -i 's/struct tcp_hdr/prox_rte_tcp_hdr/g' *.h sed -i 's/struct prox_rte_ether_addr_copy/ether_addr_copy/g' *.c sed -i 's/struct prox_rte_ether_addr_copy/ether_addr_copy/g' *.h sed -i 's/struct prox_rte_ether_addr_copy/prox_rte_ether_addr_copy/g' *.c sed -i 's/struct prox_rte_ether_addr_copy/ether_addr_copy/g' *.h sed -i 's/prox_rte_ether_addr_copy/ether_addr_copy/g' *.h sed -i 's/prox_rte_ether_addr_copy/ether_addr_copy/g' *.c sed -i 's/ether_addr_copy/prox_rte_ether_addr_copy/g' *.c sed -i 's/ether_addr_copy/prox_rte_ether_addr_copy/g' *.h sed -i 's/prox_rte_ether_hdr_arp/struct ether_hdr_arp/g' *.h sed -i 's/prox_rte_ether_hdr_arp/struct ether_hdr_arp/g' *.c sed -i 's/struct vxlan_gpe_hdr/prox_rte_vxlan_gpe_hdr/g' *.h sed -i 's/struct vxlan_gpe_hdr/prox_rte_vxlan_gpe_hdr/g' *.c sed -i 's/eth_random_addr/prox_rte_eth_random_addr/g' *.c sed -i 's/eth_random_addr/prox_rte_eth_random_addr/g' *.h sed -i 's/ETHER_CRC_LEN/PROX_RTE_ETHER_CRC_LEN/g' *.c sed -i 's/ETHER_CRC_LEN/PROX_RTE_ETHER_CRC_LEN/g' *.h sed -i 's/ETHER_HDR_LEN/PROX_RTE_ETHER_HDR_LEN/g' *.c sed -i 's/ETHER_HDR_LEN/PROX_RTE_ETHER_HDR_LEN/g' *.h sed -i 's/ETHER_MAX_LEN/PROX_RTE_ETHER_MAX_LEN/g' *.c sed -i 's/ETHER_MAX_LEN/PROX_RTE_ETHER_MAX_LEN/g' *.h sed -i 's/ETHER_MIN_LEN/PROX_RTE_ETHER_MIN_LEN/g' *.c sed -i 's/ETHER_MIN_LEN/PROX_RTE_ETHER_MIN_LEN/g' *.h sed -i 's/TCP_SYN_FLAG/PROX_RTE_TCP_SYN_FLAG/g' *.c sed -i 's/TCP_RST_FLAG/PROX_RTE_TCP_RST_FLAG/g' *.c sed -i 's/TCP_FIN_FLAG/PROX_RTE_TCP_FIN_FLAG/g' *.c sed -i 's/TCP_ACK_FLAG/PROX_RTE_TCP_ACK_FLAG/g' *.c Change-Id: I4dfe8be68e618c94dcaae28754579fbeb571bb00 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2019-10-08Fix display error with repeated characters (ncurses/xterm related issue)Xavier Simonart1-1/+36
On recent OSes such as RHEL 8.0, ncurses(6.1) introduced support for ECMA-48 repeat character control. Some terminal emulators use TERM=xterm but do not support this feature. In this case, printing repeated character such as "22000000 Hz" might be displayed as 220 Hz. Other emulators, such as tmux, use TERM=screen, and do not exhibit the issue. Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Change-Id: I79977c7421699b59957d6cbd8aa954f06f3e0227
2019-04-15PROX: update versionstable/hunterXavier Simonart1-1/+1
PROX version was not udpated since a long time, resulting in difficulty to easily understand which version is being run. Improved solution should be to support sha1. Change-Id: I9d68bd64f52f32544d31d2b8c6bcd0c55c7c228c Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2019-02-07Add check for configuration error (not enough mbuf)Xavier Simonart1-1/+24
Number of mbufs must at least cover for number of rx descriptors, number of tx descriptors, number of mbuf cached and number of mbufs handled by the application. If this is not the case, a warning is returned. This ony check for the more basic cases. This will not check for instance for cases with multiples rings where more mbufs might be cached. Change-Id: If2c0c9fc76ed4500849d92cf7586bb0b25d8ab22 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-12-13Fix arp handling when master core is on socket 1Xavier Simonart1-1/+1
When master core was on socket 1, the rings setup to exchange messages related to arp between dataplane cores and master core was not properly setup, resulting in arp not working. Change-Id: Icc08df81f2e39e53de7c212248cdc7b78d7e2618 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-12-13Clean up debugging messagesXavier Simonart1-1/+1
Print IP address in a.b.c.d format instead of one 32-bit number. Better align debugging information in log file Change-Id: Icfab30836ba83d53f700fcfbdfbd7cf238ed7bf8 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-10-31Merge "Fix potential crash when shuffling mbufs"Deepak S1-2/+3
2018-10-31Support for DPDK 18.05 and DPDK 18.08Xavier Simonart1-30/+84
Improve DPDK 18.05 support introduced by 3e532aca. Support for DPDK 18.08. Change-Id: Ide712ee94254b506a0ad88c95a7e01b789f99d48 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-10-30Fix potential crash when shuffling mbufsXavier Simonart1-2/+3
Change-Id: I70de6345afc6a696906f006c1b0f44540ae4ecec Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-05-25Increase default mbuf size and code simplification/cleanupXavier Simonart1-41/+41
mbuf size was setup to achieve the best performance i.e. using the smallest mbuf and not segmenting packets. However this resulted in complex code, much dependent of the way the pmd are working e.g. a change(fix) in recent dpdk i40e implementation caused a 1782 (=1518+8+256) bytes mbuf to be too small to hold a 1518 bytes packets. Hence this change simplifies the mbuf size selection at the price of a potential decreases in performance - as more memory is now used. Except if jumbo frames are used, the mbuf size will now be the same for all modes. The packets will not be segmented except if jumbo frames are enabled. If jumbo frames are enabled, packets are by default segmented, except if the mbuf size is configured big enough in the config file. Change-Id: I222fcac7a65c0d221d5d422f419deb9c0f864172 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Signed-off-by: Deepak S <deepak.s@linux.intel.com>
2018-04-26Fix crc offloads.Xavier Simonart1-4/+4
When configuring a port, prox configures queue flags. For historitical reasons, offloads had to be disabled on some pmds. There is now an API to query the ports and gets their capabilities. This fix sets now the flags based on the capabilities, and not the driver name. Change-Id: Ic72d15001992f26910f653c70d31e4381fff8089 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2018-04-15Add support for reception of jumbo framesXavier Simonart1-33/+63
Jumbo frames are now supported through the addition of a "mtu" parameter of the port in the config file. Setting the mtu to a value higher than 1500 bytes will enable the reception of jumbo frames. In addition, the rte_eth_dev_set_mtu is now set for all pmds. Finally, setting mbuf_size does not set MEMPOOL_F_NO_SPREAD anymore. This option was only used for pure debugging. Big packets can be received using two ways - Using multiple "small" mbufs, i.e. around 2K. This is the default. - Using one big mbuf holding the whole packet. This can be enabled by setting a parameter mbuf_size in the receiving core configuration Change-Id: Idd60ad31f41c89f9522dff4d894af2696b7a2ea1 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2017-12-18Add l3 support for tasks without physical tx portsXavier Simonart1-6/+3
This adds support for tasks in l3 submode receiving from ports but transmitting to rings. ARP related information is exchanged between tasks through master core. Tasks transmitting to physical ports are responsible to transmit arp related packets. Tasks not transmitting to physical ports (and using rings) should not try to transmit arp packets. Transmitting arp packets through ring would be more complex, as we would need extra information (within the mbuf) to distinguish for instance an arp reply comoing from the network and an arp reply coming from a core (as a reply to an arp request). Change-Id: Ib55dc8c39d5e55703a933faa16bcc008f1274929 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2017-11-15Add support for nop mode with l3 submodeXavier Simonart1-7/+31
The l3 submode was not supported in nop mode, as the nop mode uses some specific nop thread (and not generic). When L3 is specified, the nop mode must use the generic thread. In addition the l3 submode is implemented differently than other submodes. It is not supported through task_init structures (i.e. each task does not have to explicitely tell that it supports l3 submode). But this prevented to run both a nop with no submode and a nop with a l3 submode. Note that nop with l3 is usually not very useful - it handles arp (requests and response) but as nop, it does not swap IP addresses. So with a real switch, the packets transmitted will be received back... and l3 mode is usually mainly usefull when using a switch. However, there is at least one nop mode where l3 submode makes sense: when the nop does not transmit. In such cases, for instace used in conjunction with a gen l3, the nop receives all packets and forward the arp requests and responses to the master for handling. Change-Id: I992121db285ba25a11cbb494092a6afc6fe55a58 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
2017-10-25Merge changes from PROX-v041Patrice Buriez1-13/+90
Change-Id: Ie6d4e7ce22c27967117a446626f5923643397812 Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-07-14Adding PROX(Packet pROcessing eXecution engine) VNF to sampleVNFDeepak S1-0/+993
JIRA: SAMPLEVNF-55 PROX is a DPDK-based application implementing Telco use-cases such as a simplified BRAS/BNG, light-weight AFTR... It also allows configuring finer grained network functions like QoS, Routing, load-balancing... (We are moving PROX version v039 to sampleVNF https://01.org/intel-data-plane-performance-demonstrators/prox-overview) Change-Id: Ia3cb02cf0e49ac5596e922c197ff7e010293d033 Signed-off-by: Deepak S <deepak.s@linux.intel.com>