Bug 188421

Summary: [libnetgraph] [patch] ng_callout() timeouts trigger packets queuing and out of order packets
Product: Base System Reporter: fodillemlinkarim
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me Keywords: patch
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.txt none

Description fodillemlinkarim 2014-04-10 14:30:00 UTC
I have seen an issue in netgraph
where, if called, a callout routine registered by ng_callout() will trigger
packet queuing inside the worklist of netgraph since ng_callout() makes my
node suddenly a WRITER node (therefore non reentrant) for the duration of
the call.

So as soon as the callout function returns, all following packets will get
directly passed to the node again and when the ngintr thread gets executed
then only then will I get the queued packets. This introduces out of order
packets in the flow. I am using the current patch below to solve the issue
and I am wondering if there is anything wrong with it (and maybe contribute
back :).

Fix: Use the provided patch.

Patch attached with submission follows:
How-To-Repeat: Have a constant stream of packets sent to a netgraph node. The node must at
some point have registered a timeout function. Lets have it exceute every
10 miliseconds. Track the order (looking at ip id) of the packets as they
come out. You should see out of order packets whenever the callout function
is called.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-04-16 02:36:26 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

reclassify.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:29 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:35:45 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>