Sample Applications User Guide Release 16.04.0

Total Page:16

File Type:pdf, Size:1020Kb

Sample Applications User Guide Release 16.04.0 Sample Applications User Guide Release 16.04.0 April 12, 2016 CONTENTS 1 Introduction 1 1.1 Documentation Roadmap...............................1 2 Command Line Sample Application2 2.1 Overview........................................2 2.2 Compiling the Application...............................2 2.3 Running the Application................................3 2.4 Explanation.......................................3 3 Ethtool Sample Application5 3.1 Compiling the Application...............................5 3.2 Running the Application................................5 3.3 Using the application.................................5 3.4 Explanation.......................................6 3.5 Ethtool interface....................................6 4 Exception Path Sample Application8 4.1 Overview........................................8 4.2 Compiling the Application...............................9 4.3 Running the Application................................9 4.4 Explanation....................................... 10 5 Hello World Sample Application 13 5.1 Compiling the Application............................... 13 5.2 Running the Application................................ 13 5.3 Explanation....................................... 13 6 Basic Forwarding Sample Application 15 6.1 Compiling the Application............................... 15 6.2 Running the Application................................ 15 6.3 Explanation....................................... 15 7 RX/TX Callbacks Sample Application 20 7.1 Compiling the Application............................... 20 7.2 Running the Application................................ 20 7.3 Explanation....................................... 21 8 IP Fragmentation Sample Application 24 8.1 Overview........................................ 24 8.2 Building the Application................................ 24 i 8.3 Running the Application................................ 25 9 IPv4 Multicast Sample Application 27 9.1 Overview........................................ 27 9.2 Building the Application................................ 27 9.3 Running the Application................................ 28 9.4 Explanation....................................... 28 10 IP Reassembly Sample Application 33 10.1 Overview........................................ 33 10.2 The Longest Prefix Match (LPM for IPv4, LPM6 for IPv6) table is used to store/lookup an outgoing port number, associated with that IPv4 address. Any unmatched packets are forwarded to the originating port.Compiling the Appli- cation.......................................... 33 10.3 Running the Application................................ 34 10.4 Explanation....................................... 35 11 Kernel NIC Interface Sample Application 38 11.1 Overview........................................ 38 11.2 Compiling the Application............................... 39 11.3 Loading the Kernel Module.............................. 39 11.4 Running the Application................................ 40 11.5 KNI Operations.................................... 41 11.6 Explanation....................................... 41 12 Keep Alive Sample Application 48 12.1 Overview........................................ 48 12.2 Compiling the Application............................... 48 12.3 Running the Application................................ 49 12.4 Explanation....................................... 49 13 L2 Forwarding with Crypto Sample Application 51 13.1 Overview........................................ 51 13.2 Compiling the Application............................... 51 13.3 Running the Application................................ 51 13.4 Explanation....................................... 53 14 L2 Forwarding Sample Application (in Real and Virtualized Environments) with core load statistics. 58 14.1 Overview........................................ 58 14.2 Compiling the Application............................... 60 14.3 Running the Application................................ 60 14.4 Explanation....................................... 60 15 L2 Forwarding Sample Application (in Real and Virtualized Environments) 69 15.1 Overview........................................ 69 15.2 Compiling the Application............................... 71 15.3 Running the Application................................ 71 15.4 Explanation....................................... 71 16 L2 Forwarding Sample Application with Cache Allocation Technology (CAT) 78 16.1 Compiling the Application............................... 78 16.2 Running the Application................................ 79 ii 16.3 Explanation....................................... 80 17 L3 Forwarding Sample Application 82 17.1 Overview........................................ 82 17.2 Compiling the Application............................... 82 17.3 Running the Application................................ 83 17.4 Explanation....................................... 84 18 L3 Forwarding with Power Management Sample Application 88 18.1 Introduction....................................... 88 18.2 Overview........................................ 88 18.3 Compiling the Application............................... 89 18.4 Running the Application................................ 89 18.5 Explanation....................................... 90 19 L3 Forwarding with Access Control Sample Application 95 19.1 Overview........................................ 95 19.2 Compiling the Application............................... 99 19.3 Running the Application................................ 99 19.4 Explanation....................................... 100 20 L3 Forwarding in a Virtualization Environment Sample Application 102 20.1 Overview........................................ 102 20.2 Compiling the Application............................... 102 20.3 Running the Application................................ 103 20.4 Explanation....................................... 104 21 Link Status Interrupt Sample Application 105 21.1 Overview........................................ 105 21.2 Compiling the Application............................... 105 21.3 Running the Application................................ 106 21.4 Explanation....................................... 106 22 Load Balancer Sample Application 112 22.1 Overview........................................ 112 22.2 Compiling the Application............................... 113 22.3 Running the Application................................ 113 22.4 Explanation....................................... 114 23 Multi-process Sample Application 117 23.1 Example Applications................................. 117 24 QoS Metering Sample Application 132 24.1 Overview........................................ 132 24.2 Compiling the Application............................... 132 24.3 Running the Application................................ 133 24.4 Explanation....................................... 133 25 QoS Scheduler Sample Application 135 25.1 Overview........................................ 135 25.2 Compiling the Application............................... 135 25.3 Running the Application................................ 136 25.4 Explanation....................................... 139 iii 26 Intel® QuickAssist Technology Sample Application 141 26.1 Overview........................................ 141 26.2 Building the Application................................ 143 26.3 Running the Application................................ 143 27 Quota and Watermark Sample Application 145 27.1 Overview........................................ 145 27.2 Compiling the Application............................... 147 27.3 Running the Application................................ 147 27.4 Code Overview.................................... 148 28 Timer Sample Application 155 28.1 Compiling the Application............................... 155 28.2 Running the Application................................ 155 28.3 Explanation....................................... 155 29 Packet Ordering Application 158 29.1 Overview........................................ 158 29.2 Compiling the Application............................... 158 29.3 Running the Application................................ 158 30 VMDQ and DCB Forwarding Sample Application 160 30.1 Overview........................................ 160 30.2 Compiling the Application............................... 161 30.3 Running the Application................................ 161 30.4 Explanation....................................... 162 31 Vhost Sample Application 166 31.1 Background...................................... 166 31.2 Sample Code Overview................................ 168 31.3 Supported Distributions................................ 168 31.4 Prerequisites...................................... 168 31.5 Compiling the Sample Code............................. 173 31.6 Running the Sample Code.............................. 173 31.7 Running the Virtual Machine (QEMU)........................ 175 31.8 Running DPDK in the Virtual Machine........................ 179 31.9 Passing Traffic to the Virtual Machine Device.................... 181 32 Netmap Compatibility Sample Application 182 32.1 Introduction....................................... 182 32.2 Available APIs..................................... 182 32.3 Caveats......................................... 182 32.4 Porting Netmap Applications............................. 183 32.5 Compiling the “bridge” Sample Application..................... 184 32.6 Running the “bridge” Sample Application...................... 184 33 Internet Protocol (IP) Pipeline Application 185 33.1 Application overview.................................
Recommended publications
  • At—At, Batch—Execute Commands at a Later Time
    at—at, batch—execute commands at a later time at [–csm] [–f script] [–qqueue] time [date] [+ increment] at –l [ job...] at –r job... batch at and batch read commands from standard input to be executed at a later time. at allows you to specify when the commands should be executed, while jobs queued with batch will execute when system load level permits. Executes commands read from stdin or a file at some later time. Unless redirected, the output is mailed to the user. Example A.1 1 at 6:30am Dec 12 < program 2 at noon tomorrow < program 3 at 1945 pm August 9 < program 4 at now + 3 hours < program 5 at 8:30am Jan 4 < program 6 at -r 83883555320.a EXPLANATION 1. At 6:30 in the morning on December 12th, start the job. 2. At noon tomorrow start the job. 3. At 7:45 in the evening on August 9th, start the job. 4. In three hours start the job. 5. At 8:30 in the morning of January 4th, start the job. 6. Removes previously scheduled job 83883555320.a. awk—pattern scanning and processing language awk [ –fprogram–file ] [ –Fc ] [ prog ] [ parameters ] [ filename...] awk scans each input filename for lines that match any of a set of patterns specified in prog. Example A.2 1 awk '{print $1, $2}' file 2 awk '/John/{print $3, $4}' file 3 awk -F: '{print $3}' /etc/passwd 4 date | awk '{print $6}' EXPLANATION 1. Prints the first two fields of file where fields are separated by whitespace. 2. Prints fields 3 and 4 if the pattern John is found.
    [Show full text]
  • Unix Introduction
    Unix introduction Mikhail Dozmorov Summer 2018 Mikhail Dozmorov Unix introduction Summer 2018 1 / 37 What is Unix Unix is a family of operating systems and environments that exploits the power of linguistic abstractions to perform tasks Unix is not an acronym; it is a pun on “Multics”. Multics was a large multi-user operating system that was being developed at Bell Labs shortly before Unix was created in the early ’70s. Brian Kernighan is credited with the name. All computational genomics is done in Unix http://www.read.seas.harvard.edu/~kohler/class/aosref/ritchie84evolution.pdfMikhail Dozmorov Unix introduction Summer 2018 2 / 37 History of Unix Initial file system, command interpreter (shell), and process management started by Ken Thompson File system and further development from Dennis Ritchie, as well as Doug McIlroy and Joe Ossanna Vast array of simple, dependable tools that each do one simple task Ken Thompson (sitting) and Dennis Ritchie working together at a PDP-11 Mikhail Dozmorov Unix introduction Summer 2018 3 / 37 Philosophy of Unix Vast array of simple, dependable tools Each do one simple task, and do it really well By combining these tools, one can conduct rather sophisticated analyses The Linux help philosophy: “RTFM” (Read the Fine Manual) Mikhail Dozmorov Unix introduction Summer 2018 4 / 37 Know your Unix Unix users spend a lot of time at the command line In Unix, a word is worth a thousand mouse clicks Mikhail Dozmorov Unix introduction Summer 2018 5 / 37 Unix systems Three common types of laptop/desktop operating systems: Windows, Mac, Linux. Mac and Linux are both Unix-like! What that means for us: Unix-like operating systems are equipped with “shells”" that provide a command line user interface.
    [Show full text]
  • MLNX OFED Documentation Rev 5.0-2.1.8.0
    MLNX_OFED Documentation Rev 5.0-2.1.8.0 Exported on May/21/2020 06:13 AM https://docs.mellanox.com/x/JLV-AQ Notice This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality. NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice. Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete. NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document. NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage.
    [Show full text]
  • Oracle Database Licensing Information, 11G Release 2 (11.2) E10594-26
    Oracle® Database Licensing Information 11g Release 2 (11.2) E10594-26 July 2012 Oracle Database Licensing Information, 11g Release 2 (11.2) E10594-26 Copyright © 2004, 2012, Oracle and/or its affiliates. All rights reserved. Contributor: Manmeet Ahluwalia, Penny Avril, Charlie Berger, Michelle Bird, Carolyn Bruse, Rich Buchheim, Sandra Cheevers, Leo Cloutier, Bud Endress, Prabhaker Gongloor, Kevin Jernigan, Anil Khilani, Mughees Minhas, Trish McGonigle, Dennis MacNeil, Paul Narth, Anu Natarajan, Paul Needham, Martin Pena, Jill Robinson, Mark Townsend This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations.
    [Show full text]
  • Linux Software User's Manual
    New Generation Systems (NGS) Linux Software User’s Manual Version 1.0, September 2019 www.moxa.com/product © 2019 Moxa Inc. All rights reserved. New Generation Systems (NGS) Linux Software User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of that agreement. Copyright Notice © 2019 Moxa Inc. All rights reserved. Trademarks The MOXA logo is a registered trademark of Moxa Inc. All other trademarks or registered marks in this manual belong to their respective manufacturers. Disclaimer Information in this document is subject to change without notice and does not represent a commitment on the part of Moxa. Moxa provides this document as is, without warranty of any kind, either expressed or implied, including, but not limited to, its particular purpose. Moxa reserves the right to make improvements and/or changes to this manual, or to the products and/or the programs described in this manual, at any time. Information provided in this manual is intended to be accurate and reliable. However, Moxa assumes no responsibility for its use, or for any infringements on the rights of third parties that may result from its use. This product might include unintentional technical or typographical errors. Changes are periodically made to the information herein to correct such errors, and these changes are incorporated into new editions of the publication. Technical Support Contact Information www.moxa.com/support Moxa Americas Moxa China (Shanghai office) Toll-free: 1-888-669-2872 Toll-free: 800-820-5036 Tel: +1-714-528-6777 Tel: +86-21-5258-9955 Fax: +1-714-528-6778 Fax: +86-21-5258-5505 Moxa Europe Moxa Asia-Pacific Tel: +49-89-3 70 03 99-0 Tel: +886-2-8919-1230 Fax: +49-89-3 70 03 99-99 Fax: +886-2-8919-1231 Moxa India Tel: +91-80-4172-9088 Fax: +91-80-4132-1045 Table of Contents 1.
    [Show full text]
  • Name Synopsis Description Options
    ovs−vlan−test(1) Open vSwitch Manual ovs−vlan−test(1) NAME ovs−vlan−test −check Linux drivers for problems with vlan traffic SYNOPSIS ovs−vlan−test [−s | −−server] control_ip vlan_ip Common options: [−h | −−help][−V | −−version] DESCRIPTION The ovs−vlan−test utility has some limitations, for example, it does not use TCP in its tests. Also it does not takeinto account MTU to detect potential edge cases. Toovercome those limitations a newtool was developed − ovs−test. ovs−test is currently supported only on Debian so, if possible try to use that on instead of ovs−vlan−test. The ovs−vlan−test program may be used to check for problems sending 802.1Q traffic which may occur when running Open vSwitch. These problems can occur when Open vSwitch is used to send 802.1Q traffic through physical interfaces running certain drivers of certain Linux kernel versions. Torun a test, configure Open vSwitch to tag traffic originating from vlan_ip and forward it out the target interface. Then run the ovs−vlan−test in client mode connecting to an ovs−vlan−test server. ovs−vlan−test will display "OK" if it did not detect problems. Some examples of the types of problems that may be encountered are: • When NICs use VLAN stripping on receive theymust pass a pointer to a vlan_group when reporting the stripped tag to the networking core. If no vlan_group is in use then some drivers just drop the extracted tag. Drivers are supposed to only enable stripping if a vlan_group is regis- tered but not all of them do that.
    [Show full text]
  • Openshift Container Platform 4.6 Scalability and Performance
    OpenShift Container Platform 4.6 Scalability and performance Scaling your OpenShift Container Platform cluster and tuning performance in production environments Last Updated: 2021-09-22 OpenShift Container Platform 4.6 Scalability and performance Scaling your OpenShift Container Platform cluster and tuning performance in production environments Legal Notice Copyright © 2021 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/ . In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates. XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries. Node.js ® is an official trademark of Joyent.
    [Show full text]
  • Praat Scripting Tutorial
    Praat Scripting Tutorial Eleanor Chodroff Newcastle University July 2019 Praat Acoustic analysis program Best known for its ability to: Visualize, label, and segment audio files Perform spectral and temporal analyses Synthesize and manipulate speech Praat Scripting Praat: not only a program, but also a language Why do I want to know Praat the language? AUTOMATE ALL THE THINGS Praat Scripting Why can’t I just modify others’ scripts? Honestly: power, flexibility, control Insert: all the gifs of ‘you can do it’ and ‘you got this’ and thumbs up Praat Scripting Goals ~*~Script first for yourself, then for others~*~ • Write Praat scripts quickly, effectively, and “from scratch” • Learn syntax and structure of the language • Handle various input/output combinations Tutorial Overview 1) Praat: Big Picture 2) Getting started 3) Basic syntax 4) Script types + Practice • Wav files • Measurements • TextGrids • Other? Praat: Big Picture 1) Similar to other languages you may (or may not) have used before • String and numeric variables • For-loops, if else statements, while loops • Regular expression matching • Interpreted language (not compiled) Praat: Big Picture 2) Almost everything is a mouse click! i.e., Praat is a GUI scripting language GUI = Graphical User Interface, i.e., the Objects window If you ever get lost while writing a Praat script, click through the steps using the GUI Getting Started Open a Praat script From the toolbar, select Praat à New Praat script Save immediately! Save frequently! Script Goals and Input/Output • Consider what
    [Show full text]
  • MC-1200 Series Linux Software User's Manual
    MC-1200 Series Linux Software User’s Manual Version 1.0, November 2020 www.moxa.com/product © 2020 Moxa Inc. All rights reserved. MC-1200 Series Linux Software User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of that agreement. Copyright Notice © 2020 Moxa Inc. All rights reserved. Trademarks The MOXA logo is a registered trademark of Moxa Inc. All other trademarks or registered marks in this manual belong to their respective manufacturers. Disclaimer Information in this document is subject to change without notice and does not represent a commitment on the part of Moxa. Moxa provides this document as is, without warranty of any kind, either expressed or implied, including, but not limited to, its particular purpose. Moxa reserves the right to make improvements and/or changes to this manual, or to the products and/or the programs described in this manual, at any time. Information provided in this manual is intended to be accurate and reliable. However, Moxa assumes no responsibility for its use, or for any infringements on the rights of third parties that may result from its use. This product might include unintentional technical or typographical errors. Changes are periodically made to the information herein to correct such errors, and these changes are incorporated into new editions of the publication. Technical Support Contact Information www.moxa.com/support Moxa Americas Moxa China (Shanghai office) Toll-free: 1-888-669-2872 Toll-free: 800-820-5036 Tel: +1-714-528-6777 Tel: +86-21-5258-9955 Fax: +1-714-528-6778 Fax: +86-21-5258-5505 Moxa Europe Moxa Asia-Pacific Tel: +49-89-3 70 03 99-0 Tel: +886-2-8919-1230 Fax: +49-89-3 70 03 99-99 Fax: +886-2-8919-1231 Moxa India Tel: +91-80-4172-9088 Fax: +91-80-4132-1045 Table of Contents 1.
    [Show full text]
  • Deviceinstaller User Guide
    Device Installer User Guide Part Number 900-325 Revision C 03/18 Table of Contents 1. Overview ...................................................................................................................................... 1 2. Devices ........................................................................................................................................ 2 Choose the Network Adapter for Communication ....................................................................... 2 Search for All Devices on the Network ........................................................................................ 2 Change Views .............................................................................................................................. 2 Add a Device to the List ............................................................................................................... 3 View Device Details ..................................................................................................................... 3 Device Lists ................................................................................................................................. 3 Save the Device List ................................................................................................................ 3 Open the Device List ............................................................................................................... 4 Print the Device List ................................................................................................................
    [Show full text]
  • Sys, Shutil, and OS Modules
    This video will introduce the sys, shutil, glob, and os modules. 1 The sys module contains a few tools that are often useful and will be used in this course. The first tool is the argv function which allows the script to request a parameter when the script is run. We will use this function in a few weeks when importing scripts into ArcGIS. If a zero is specified for the argv function, then it will return the location of the script on the computer. This can be helpful if the script needs to look for a supplemental file, such as a template, that is located in the same folder as the script. The exit function stops the script when it reach the exit statement. The function can be used to stop a script when a certain condition occurs – such as when a user specifies an invalid parameter. This allows the script to stop gracefully rather than crashing. The exit function is also useful when troubleshooting a script. 2 The shutil module contains tools for moving and deleting files. The copy tool makes a copy of a file in a new location. The copytree tool makes a copy of an entire folder in a new location. The rmtree tool deletes an entire folder. Note that this tool will not send items to the recycling bin and it will not ask for confirmation. The tool will fail if it encounters any file locks in the folder. 3 The os module contains operating system functions – many of which are often useful in a script.
    [Show full text]
  • ANSWERS ΤΟ EVEN-Numbered
    8 Answers to Even-numbered Exercises 2.1. WhatExplain the following unexpected are result: two ways you can execute a shell script when you do not have execute permission for the file containing the script? Can you execute a shell script if you do not have read permission for the file containing the script? You can give the name of the file containing the script as an argument to the shell (for example, bash scriptfile or tcsh scriptfile, where scriptfile is the name of the file containing the script). Under bash you can give the following command: $ . scriptfile Under both bash and tcsh you can use this command: $ source scriptfile Because the shell must read the commands from the file containing a shell script before it can execute the commands, you must have read permission for the file to execute a shell script. 4.3. AssumeWhat is the purpose ble? you have made the following assignment: $ person=zach Give the output of each of the following commands. a. echo $person zach b. echo '$person' $person c. echo "$person" zach 1 2 6.5. Assumengs. the /home/zach/grants/biblios and /home/zach/biblios directories exist. Specify Zach’s working directory after he executes each sequence of commands. Explain what happens in each case. a. $ pwd /home/zach/grants $ CDPATH=$(pwd) $ cd $ cd biblios After executing the preceding commands, Zach’s working directory is /home/zach/grants/biblios. When CDPATH is set and the working directory is not specified in CDPATH, cd searches the working directory only after it searches the directories specified by CDPATH.
    [Show full text]