Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1189: correctly fill header part of skb when writing data into p… #1209

Merged
merged 4 commits into from
Mar 26, 2019

Conversation

vankoven
Copy link
Contributor

@vankoven vankoven commented Mar 11, 2019

…aged fragments

See commit messages for the changes descriptions.

Copy link
Contributor

@krizhanovsky krizhanovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made only high level review and a more accurate reviews about the frags and skb lists is required. I don't like the idea not to use skb head for big messages.

Please also backport the fixes to release-0.6.

if (!skb)
return -ENOMEM;
alloc_ldata = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no sense to generate more skbs if we can generate less. skb it self has large memory overhead and TCP segmentation also wins from larger skbs. It seems we can just resent it->frag to -1 instead of 0 to fix #1189.

f_room = skb_tailroom(it->skb);
n_copy = min(c_size, f_room);
p = skb_put(it->skb, n_copy);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy&paste from tfw_msg_write() - can we reuse the code, e.g. by moving some of the code to a helper function?

…aged fragments

ss_skb_frag_next() is always work with TfwMsgIter, so renamed and moved
into msg.h, the whole TfwMsgIter became invalid if the function fails.
* add a new function, to allocate and add a new empty skb to current
message iterator.
* fix dereferences of invalid pointers in tfw_cache_build_resp_body():
it->frag may be equal to -1.
@vankoven vankoven force-pushed the ik-fill-all-skb-frags branch from cdaf090 to 6b5e2c0 Compare March 14, 2019 13:49
Copy link
Contributor

@i-rinat i-rinat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Contributor

@krizhanovsky krizhanovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants