w*s 发帖数: 7227 | 1 【 以下文字转载自 Programming 讨论区 】
发信人: wds (净洗前尘,从头再来), 信区: Programming
标 题: How to split sk_buf into 2
发信站: BBS 未名空间站 (Thu Feb 2 18:33:27 2012, 美东)
in linux networking, i want to split 5000 byte data into 2,
4000 bytes and 1000 bytes,
will the following work ? assuming skb is the original skb passed in.
skb1 = netdev_alloc_skb(lp->dev, needed-4000); // create an new skb
skb_split(skb, skb1, 4000/4); // 4000 bytes is 1000 u32
skb_queue_tail(&lp->txq, skb);
skb_queue_tail(&lp->txq, skb1); |
|