2008年6月26日 星期四

後變給扯下來了... @_@

5/24 一早起床發覺天氣還不錯, 太陽不太大, 按照計畫騎著車出門上班去, 一路上覺得變速器有點怪怪的
好像到某個角度就會卡卡的, 心想應該是前天騎完車拆下鏈條清潔不乾淨, 也沒有太注意, 還是一路往前行
從竹東下公館騎到二重埔, 上坡的地方施力怪怪的, 二重埔溜到竹中口, 一路下坡變檔也是卡卡的
想說到了公司再看看吧... 就還是往前騎

好不容易在車陣中穿梭到了過了園區高架, 一綠燈趕緊往前騎, 怕 miss 掉高速公路那個大紅燈.
沒想到才騎一點距離就被台載小孩上課的小 march 給擋住, 趕緊變檔, 剎車往內側行, 挖哩咧...
結果 march 突然間又往內側靠... 銬銬銬... 鏈條卡了一下, 趕緊停下來把鏈條給裝上, 再往前一大踩
又卡... 下車一看不得了了... 後變掉下來了... 挖挖哇...

只好打電話把老婆給挖起來, 趕緊載著我上班去... 真是傷腦筋...

後變速器不見了... @_@


車架的地方拉近一點看

斷掉的後變支架

再看一下車架的地方

看到鏈條哪裡出問題嗎?

歪掉了... @_@

變速器上拆下的那個支架...

就是他闖的禍...

