出现问题时的反汇编为:
/usr/src/debug/kernel-4.1.44-.aarch64/net/core/dev.c: 1780
0xffff800000860724 <__netif_receive_skb_core+420>: ldr x0, [x1,x0]
0xffff800000860728 <__netif_receive_skb_core+424>: str x0, [x29,#128]
0xffff80000086072c <__netif_receive_skb_core+428>: ldr x20, [x29,#128]
0xffff800000860730 <__netif_receive_skb_core+432>: cmp x25, x20
0xffff800000860734 <__netif_receive_skb_core+436>: sub x20, x20, #0x28
0xffff800000860738 <__netif_receive_skb_core+440>: b.eq 0xffff800000860760 <__netif_receive_skb_core+480>
/usr/src/debug/kernel-4.1.44-.aarch64/net/core/dev.c: 1781
0xffff80000086073c <__netif_receive_skb_core+444>: ldrh w0, [x20]
代码为:
static inline void deliver_ptype_list_skb(struct sk_buff *skb, struct packet_type **pt, struct net_device *orig_dev, __be16 type, struct list_head *ptype_list) { struct packet_type *ptype, *pt_prev = *pt; 1780 list_for_each_entry_rcu(ptype, ptype_list, list) { 1781 if (ptype->type != type) continue; if (pt_prev) deliver_skb(skb, pt_prev, orig_dev); pt_prev = ptype; } *pt = pt_prev; }
list_for_each_entry_rcu函数为:
#define list_for_each_entry_rcu(pos, head, member) for (pos = list_entry_rcu((head)->next, typeof(*pos), member); &pos->member != (head); pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
list_entry_rcu为:
#define list_entry_rcu(ptr, type, member) ({ typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); })
container_of
#define container_of(ptr, type, member) ({ const typeof( ((type *)0)->member ) *__mptr = (ptr); (type *)( (char *)__mptr - offsetof(type,member) );})