Skip to content

Instantly share code, notes, and snippets.

View gist:e6b4c6a9f69e15f342dc
/*
* gcc flood_mmap.c -l pcap -O3 -o flood_mmap
*/
#include <arpa/inet.h>
#include <ctype.h>
#include <getopt.h>
#include <linux/if_packet.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <pcap/pcap.h>
View ixgbe-single-queue.diff
diff -Nraup ixgbe-linux-netmap/ixgbe-3.23.2.1/src/ixgbe_main.c ixgbe-linux-netmap-single-queue/ixgbe-3.23.2.1/src/ixgbe_main.c
--- ixgbe-linux-netmap/ixgbe-3.23.2.1/src/ixgbe_main.c 2015-06-20 14:23:38.457783634 +0100
+++ ixgbe-linux-netmap-single-queue/ixgbe-3.23.2.1/src/ixgbe_main.c 2015-06-20 14:23:31.330496612 +0100
@@ -686,6 +686,7 @@ static bool ixgbe_clean_tx_irq(struct ix
if (test_bit(__IXGBE_DOWN, &adapter->state))
return true;
+ if (tx_ring->queue_index == 0) {
#ifdef DEV_NETMAP
/*
@majek
majek / import-intel-wired-lan.sh
Created Jun 21, 2015
Import intel-wired-lan ixgbe to git
View import-intel-wired-lan.sh
#!/bin/bash
cat << EOF > /tmp/xxx
4.1.1 2015-06-17 100100 weekly downloads
4.0.3 2015-04-15 9494 weekly downloads
3.23.2.1 2015-02-23 1919 weekly downloads
3.23.2 2014-12-22 1515 weekly downloads
3.22.3 2014-08-15 99 weekly downloads
3.21.2 2014-03-28 88 weekly downloads
3.19.1 2013-12-20 1515 weekly downloads
View a.go
package main
import (
"fmt"
"os"
"strings"
"math/rand"
"github.com/gdamore/mangos"
View README.md

How to run:

go build udp.go; sudo bash -c "ulimit -n 100000; ./udpserver"
go build udpclient.go && ./udpclient
sudo netstat -l4np --udp|grep :1234|tr -s " "|egrep -v "p 0"

Sample output

127.0.87.133:1234    0.347 ms
@majek
majek / client.go
Created Sep 18, 2015
tcp performance
View client.go
package main
import (
"flag"
"fmt"
"net"
"os"
"strings"
"sync/atomic"
"time"
View gist:1133827
i = 10
for x in [0...i]
alert(x)
View gist:1133851
var d, i, _i, _results;
i = 10;
d = (function() {
_results = [];
for (var _i = 0;
0 <= i ? _i < i : _i > i;
0 <= i ? _i++ : _i--) { _results.push(_i); }
return _results;
}).apply(this);
View gist:1133904
console.log(a + b + c);
console.log(a(+b + c));
View gist:1133824
var i, x;
i = 10;
for (x = 0; 0 <= i ? x < i : x > i; 0 <= i ? x++ : x--) {
alert(x);
}