得休息好一陣子不能騎車了... :(

2008年6月23日 星期一

荒漠甘泉06232008

「耶穌說,你來罷。彼得就從船上下去,在水面上走,要到耶穌那裡去;只因見風甚大,就害怕;將要沉下去,便喊著說,主阿,救我。」 (聖經馬太福音十四章 2930 節)

  讀者,你看見嗎?彼得的小信是一個極大的障礙;他既然已經開步走了,波浪的大小,無須他去操心;他所當注意的,乃是從主所在的地方射過來的那道光彩。光彩以外,縱有十個埃及,彼得也無須去注意。

  讀者,當主在水面上叫你:「來罷」的時候,歡歡喜喜地向前走去!不要轉過你的眼去注視別的東西!

  因為你不能因著測度波浪得到勝利;也不能因著測量風力得到堅固。越去注意危險,越會墜入危險;越是見難而止,越會遭遇苦難。讀者,你應當舉起你的兩眼來專心仰望主,大著膽向前走去!──

2008年6月22日 星期日

北埔寶二行

2008 年 6 月 21 日, 一大早就被電話給吵醒, 原來是睡過頭啦... 鬧鐘設定六點居然沒叫 @_@
睡過頭啦~~~ @_@ 還好一行人還在二重埔吃早餐, 趕緊刷牙洗臉出門溜狗去... 趕在七點半出發往北埔去...

比想像中的快, 八點出頭就到北埔了. 街上沒啥人, 死觀光客還沒出現...



沒多做停留, 之後再往北埔冷泉的方向騎去, 沒想到花了不少時間才到冷泉... 上上下下的果真比較累...

拍一下車車...

當然還有大腳丫...

今天穿情侶鞋...

在休息的同時, 居然遇到了梁凱的老爸, 真酷... 一身勁裝準備從五指山那邊回竹東,太強了...
下回挑戰的目標囉...

看一下大家吧,
有頌謙

頌慈

愛自拍的高國

拿著 LOMO 的小石,

當然還有我們囉...

老婆說要幫她拍一張當車隊報名照片, 穿車衣看起來好瘦

之後又跑回市區吃冰去, 挖挖挖... 觀光客進來啦...
還好冰店不在廟的那個大馬路上, 沒被人指指點點的... :p
這間冰店就是 n 年前跟皙恩和建誠第一次騎車走二重埔-寶二-北埔-寶三-二重埔
時候的那間店ㄟ... 真是太巧了... 還是這間店是名店???

冰還不錯吃啦, 吃冰前先照一張囉, 看得出來大家都粉累...

老婆的薏仁牛奶冰

頌慈好像想吃的樣子, 哈哈!

抹茶花生紅豆冰, 超炫的. 不錯吃喔!!

我比較喜歡吃米苔目ㄟ... 所以叫了個米苔目綠豆冰, 真怪的組合, but 也是好吃啊~~~

吃完冰就又開始幹活啦, 來程走台三線, 回程j跟老婆走寶二繞回竹東, 其他就再走寶山路
一路回到新竹... 挖挖哇... 想到就累得咧... :p
之前騎過兩次, 在其往寶山水庫的那個大上坡差點掛掉...

到了大壩前當然要先拍個照囉.

再一張

這次的旅程地圖, 從家裡出發到回家四十二公里, 其他人從明湖路出發, 挖賽, 六十多吧...
真是太猛啦, 上回騎到內灣也是, 看來我跟老婆比較偷懶ㄟ... 但寶二水庫順時針其真是他 x 的難騎
不知道是騎了很久肌肉疲乏了, 還是真的是陡... 下回還是改騎逆時針好了

2008年6月9日 星期一

荒漠甘泉06092008

「以祂的信實為糧。」(聖經詩篇三十七篇 3 節)   我認識一位婦人,她是做佣工的,生活很艱難;然而她是一個很喜樂的基督徒。有一天,一個善於憂鬱的姊妹問她說: 「現在你固然快樂,可是我替你擔心將來的前途;說來或許會使你傷心。假若你生病了,不能工作了;假若你的東家辭退你了,沒有別人僱用你了;假若....」   「夠了,太太!」她打岔說:「我從來不『假若』的。耶和華是我的牧者,我必不至缺乏。你有了這許多『假若』,自然不會喜樂了。丟棄它們吧,信靠你的神。」   只消兩節聖經,就可以使我們丟棄一切難丟棄的「假若」,如果我們用孩子般簡單的信去接受它們。請讀聖經希伯來書十三章五至六節:「要以自己所有的為足。因為主曾說,我總不撇下你,也不丟棄你。所以我們可以放膽說,主是幫助我的,我必不懼怕,人能把我怎麼樣呢?」 ──(H. W. S.)   高飛天空的鷲鷹,從不罣慮牠將怎樣渡過江河。── 選

2008年6月6日 星期五

荒漠甘泉06062008

「你們要....儆醒禱告。」(聖經彼得前書四章 7 節)

  朋友,不要冒險和世界接觸,如果你還沒有禱告。當你晚上跪下禱告的時候,瞌睡前來壓在你眼瞼上;一天辛苦的工作成了你的託辭,你就縮短你的禱告,從神面前退去休息了。到了早晨,因為起身遲了,一天的工作已經堆在你面前,你又向神通融一下,匆匆促促把晨間最寶貴的交通草率了事。

  你一點都不儆醒禱告!你忽略了儆醒;這樣的忽略能不能補救的呢?不能!

  你不儆醒禱告,是一件何等嚴重的事!試探在你面前,你無法對付。仇敵在前引誘,你無法站住。 四周的壓迫你無法忍耐。和神的交通你無法維持。和同作肢體的生了隔膜,在不信的人前失了見證。 屬靈的能力消失,愛主的心冷淡。做事憑自己的喜好,不憑神的旨意。你會覺得你和神離得非常遙遠。 不禱告一天,等於墮落一天。── 勞勃生(Frederick W. Robertson

  信徒們,不要作無謂的冒險,把儆醒禱告這件事忽略了。神的獨生子耶穌基督尚且需要天未亮即起身禱告,把祂心中的事向神傾倒出來,何況我們呢?

  無禱告的生命,是無能力的生命。──

2008年6月5日 星期四

又被買走了...

公司又被買走了... 好吧, 數數看工作以來的公司...

第一間公司, 2001 年七月加入, 2002 年十月合併另一間公司, 2004 年一月被併購. 一直待待待, 待到 2006 年九月離開; 2006 年九月離開之後到了另一間公司, 待到 2008 年一月; 二月換到現在公司, 結果今天宣佈要被併購...

嗯嗯嗯... 好吧, 只好再看看囉...

2008年6月3日 星期二

sk_buff->cb

閑來無事, 把 Understanding Linux Network Internals 抓來看看, 剛好看到了
sk_buff 這個恐怖的 structure. 其中有個 sk_buff->cb[64] 這個 64 bytes 的
東西, 專門拿來把一些 control information 放進去裡面的, 各層 protocol 都
可以拿來用, 但要小心別互相給蓋掉了...

看一下 definition:

include/linux/skbuff.h:

struct sk_buff {
/* These two members must be first. */
struct sk_buff *next;
struct sk_buff *prev;
:
:
/*
* This is the control buffer. It is free to use for every
* layer. Please put your private variables there. If you
* want to keep them across layers you have to do a skb_clone()
* first. This is owned by whoever has the skb queued ATM.
*/
char cb[64];
:
:
}

再來看一下 TCP layer 裡面有用到的部份...

include/net/tcp.h:

/* This is what the send packet queuing engine uses to pass
* TCP per-packet control information to the transmission
* code. We also store the host-order sequence numbers in
* here too. This is 36 bytes on 32-bit architectures,
* 40 bytes on 64-bit machines, if this grows please adjust
* skbuff.h:skbuff->cb[xxx] size appropriately.
*/
struct tcp_skb_cb {
union {
struct inet_skb_parm h4;
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
struct inet6_skb_parm h6;
#endif
} header; /* For incoming frames */
__u32 seq; /* Starting sequence number */
__u32 end_seq; /* SEQ + FIN + SYN + datalen */
__u32 when; /* used to compute rtt's */
__u8 flags; /* TCP header flags. */

/* NOTE: These must match up to the flags byte in a
* real TCP header.
*/
:
:
__u8 sacked; /* State flags for SACK/FACK. */
:
:

__u16 urg_ptr; /* Valid w/URG flags is set. */
__u32 ack_seq; /* Sequence number ACK'd */
};

#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))

struct inet_skb_parm 是啥鬼捏?

include/net/ip.h:

struct inet_skb_parm
{
struct ip_options opt; /* Compiled IP options
unsigned char flags;
:
:
};

哇靠, 又來一個 struct ip_options...

include/linux/ip.h:

struct ip_options {
__u32 faddr; /* Saved first hop address */
unsigned char optlen;
unsigned char srr;
unsigned char rr;
unsigned char ts;
unsigned char is_setbyuser:1, /* Set by setsockopt?
is_data:1, /* Options in __data, rather th
is_strictroute:1, /* Strict source route
srr_is_hit:1, /* Packet destination addr was
is_changed:1, /* IP checksum more not valid
rr_needaddr:1, /* Need to record addr of outgo
ts_needtime:1, /* Need to record timestamp
ts_needaddr:1; /* Need to record addr of outgo
unsigned char router_alert;
unsigned char __pad1;
unsigned char __pad2;
unsigned char __data[0];
};

Total 大約會用到 36 bytes (32bit machine), or 40 bytes (64bit machine)...

事實上在 protocol layer 裡還有其他幾個地方會用到 skb->cb 的咚咚:

[MVL4 include/net]$ grep "cb\[" *
ipx.h:#define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0]))
llc_conn.h: skb->cb[sizeof(skb->cb) - 1] = type;
llc_conn.h: return skb->cb[sizeof(skb->cb) - 1];
tcp.h: * skbuff.h:skbuff->cb[xxx] size appropriately.
tcp.h:#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))


[MVL4 include/linux]$ grep "cb\[" *
if_vlan.h:#define VLAN_TX_SKB_CB(__skb) ((struct vlan_skb_tx_cookie *)&((__skb)->cb[0]))
if_vlan.h: * Puts the VLAN tag in @skb->cb[] and lets the device do the rest
if_vlan.h: * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[]
if_vlan.h: * Returns error if @skb->cb[] is not set correctly
llc.h:#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))

所以盡量要使用 skb->cb[] 內容的話, 把它給擺在 cb[36] 以後吧, 反正有 64 bytes 可用...

... 這也難怪了... 先前把東西擺在 cb[0] & cb[1], 老是會不見 @_@ 唉啊, 真是沒看清楚啊~~~

likely & unlikely part II

剛剛在 Understanding Linux Network Internals 上看到的, 節錄出來一下以免以後忘了... :p


1.2.9. Compile-Time Optimization for Condition Checks

Most of the time, when the kernel compares a variable against some external value to see whether a given condition is met, the result is extremely likely to be predictable. This is pretty common, for example, with code that enforces sanity checks. The kernel uses the likely and unlikely macros, respectively, to wrap comparisons that are likely to return a true (1) or false (0) result. Those macros take advantage of a feature of the gcc compiler that can optimize the compilation of the code based on that information.

Here is an example. Let's suppose you need to call the do_something function, and that in case of failure, you must handle it with the handle_error function:

err = do_something(x,y,z);
if (err)
handle_error(err);

Under the assumption that do_something rarely fails, you can rewrite the code as follows:

err = do_something(x,y,z);
if (unlikely(err))
handle_error(err);

An example of the optimization made possible by the likely and unlikely macros is in handling options in the IP header. The use of IP options is limited to very specific cases, and the kernel can safely assume that most IP packets do not carry IP options. When the kernel forwards an IP packet, it needs to take care of options according to the rules described in Chapter 18. The last stage of forwarding an IP packet is taken care of by ip_forward_finish. This function uses the unlikely macro to wrap the condition that checks whether there is any IP option to take care of. See the section "ip_forward_finish Function" in Chapter 20.


基本上跟先前的認知是一樣的, 但發覺 ARM, MIPS 跟 PowerPC 用的 GNU crosscompiler 似乎都不會去做這些個 optimization... x86 的就會...