void eemcs_boot_trace_out(EEMCS_BOOT_TRACE_OUT_TYPE type) { #ifdef _EEMCS_TRACE_SUPPORT struct sk_buff *first = NULL; struct sk_buff *next = NULL; if (type < START_OF_TRA_TYPE || type >= END_OF_TRA_TYPE) return ; if (!eemcs_trace_inst.inited) return ; if (!skb_queue_empty(&eemcs_trace_inst.log_skb_list)) { first = skb_peek(&eemcs_trace_inst.log_skb_list); if (first != NULL) { _eemcs_trace_out(first, type, NULL); while (!skb_queue_is_last(&eemcs_trace_inst.log_skb_list, first)) { next = skb_queue_next(&eemcs_trace_inst.log_skb_list, first); _eemcs_trace_out(next, type, NULL); first = next; } } } #endif // _EEMCS_TRACE_SUPPORT }
/* Does 'skb' fits after 'here' in the queue 'head' ? * If yes, we queue it and return 1 */ static int mptcp_ofo_queue_after(struct sk_buff_head *head, struct sk_buff *skb, struct sk_buff *here) { u32 seq = TCP_SKB_CB(skb)->seq; u32 end_seq = TCP_SKB_CB(skb)->end_seq; /* We want to queue skb after here, thus seq >= end_seq */ if (before(seq, TCP_SKB_CB(here)->end_seq)) return 0; /* If here is the last one, we can always queue it */ if (skb_queue_is_last(head, here)) { __skb_queue_after(head, here, skb); return 1; } else { struct sk_buff *skb1 = skb_queue_next(head, here); /* It's not the last one, but does it fits between 'here' and * the one after 'here' ? Thus, does end_seq <= after_here->seq */ if (!after(end_seq, TCP_SKB_CB(skb1)->seq)) { __skb_queue_after(head, here, skb); return 1; } } return 0; }
static int boot_trace_print(struct seq_file *s, void *data) { struct sk_buff *first = NULL; struct sk_buff *next = NULL; if (!skb_queue_empty(&eemcs_trace_inst.log_skb_list)) { first = skb_peek(&eemcs_trace_inst.log_skb_list); if (first != NULL) { _eemcs_trace_out(first, OUT_TYPE_ALL, s); while (!skb_queue_is_last(&eemcs_trace_inst.log_skb_list, first)) { next = skb_queue_next(&eemcs_trace_inst.log_skb_list, first); _eemcs_trace_out(next, OUT_TYPE_ALL, s); first = next; } } } return 0; }