Skip to content

Commit

Permalink
Fix __extend_pgfrags function.
Browse files Browse the repository at this point in the history
We should adjust count of skb fragments even if
`tail_frags` is equal to zero.
Also remove unnecessary linear transformation
during making frames.
  • Loading branch information
EvgeniiMekhanik committed Jun 27, 2024
1 parent 1d07dc5 commit 96fb92d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 0 additions & 8 deletions fw/http_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,14 +1932,6 @@ tfw_h2_insert_frame_header(struct sock *sk, TfwH2Ctx *ctx, TfwStream *stream,
char *data;
int r;

if (unlikely(type == HTTP2_DATA
&& skb_headlen(stream->xmit.skb_head)))
{
if ((r = tfw_http_msg_linear_transform(&it)))
return r;
stream->xmit.skb_head = it.skb_head;
}

data = ss_skb_data_ptr_by_offset(stream->xmit.skb_head,
stream->xmit.frame_length);
if(unlikely(!data))
Expand Down
4 changes: 3 additions & 1 deletion fw/ss_skb.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ __extend_pgfrags(struct sk_buff *skb_head, struct sk_buff *skb, int from, int n)

/* No fragments to shift. */
if (!tail_frags)
return 0;
goto finish;

/*
* Move @n_excess number of page fragments to new SKB. We
Expand Down Expand Up @@ -262,6 +262,8 @@ __extend_pgfrags(struct sk_buff *skb_head, struct sk_buff *skb, int from, int n)
if (n_shift > 0)
memmove(&si->frags[from + n],
&si->frags[from], n_shift * sizeof(skb_frag_t));

finish:
si->nr_frags += n - n_excess;

return 0;
Expand Down

0 comments on commit 96fb92d

Please sign in to comment.