-
Notifications
You must be signed in to change notification settings - Fork 9
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
mblk leak replace_headers #158
Comments
After spending some time working on a solution to have up-front buffer allocation and make use of While working on this I realized the real issue at the moment is a simple memory leak in Anyways, here is the mdb findleaks report for posterity:
|
Tested by running iperf3 between guests and verifying memory usage stayed consistent.
Addressed in 1245055. |
Sometimes, when running iperf3 between two guests running in a virtual sled (as setup by my locally modified testbed opte-ddm-x2), I'll manage to hit a panic where we try to dereference a NULL pointer in
Packet::emit_headers()
.Looking at a bit of the disassembly context we gain a bit more insight as to what is happening.
Remember, a function returns via eax/rax, thus we are trying to deref
b_wptr
on the returnedmblk_t
; butallocb()
returnedNULL
(which it is well within its rights to do). This corresponds with the following OPTE code, which itself is trying to write out the new outer + inner headers to a new mblk, which it then links to the front of the existing packet.As you can see there is no check for a NULL return.
At some point, the idea is to have a way to negotiate a "prefix margin" with the client, allowing OPTE to write the new headers to the existing
mblk_t
, thus avoiding additional allocation. However, a good interim step is to have OPTE perform upfront allocation of mblks for the purpose of prefixing headers. OPTE will need this capability regardless, as even in a future where OPTE can negotiate a prefix margin with the clilent, the client may decide it doesn't want to provide said margin, or may not be able to provide the amount of margin required.The text was updated successfully, but these errors were encountered: