Skip to content

Instantly share code, notes, and snippets.

@upa
upa / tx-udp.lua
Last active December 26, 2017 15:08
A MoonGen script: tx udp packets
-- This test does the following:
-- 2. Send UDP packets from NIC 1 to NIC 2
--
local mg = require "moongen"
local memory = require "memory"
local device = require "device"
local ts = require "timestamping"
local filter = require "filter"
local hist = require "histogram"
@upa
upa / cnt.lua
Created December 26, 2017 15:01
A MoonGen script: count rxed packets on each queue
local mg = require "moongen"
local memory = require "memory"
local device = require "device"
local stats = require "stats"
local log = require "log"
local timer = require "timer"
local pktctrs = {}
@upa
upa / netns-gen.sh
Last active April 27, 2017 12:05
A Login Shell (sciprt) to enable users to select a network namespace where the users want to login
#!/bin/bash
ip=/bin/ip
ifc=/sbin/ifconfig
intf=$1
configdir=ns-configs
if [ "$intf" == "" ]; then
echo $0 [raw interface]
@upa
upa / keybase.md
Created August 23, 2016 15:32
keybase

keybase.md

Keybase proof

I hereby claim:

  • I am upa on github.
  • I am upa (https://keybase.io/upa) on keybase.
  • I have a public key ASDYBl8z7taGpmVyem5c7-O07Y0gU9k7V2fmHuFGuhbiSwo
@upa
upa / .gitignore
Last active August 24, 2016 18:45
socket viz
*.png
*.json
// fthash.v
// embedded sum of src ip and first half of dst ip to src MAC 8 bit
module one_port #(
// Master AXI Stream Data width
parameter C_M_AXIS_DATA_WIDTH=256,
parameter C_M_AXIS_TUSER_WIDTH=128,
parameter C_S_AXIS_DATA_WIDTH=256,
parameter C_S_AXIS_TUSER_WIDTH=128,
parameter SRC_PORT_POS=16,
@upa
upa / fthash.v
Created May 30, 2016 14:23
damepo
// fthash.v
// embedded sum of src ip and first half of dst ip to src MAC 8 bit
module one_port #(
// Master AXI Stream Data width
parameter C_M_AXIS_DATA_WIDTH=256,
parameter C_M_AXIS_TUSER_WIDTH=128,
parameter C_S_AXIS_DATA_WIDTH=256,
parameter C_S_AXIS_TUSER_WIDTH=128,
parameter SRC_PORT_POS=16,
// fthash.v
// embedded sum of src ip and first half of dst ip to src MAC 8 bit
module one_port #(
// Master AXI Stream Data width
parameter C_M_AXIS_DATA_WIDTH=256,
parameter C_M_AXIS_TUSER_WIDTH=128,
parameter C_S_AXIS_DATA_WIDTH=256,
parameter C_S_AXIS_TUSER_WIDTH=128,
parameter SRC_PORT_POS=16,
@upa
upa / sdhash.v
Last active May 25, 2016 19:14
Src and Dst NIC
// sdhash.v
// embedded sum of src ip and first half of dst ip to src MAC 8 bit
// working at 2016/5/26 4:14
module one_port #(
// Master AXI Stream Data width
parameter C_M_AXIS_DATA_WIDTH=256,
parameter C_M_AXIS_TUSER_WIDTH=128,
parameter C_S_AXIS_DATA_WIDTH=256,
parameter C_S_AXIS_TUSER_WIDTH=128,
@upa
upa / kumade2.py
Last active April 28, 2016 10:21
a simple single command config fetcher
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# kumade version 2.
# a simple single command config fetcher
import sys
import pexpect
from optparse import OptionParser