This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/bpf.h> | |
#ifndef __section | |
# define __section(NAME) \ | |
__attribute__((section(NAME), used)) | |
#endif | |
__section("prog") | |
int xdp_drop(struct xdp_md *ctx) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct rte_eth_conf port_conf = { | |
.rxmode = { | |
.mq_mode = ETH_MQ_RX_RSS, | |
}, | |
.rx_adv_conf = { | |
.rss_conf = { | |
.rss_hf = ETH_RSS_IP | | |
ETH_RSS_TCP | | |
ETH_RSS_UDP | | |
ETH_RSS_SCTP, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define RSS_HASH_KEY_LENGTH 40 | |
static uint8_t hash_key[RSS_HASH_KEY_LENGTH] = { | |
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, | |
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, | |
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, | |
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, | |
0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, 0x6D, 0x5A, | |
}; | |
struct rte_eth_conf port_conf = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=$PATH:./build-root/build-vpp-native/vpp/bin/ | |
if [ $USER != "root" ] ; then | |
echo "Restarting script with sudo..." | |
sudo $0 ${*} | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=$PATH:./build-root/build-vpp-native/vpp/bin/ | |
if [ $USER != "root" ] ; then | |
echo "Restarting script with sudo..." | |
sudo $0 ${*} | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./build-root/build-vpp-native/vpp/bin/vppctl tap connect vpp1 | |
./build-root/build-vpp-native/vpp/bin/vppctl tap connect vpp2 | |
./build-root/build-vpp-native/vpp/bin/vppctl set interface state tapcli-0 up | |
./build-root/build-vpp-native/vpp/bin/vppctl set interface state tapcli-1 up | |
ip netns delete vpp1 | |
ip netns delete vpp2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unix { | |
nodaemon | |
log /tmp/vpp.log | |
full-coredump | |
gid vpp | |
interactive | |
cli-listen /run/vpp/cli.sock | |
} | |
api-trace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm" | |
config.vm.box_check_update = false | |
vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2) | |
vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifeq ($(KERNELRELEASE),) | |
KERNELDIR ?= /lib/modules/$(shell uname -r)/build | |
PWD := $(shell pwd) | |
modules: | |
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules EXTRA_CFLAGS="-g -DDEBUG" | |
modules_install: | |
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "trusty64" | |
config.vm.network "private_network", ip: "192.168.50.4" |
NewerOlder