so return 1 and requeue this packet.6*/78spin_unlock_irq(&lp->lock);9if(net_debug) printk("cs89x0: Tx buffer not free!\n");10//当检测到网卡暂时无法发送数据时,会直接return 1,而没有调dev_kfree_skb (skb)。11
3940/*分配长度+ skb_shared_info长度*/41len += SKB_DATA_ALIGN(sizeof(structskb_shared_info));42/*对整个长度进行对齐*/43len =SKB_DATA_ALIGN(len);4445if(sk_memalloc_socks())46gfp_mask |=__GFP_MEMALLOC;4748/*保存中断*/49local_irq_save(flags);5051nc = this_cpu_ptr(&netdev_alloc_...
__skb_linearize(skb)) goto out_kfree_skb; /* 如果此包的校验和还没有计算并且驱动不支持硬件校验和计算,那么需要在这里计算校验和*/ if (skb->ip_summed == CHECKSUM_PARTIAL) { skb_set_transport_header(skb, skb->csum_start - skb_headroom(skb)); if (!dev_can_checksum(dev, skb) && skb...
__skb_linearize(skb)) goto out_kfree_skb; /* 如果此包的校验和还没有计算并且驱动不支持硬件校验和计算,那么需要在这里计算校验和*/ if (skb->ip_summed == CHECKSUM_PARTIAL) { skb_set_transport_header(skb, skb->csum_start - skb_headroom(skb)); if (!dev_can_checksum(dev, skb) && skb...
… context If a driver calls can_get_echo_skb() during a hardware IRQ (which is often, but not always, the case), the 'WARN_ON(in_irq)' in net/core/skbuff.c#skb_release_head_state() might be triggered, under network congestion circumstances, together with the potential risk of a NU...
Linux发送函数dev_queue_xmit分析 Linux发送函数dev_queue_xmit分析当上层准备好⼀个包之后,交给下⾯这个函数处理
+ dev_kfree_skb(dev->rx_skb_pool[i]); } static void rx_fixup(unsigned long data) @@ -946,8 +945,7 @@ static void rtl8150_disconnect(struct usb_interface *intf) unlink_all_urbs(dev); free_all_urbs(dev); free_skb_pool(dev); ...
116.out_kfree_skb: 117.kfree_skb(skb); 118.return rc; 119.out: 120.rcu_read_unlock_bh(); 121.return rc; 122.} 从此函数可以看出,当驱动使用发送队列的时候会循环从队列中取出包发送 而不使用队列的时候只发送一次,如果没发送成功就直接丢弃 ...
kfree_skb(skb); return err; } if (unlikely(err)) goto drop; local_bh_disable(); dst = dst_cache_get(&rlwt->cache); @@ -286,9 +284,13 @@ static int rpl_input(struct sk_buff *skb) err = skb_cow_head(skb, LL_RESERVED_SPACE(dst->dev)); if (unlikely(err)) return err;...
Replace dev_kfree_skb with dev_kfree_skb_any in functions that can be called in hard irq and other contexts. Signed-off-by: "Eric W. Biederman" <ebied...@xmission.com> Signed-off-by: David S. Miller <da...@davemloft.net> ...