linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 178241] New: tcp.7 says SIOCOUTQ counts unsent bytes, but in actually counts unacknowledged bytes
@ 2016-10-18  8:13 bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
  0 siblings, 0 replies; only message in thread
From: bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r @ 2016-10-18  8:13 UTC (permalink / raw)
  To: linux-man-u79uwXL29TY76Z2rM5mHXA

https://bugzilla.kernel.org/show_bug.cgi?id=178241

            Bug ID: 178241
           Summary: tcp.7 says SIOCOUTQ counts unsent bytes, but in
                    actually counts unacknowledged bytes
           Product: Documentation
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: man-pages
          Assignee: documentation_man-pages-ztI5WcYan/vQLgFONoPN62D2FQJk+8+b@public.gmane.org
          Reporter: njs-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org
        Regression: No

tcp.7 says:

       SIOCOUTQ
              Returns the amount of unsent data in the socket send queue. [...]

I believe that this is incorrect, and that it actually returns the amount of
*unacknowledged* data in the socket send queue (i.e., unsent data + data that
has been sent, but for which we're still waiting for an ACK).

This can be confirmed by looking at the source, which does:

575                         answ = tp->write_seq - tp->snd_una;

http://lxr.free-electrons.com/source/net/ipv4/tcp.c#L568

here tp->snd_una is the boundary between acknowledged and unacknowledged data.
If it were reporting unsent data, it would need to use tp->snd_nxt instead.
(The diagram in RFC 793 may help visualize this:
https://tools.ietf.org/html/rfc793#page-20)

I discovered this while trying to figure out how TCP_NOTSENT_LOWAT works.
TCP_NOTSENT_LOWAT makes it so that a socket only becomes writeable if the
unsent data is under a certain threshold, yet SIOCOUTQ was reporting that I had
more unsent data than that, and yet the socket was still writeable... which
makes sense if SIOCOUTQ is not actually reporting the amount of unsent data
:-).

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-18  8:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18  8:13 [Bug 178241] New: tcp.7 says SIOCOUTQ counts unsent bytes, but in actually counts unacknowledged bytes bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).