- 論壇徽章:
- 0
|
本帖最后由 fly6 于 2011-06-13 15:10 編輯
3.jpg (157.91 KB, 下載次數(shù): 30)
下載附件
2011-06-13 15:10 上傳
我改寫了流控的sch_tbf.c模塊,以支持每IP限速,為了記錄下每個(gè)IP的令牌使用情況,需要一個(gè)數(shù)組(>128K),數(shù)據(jù)結(jié)構(gòu)如下:
struct tbf_node_data
{
struct sk_buff_head skqueue;
unsigned long last_time;
long tokens;
long up_tokens;
psched_time_t t_c;
psched_time_t up_t_c;
};
#define TBF_IP_POOL_SIZE 4096
在tbf_change中,q->varray= vmalloc(sizeof(struct tbf_node_data)*TBF_IP_POOL_SIZE);
在tbf_destroy中,使用vfree(q->varray),此時(shí)出錯(cuò),雖然tbf的主要代碼運(yùn)行在bottom half下,但我用TC刪除規(guī)則時(shí)應(yīng)該不會在bottom half空間,
請教高手為何會出錯(cuò) |
|