Loading net/dccp/ackvec.c +10 −14 Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) { struct dccp_sock *dp = dccp_sk(sk); #ifdef CONFIG_IP_DCCP_DEBUG const char *debug_prefix = dp->dccps_role == DCCP_ROLE_CLIENT ? "CLIENT tx: " : "server tx: "; #endif struct dccp_ackvec *av = dp->dccps_hc_rx_ackvec; int len = av->dccpav_vec_len + 2; struct timeval now; Loading Loading @@ -90,21 +94,13 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) return -1; } struct dccp_ackvec *dccp_ackvec_alloc(const unsigned int len, const gfp_t priority) struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) { struct dccp_ackvec *av; BUG_ON(len == 0); if (len > DCCP_MAX_ACKVEC_LEN) return NULL; struct dccp_ackvec *av = kmalloc(sizeof(*av), priority); av = kmalloc(sizeof(*av) + len, priority); if (av != NULL) { av->dccpav_buf_len = len; av->dccpav_buf_head = av->dccpav_buf_tail = av->dccpav_buf_len - 1; av->dccpav_buf_tail = DCCP_MAX_ACKVEC_LEN - 1; av->dccpav_buf_ackno = av->dccpav_ack_ackno = av->dccpav_ack_seqno = ~0LLU; av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0; Loading Loading @@ -146,7 +142,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, unsigned int gap; long new_head; if (av->dccpav_vec_len + packets > av->dccpav_buf_len) if (av->dccpav_vec_len + packets > DCCP_MAX_ACKVEC_LEN) return -ENOBUFS; gap = packets - 1; Loading @@ -158,7 +154,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, gap + new_head + 1); gap = -new_head; } new_head += av->dccpav_buf_len; new_head += DCCP_MAX_ACKVEC_LEN; } av->dccpav_buf_head = new_head; Loading Loading @@ -251,7 +247,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, goto out_duplicate; delta -= len + 1; if (++index == av->dccpav_buf_len) if (++index == DCCP_MAX_ACKVEC_LEN) index = 0; } } Loading net/dccp/ackvec.h +3 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ * (HC-Sender seqno) * @dccpav_ack_nonce - the one-bit sum of the ECN Nonces for all State 0. * * @dccpav_buf_len - circular buffer length * @dccpav_time - the time in usecs * @dccpav_buf - circular buffer of acknowledgeable packets */ Loading @@ -63,18 +62,16 @@ struct dccp_ackvec { u8 dccpav_ack_ptr; u8 dccpav_sent_len; u8 dccpav_vec_len; u8 dccpav_buf_len; u8 dccpav_buf_nonce; u8 dccpav_ack_nonce; u8 dccpav_buf[0]; u8 dccpav_buf[DCCP_MAX_ACKVEC_LEN]; }; struct sock; struct sk_buff; #ifdef CONFIG_IP_DCCP_ACKVEC extern struct dccp_ackvec *dccp_ackvec_alloc(unsigned int len, const gfp_t priority); extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); extern void dccp_ackvec_free(struct dccp_ackvec *av); extern int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, Loading @@ -92,8 +89,7 @@ static inline int dccp_ackvec_pending(const struct dccp_ackvec *av) return av->dccpav_sent_len != av->dccpav_vec_len; } #else /* CONFIG_IP_DCCP_ACKVEC */ static inline struct dccp_ackvec *dccp_ackvec_alloc(unsigned int len, const gfp_t priority) static inline struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) { return NULL; } Loading net/dccp/ipv4.c +1 −2 Original line number Diff line number Diff line Loading @@ -1042,8 +1042,7 @@ int dccp_v4_init_sock(struct sock *sk) do_gettimeofday(&dp->dccps_epoch); if (dp->dccps_options.dccpo_send_ack_vector) { dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(DCCP_MAX_ACKVEC_LEN, GFP_KERNEL); dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(GFP_KERNEL); if (dp->dccps_hc_rx_ackvec == NULL) return -ENOMEM; } Loading net/dccp/minisocks.c +1 −2 Original line number Diff line number Diff line Loading @@ -116,8 +116,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk, if (newdp->dccps_options.dccpo_send_ack_vector) { newdp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(DCCP_MAX_ACKVEC_LEN, GFP_ATOMIC); dccp_ackvec_alloc(GFP_ATOMIC); /* * XXX: We're using the same CCIDs set on the parent, * i.e. sk_clone copied the master sock and left the Loading Loading
net/dccp/ackvec.c +10 −14 Original line number Diff line number Diff line Loading @@ -20,6 +20,10 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) { struct dccp_sock *dp = dccp_sk(sk); #ifdef CONFIG_IP_DCCP_DEBUG const char *debug_prefix = dp->dccps_role == DCCP_ROLE_CLIENT ? "CLIENT tx: " : "server tx: "; #endif struct dccp_ackvec *av = dp->dccps_hc_rx_ackvec; int len = av->dccpav_vec_len + 2; struct timeval now; Loading Loading @@ -90,21 +94,13 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) return -1; } struct dccp_ackvec *dccp_ackvec_alloc(const unsigned int len, const gfp_t priority) struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) { struct dccp_ackvec *av; BUG_ON(len == 0); if (len > DCCP_MAX_ACKVEC_LEN) return NULL; struct dccp_ackvec *av = kmalloc(sizeof(*av), priority); av = kmalloc(sizeof(*av) + len, priority); if (av != NULL) { av->dccpav_buf_len = len; av->dccpav_buf_head = av->dccpav_buf_tail = av->dccpav_buf_len - 1; av->dccpav_buf_tail = DCCP_MAX_ACKVEC_LEN - 1; av->dccpav_buf_ackno = av->dccpav_ack_ackno = av->dccpav_ack_seqno = ~0LLU; av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0; Loading Loading @@ -146,7 +142,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, unsigned int gap; long new_head; if (av->dccpav_vec_len + packets > av->dccpav_buf_len) if (av->dccpav_vec_len + packets > DCCP_MAX_ACKVEC_LEN) return -ENOBUFS; gap = packets - 1; Loading @@ -158,7 +154,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, gap + new_head + 1); gap = -new_head; } new_head += av->dccpav_buf_len; new_head += DCCP_MAX_ACKVEC_LEN; } av->dccpav_buf_head = new_head; Loading Loading @@ -251,7 +247,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, goto out_duplicate; delta -= len + 1; if (++index == av->dccpav_buf_len) if (++index == DCCP_MAX_ACKVEC_LEN) index = 0; } } Loading
net/dccp/ackvec.h +3 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ * (HC-Sender seqno) * @dccpav_ack_nonce - the one-bit sum of the ECN Nonces for all State 0. * * @dccpav_buf_len - circular buffer length * @dccpav_time - the time in usecs * @dccpav_buf - circular buffer of acknowledgeable packets */ Loading @@ -63,18 +62,16 @@ struct dccp_ackvec { u8 dccpav_ack_ptr; u8 dccpav_sent_len; u8 dccpav_vec_len; u8 dccpav_buf_len; u8 dccpav_buf_nonce; u8 dccpav_ack_nonce; u8 dccpav_buf[0]; u8 dccpav_buf[DCCP_MAX_ACKVEC_LEN]; }; struct sock; struct sk_buff; #ifdef CONFIG_IP_DCCP_ACKVEC extern struct dccp_ackvec *dccp_ackvec_alloc(unsigned int len, const gfp_t priority); extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority); extern void dccp_ackvec_free(struct dccp_ackvec *av); extern int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, Loading @@ -92,8 +89,7 @@ static inline int dccp_ackvec_pending(const struct dccp_ackvec *av) return av->dccpav_sent_len != av->dccpav_vec_len; } #else /* CONFIG_IP_DCCP_ACKVEC */ static inline struct dccp_ackvec *dccp_ackvec_alloc(unsigned int len, const gfp_t priority) static inline struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) { return NULL; } Loading
net/dccp/ipv4.c +1 −2 Original line number Diff line number Diff line Loading @@ -1042,8 +1042,7 @@ int dccp_v4_init_sock(struct sock *sk) do_gettimeofday(&dp->dccps_epoch); if (dp->dccps_options.dccpo_send_ack_vector) { dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(DCCP_MAX_ACKVEC_LEN, GFP_KERNEL); dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(GFP_KERNEL); if (dp->dccps_hc_rx_ackvec == NULL) return -ENOMEM; } Loading
net/dccp/minisocks.c +1 −2 Original line number Diff line number Diff line Loading @@ -116,8 +116,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk, if (newdp->dccps_options.dccpo_send_ack_vector) { newdp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(DCCP_MAX_ACKVEC_LEN, GFP_ATOMIC); dccp_ackvec_alloc(GFP_ATOMIC); /* * XXX: We're using the same CCIDs set on the parent, * i.e. sk_clone copied the master sock and left the Loading