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

Set the kernel as an extra user of SKBs that are sent out. #171

Merged
merged 1 commit into from
Aug 4, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tempesta_fw/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@ ss_send(struct sock *sk, const SsSkbList *skb_list)
SS_DBG("%s:%d entail skb=%p data_len=%u len=%u\n",
__FUNCTION__, __LINE__, skb, skb->data_len, skb->len);

/*
* When SKBs are removed from socket's receive queue and
* passed to Tempesta, control over these SKBs is passed
* from kernel to Tempesta as well. Tempesta becomes the
* sole owner of these SKBs. When these SKBs are sent out
* to a client or a backend by Tempesta, the kernel becomes
* an extra owner of the SKBs in addition to Tempesta.
* To account for that it's necessary to increment SKB's
* count of users so that SKBs are not freed from under
* Tempesta or from under the kernel.
*/
skb_get(skb);

skb_entail(sk, skb);

tcb->end_seq += skb->len;
Expand Down