46 #include <linux/slab.h>
47 #include <linux/types.h>
65 event->msg_flags = msg_flags;
66 event->rmem_len = len;
76 skb = alloc_skb(size, gfp);
80 event = sctp_skb2event(skb);
107 skb = sctp_event2skb(event);
110 sctp_skb_set_owner_r(skb, asoc->
base.sk);
114 static inline void sctp_ulpevent_release_owner(
struct sctp_ulpevent *event)
156 event = sctp_skb2event(skb);
173 skb = sctp_event2skb(event);
245 sctp_ulpevent_set_owner(event, asoc);
276 skb = sctp_event2skb(event);
337 sctp_ulpevent_set_owner(event, asoc);
352 sctp_sk(asoc->
base.sk),
406 event = sctp_skb2event(skb);
460 sctp_ulpevent_set_owner(event, asoc);
498 event = sctp_skb2event(skb);
570 sctp_ulpevent_set_owner(event, asoc);
596 skb = sctp_event2skb(event);
633 sctp_ulpevent_set_owner(event, asoc);
659 skb = sctp_event2skb(event);
667 sctp_ulpevent_set_owner(event, asoc);
697 if (asoc->
ep->rcvbuf_policy)
702 if (rx_count >= asoc->
base.sk->sk_rcvbuf) {
705 (!sk_rmem_schedule(asoc->
base.sk, chunk->
skb,
706 chunk->
skb->truesize)))
742 event = sctp_skb2event(skb);
750 sctp_ulpevent_receive_data(event, asoc);
757 event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->
peer.tsn_map);
760 event->msg_flags |= chunk->
chunk_hdr->flags;
792 skb = sctp_event2skb(event);
823 sctp_ulpevent_set_owner(event, asoc);
844 skb = sctp_event2skb(event);
859 sctp_ulpevent_set_owner(event, asoc);
883 skb = sctp_event2skb(event);
890 sctp_ulpevent_set_owner(event, asoc);
904 skb = sctp_event2skb(event);
991 static void sctp_ulpevent_receive_data(
struct sctp_ulpevent *event,
996 skb = sctp_event2skb(event);
998 sctp_ulpevent_set_owner(event, asoc);
1010 skb_walk_frags(skb, frag)
1011 sctp_ulpevent_receive_data(sctp_skb2event(frag), asoc);
1029 skb = sctp_event2skb(event);
1036 skb_walk_frags(skb, frag) {
1041 sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
1046 sctp_ulpevent_release_owner(event);
1049 static void sctp_ulpevent_release_frag_data(
struct sctp_ulpevent *event)
1053 skb = sctp_event2skb(event);
1059 skb_walk_frags(skb, frag) {
1064 sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
1068 sctp_ulpevent_release_owner(event);
1078 sctp_ulpevent_release_owner(event);
1080 sctp_ulpevent_release_data(event);
1089 unsigned int data_unread = 0;
1095 data_unread += skb->
len;