Page MenuHomeFreeBSD

Stop leaking mbuf tags during LRO.
ClosedPublic

Authored by np on Jun 2 2015, 7:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 18, 5:17 AM
Unknown Object (File)
Sat, Jan 11, 5:30 PM
Unknown Object (File)
Wed, Jan 8, 8:19 PM
Unknown Object (File)
Dec 13 2024, 10:54 AM
Unknown Object (File)
Dec 12 2024, 12:00 PM
Unknown Object (File)
Dec 8 2024, 10:02 AM
Unknown Object (File)
Nov 29 2024, 6:29 PM
Unknown Object (File)
Nov 26 2024, 8:25 AM
Subscribers

Details

Summary

tcp_lro_rx must free the tags that might be associated with the header
mbuf before it is demoted to an ordinary (not packet header) mbuf.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

np retitled this revision from to Stop leaking mbuf tags during LRO..
np updated this object.
np edited the test plan for this revision. (Show Details)
np added a reviewer: network.

I'd rather we had an m_ function that did the downgrade of pkthdr->no-pkthdr and did the tidyup, like deleting mbuf chain.

That way we can use it everywhere consistently, add assertions, etc.

In D2708#51299, @adrian wrote:

I'd rather we had an m_ function that did the downgrade of pkthdr->no-pkthdr and did the tidyup, like deleting mbuf chain.

That way we can use it everywhere consistently, add assertions, etc.

There is an m_demote() but I thought it would be a bit heavyweight for tcp_lro_rx. We already know m in tcp_lro_rx is a header mbuf, and we don't want to spend time looking at any m->m_next linked mbufs. Maybe I should add this in mbuf.h next to m_demote?

void
m_demote_hdr(struct mbuf *m)
{
M_ASSERTPKTHDR(m);
m_tag_delete_chain(m, NULL);
m->m_flags &= ~M_PKTHDR;
}

Add a generic m_demote_hdr.

I'll build and test with this updated patch. The bzero in
m_demote/m_demote_hdr should perhaps be for kernel with INVARIANTS only.
I'll leave that alone for now.

Use _pkthdr as the suffix as there are existing routines (m_copy_pkthdr,
m_dup_pkthdr, more?) that use _pkthdr and not _hdr.

Add a few assertions in tcp_lro_rx.

adrian added a reviewer: adrian.
This revision is now accepted and ready to land.Jun 2 2015, 5:39 PM
np edited edge metadata.

Final version. Now I'll wait for reviews.

This revision now requires review to proceed.Jun 2 2015, 5:49 PM
hiren added a reviewer: hiren.
hiren added a subscriber: hiren.

Good catch and fix.

This revision is now accepted and ready to land.Jun 3 2015, 7:46 PM
ae added a reviewer: ae.
This revision was automatically updated to reflect the committed changes.