This file contains hidden or 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
;;;; See http://mvanier.livejournal.com/2897.html | |
(define Y | |
(lambda (f) | |
((lambda (x) (f (lambda (y) ((x x) y)))) | |
(lambda (x) (f (lambda (y) ((x x) y))))))) | |
;;;; Equivalent: | |
(define Y |
This file contains hidden or 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
---- TRACE 234 start header.lua:256 | |
0001 UGET 1 0 ; ffi | |
0002 TGETS 1 1 0 ; "sizeof" | |
0003 TGETS 2 0 1 ; "_header" | |
0004 TGETS 2 2 2 ; "t" | |
0005 CALLT 1 2 | |
0000 FUNCC ; ffi.sizeof | |
---- TRACE 234 abort ipv4.lua:166 -- leaving loop in root trace |
This file contains hidden or 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
;;; Look for "lea -nnnn(%rip),%fn" AT the tra; if that's present, use | |
;;; the dispacement -nnnn to find the function. The end of the | |
;;; encoded displacement is | |
;;; x8664::recover-fn-from-rip-disp-offset (= 7) bytes from the tra. | |
(defx86lapfunction %return-address-function ((r arg_z)) | |
; extract tag into imm0 | |
(extract-lisptag r imm0) | |
; assert first byte of imm0 = tra tag | |
(cmpb ($ x8664::tag-tra) (% imm0.b)) | |
(jne @fail) |
This file contains hidden or 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
local ffi = require("ffi") | |
local ctable = require("lib.ctable") | |
local ipv4 = require("lib.protocol.ipv4") | |
local ip_t = ffi.typeof('uint8_t[4]') | |
local mac_sessionid_t = ffi.typeof([[ | |
struct { | |
uint8_t mac[6]; | |
uint16_t sessionid; |
This file contains hidden or 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
* * * * * flock -x -n ~/jeffrey.lock ~/jeffrey.sh |
This file contains hidden or 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
local ethernet = require("lib.protocol.ethernet") | |
MyApp = {} | |
function MyApp:new () | |
local o = {} | |
o.pkt = packet.allocate() | |
-- create a header that points into o.pkt |
This file contains hidden or 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
Loading /tmp/snabb_nfv_selftest_ports.17004 | |
worker(unbound): starting | |
Get features 0x18428001 | |
VIRTIO_F_ANY_LAYOUT VIRTIO_NET_F_MQ VIRTIO_NET_F_CTRL_VQ VIRTIO_NET_F_MRG_RXBUF VIRTIO_RING_F_INDIRECT_DESC VIRTIO_NET_F_CSUM | |
worker(unbound): Get features 0x18428001 | |
VIRTIO_F_ANY_LAYOUT VIRTIO_NET_F_MQ VIRTIO_NET_F_CTRL_VQ VIRTIO_NET_F_MRG_RXBUF VIRTIO_RING_F_INDIRECT_DESC VIRTIO_NET_F_CSUM | |
Get features 0x18428001 | |
VIRTIO_F_ANY_LAYOUT VIRTIO_NET_F_MQ VIRTIO_NET_F_CTRL_VQ VIRTIO_NET_F_MRG_RXBUF VIRTIO_RING_F_INDIRECT_DESC VIRTIO_NET_F_CSUM | |
worker(unbound): load: time: 0.63s fps: 0 fpGbps: 0.000 fpb: 0 bpp: - sleep: 100 us | |
Get features 0x18428001 |
This file contains hidden or 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
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. | |
-- IOControl and IO macro apps that implement the following interface: | |
-- | |
-- config.app("ctrl", IOControl, | |
-- {pciaddr="01:00.0", | |
-- queues = {{id="a", mac="10:10:10:10:10:10", vlan=42, buckets=2}, | |
-- {id="b", mac="20:20:20:20:20:20", vlan=43}}}) | |
-- | |
-- config.app("io", IO, {pciaddr="01:00.0", queue = "a", bucket = 1}) |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
---- TRACE 1 start synth.lua:37 | |
---- TRACE 1 abort synth.lua:36 -- leaving loop in root trace | |
---- TRACE 1 start packet.lua:41 | |
---- TRACE 1 IR | |
0001 > cdt SLOAD #1 T | |
0002 u16 FLOAD 0001 cdata.ctypeid | |
0003 > int EQ 0002 +1290 | |
0004 p64 ADD 0001 +8 | |
0005 u64 XLOAD 0004 |
This file contains hidden or 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 | |
set -euo pipefail | |
commit=$1 | |
parent=$1^1 | |
function commit_path_sha512 { | |
git cat-file blob $(git rev-parse $1:$2) | sha512sum | cut -d " " -f 1 | |
} |