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 #984 #1161

Merged
merged 15 commits into from
Jan 28, 2019
Merged

Fix #984 #1161

merged 15 commits into from
Jan 28, 2019

Conversation

krizhanovsky
Copy link
Contributor

Original PR is #1155 plus fixed code review comments and added fix of TSO segments. All the comments were addressed except #1155 (comment) - see motivation under the comment.

krizhanovsky and others added 7 commits January 6, 2019 20:16
less bytes than the TLS overhead as well as allocate an extra skb.
1. @nsize was copy&pasted from tcp_fragment(), but the last one uses it only
   for fast path with skb w/o frags.

2. reserved_tailroom is in union with mark which we process separately, so the
   field isn't compatible with current Tempesta code. Also it's used for egress
   path only and we don't need it on ingress path where ss_skb_split() is called.

3. GSO segementation for skb wasn't accounted: make couple of comments in TLS
   code and initialize it for split skb. (Later kernel patch will bring small
   logic on it as well.)

Some cleanups. -jN builds sometetimes still fail in libtdb/tdbq dependence
(see commit 1fc007d).
1. accurately fix skb->truesize and TCP write memory in kernel
   by tcp_skb_unclone();

2. __split_pgfrag_del() if we just move pointers, then we do not free
   TCP write memory, so do not change skb->truesize.

3. ss_skb_unroll(): truesize and data_len/len are completely different counters,
   so do not mix them in ss_skb_adjust_data_len(). By the way, during the tests
   I saw crazy skb overheads - truesize can be larger than len in tens kilobytes.
   The explanation for such overheads is various fragments stoling (e.g. our
   __split_pgfrag_del) and cloning.

4. cleanup: move ss_skb coalescing functions closer to their calls.
* set TSO segs to proper value on next iteration.
*/
t_sz = skb_tail->next->truesize;

Copy link
Contributor

Choose a reason for hiding this comment

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

Extra empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I separated the lines to make the comment above relating to the line only.

@@ -350,7 +350,7 @@ ss_do_send(struct sock *sk, struct sk_buff **skb_head, int flags)
int size, mss = tcp_send_mss(sk, &size, MSG_DONTWAIT);
unsigned int mark = (*skb_head)->mark;

TFW_DBG3("[%d]: %s: sk=%p queue_empty=%d send_head=%p"
TFW_DBG3("[%d]: %s: sk=%pK queue_empty=%d send_head=%pK"
Copy link
Contributor

Choose a reason for hiding this comment

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

The year in the copyright notice isn't updated in the file. Can we just bump the year in all the sources just to forget about the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just didn't update copyright for the very small changes. I think at the end it's not a problem at all if you just forget to update a copyright - if you or a reviewer recall this, then just update the copyright, otherwise if you forget - not a big deal.

Copy link
Contributor

@aleksostapenko aleksostapenko left a comment

Choose a reason for hiding this comment

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

Nothing to add. Looks good to me.

krizhanovsky and others added 8 commits January 28, 2019 21:33
less bytes than the TLS overhead as well as allocate an extra skb.
1. @nsize was copy&pasted from tcp_fragment(), but the last one uses it only
   for fast path with skb w/o frags.

2. reserved_tailroom is in union with mark which we process separately, so the
   field isn't compatible with current Tempesta code. Also it's used for egress
   path only and we don't need it on ingress path where ss_skb_split() is called.

3. GSO segementation for skb wasn't accounted: make couple of comments in TLS
   code and initialize it for split skb. (Later kernel patch will bring small
   logic on it as well.)

Some cleanups. -jN builds sometetimes still fail in libtdb/tdbq dependence
(see commit 1fc007d).
1. accurately fix skb->truesize and TCP write memory in kernel
   by tcp_skb_unclone();

2. __split_pgfrag_del() if we just move pointers, then we do not free
   TCP write memory, so do not change skb->truesize.

3. ss_skb_unroll(): truesize and data_len/len are completely different counters,
   so do not mix them in ss_skb_adjust_data_len(). By the way, during the tests
   I saw crazy skb overheads - truesize can be larger than len in tens kilobytes.
   The explanation for such overheads is various fragments stoling (e.g. our
   __split_pgfrag_del) and cloning.

4. cleanup: move ss_skb coalescing functions closer to their calls.
@krizhanovsky krizhanovsky merged commit ef02fd1 into master Jan 28, 2019
@krizhanovsky krizhanovsky deleted the ak-984 branch January 28, 2019 18:46
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.

3 participants