Skip to content

Instantly share code, notes, and snippets.

@upa
upa / kernel-3.14-ecmp-hashonly.patch
Created March 28, 2015 09:19
a patch for kernel-3.14 (mptcp_v0.89), enable MULTIPATH_HASHONLY balancing.
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9922093..67f6aad 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -292,6 +292,8 @@ int fib_sync_down_dev(struct net_device *dev, int force);
int fib_sync_down_addr(struct net *net, __be32 local);
int fib_sync_up(struct net_device *dev);
void fib_select_multipath(struct fib_result *res);
+void fib_select_multipath_hashonly(struct fib_result *res,
+ const struct flowi4 * fl4);
@upa
upa / required-packages-for-dce.txt
Created April 1, 2015 04:50
required packages for ns-3-dce on ubuntu 14.04.1 LTS
minimal required packages to compile ns-3-dce on ubuntu 14.04.1 LTS
git gcc make
mercurial bzr g++ cvs unzip unrar cmake p7zip-rar autoconf
libpcap-dev libexpat-dev libdb-dev bison flex libssl-dev pkg-config
for elf-loader (optional) : libc6-dbg
make testbin -C arch/sim/test (net-next-sim)
@upa
upa / .gitignore
Last active August 29, 2015 14:24
multi-source-flow generator using netmap
srcgen
@upa
upa / urldnsdump.c
Created July 17, 2015 11:23
URL and DNS packet dump via netmap
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <fcntl.h>
#include <time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
@upa
upa / hiroshi.c
Created August 10, 2015 06:42
/dev/hiroshi
/* /dev/hiroshi */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/netdevice.h>
#include <net/dst.h>
@upa
upa / .gitignore
Last active January 5, 2016 13:51
rfwrt
*.pyc
@upa
upa / padding_packet.v
Last active September 4, 2015 22:36
padding 20byte to to of ether frame, netfpga-1g
// padding 20byte to head of the ether frame.
`timescale 1ns/1ps
module padding_packet
#(parameter DATA_WIDTH = 64,
parameter CTRL_WIDTH = DATA_WIDTH/8,
parameter UDP_REG_SRC_WIDTH = 2,
parameter INPUT_ARBITER_STAGE_NUM = 2,
parameter IO_QUEUE_STAGE_NUM = `IO_QUEUE_STAGE_NUM,
@upa
upa / list.h
Created November 18, 2015 18:13
simple suffix base and add only patricia trie
#ifndef __LIST_H
#define __LIST_H
#define offset_of(type,member) ((size_t)&(((type*)0)->member))
//#define LIST_POISON1 0xdeaddead
//#define LIST_POISON2 0xbedeadbe
#define LIST_POISON1 0
#define LIST_POISON2 0
@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
@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,