summaryrefslogtreecommitdiffstats
path: root/usr.bin/bluetooth
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-11-30 12:52:33 +0000
committerglebius <glebius@FreeBSD.org>2014-11-30 12:52:33 +0000
commit25da94eb3ed654f7181ce453c6c5cc7e77d38133 (patch)
tree6aca46c356e9150741198b08512009a1b5138ca0 /usr.bin/bluetooth
parentc85f514c6e5d4847bf79f47d5ca098ce086a4c26 (diff)
downloadFreeBSD-src-25da94eb3ed654f7181ce453c6c5cc7e77d38133.zip
FreeBSD-src-25da94eb3ed654f7181ce453c6c5cc7e77d38133.tar.gz
Merge from projects/sendfile:
o Introduce a notion of "not ready" mbufs in socket buffers. These mbufs are now being populated by some I/O in background and are referenced outside. This forces following implications: - An mbuf which is "not ready" can't be taken out of the buffer. - An mbuf that is behind a "not ready" in the queue neither. - If sockbet buffer is flushed, then "not ready" mbufs shouln't be freed. o In struct sockbuf the sb_cc field is split into sb_ccc and sb_acc. The sb_ccc stands for ""claimed character count", or "committed character count". And the sb_acc is "available character count". Consumers of socket buffer API shouldn't already access them directly, but use sbused() and sbavail() respectively. o Not ready mbufs are marked with M_NOTREADY, and ready but blocked ones with M_BLOCKED. o New field sb_fnrdy points to the first not ready mbuf, to avoid linear search. o New function sbready() is provided to activate certain amount of mbufs in a socket buffer. A special note on SCTP: SCTP has its own sockbufs. Unfortunately, FreeBSD stack doesn't yet allow protocol specific sockbufs. Thus, SCTP does some hacks to make itself compatible with FreeBSD: it manages sockbufs on its own, but keeps sb_cc updated to inform the stack of amount of data in them. The new notion of "not ready" data isn't supported by SCTP. Instead, only a mechanical substitute is done: s/sb_cc/sb_ccc/. A proper solution would be to take away struct sockbuf from struct socket and allow protocols to implement their own socket buffers, like SCTP already does. This was discussed with rrs@. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Diffstat (limited to 'usr.bin/bluetooth')
-rw-r--r--usr.bin/bluetooth/btsockstat/btsockstat.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/bluetooth/btsockstat/btsockstat.c b/usr.bin/bluetooth/btsockstat/btsockstat.c
index f63ee1f..20f4de8 100644
--- a/usr.bin/bluetooth/btsockstat/btsockstat.c
+++ b/usr.bin/bluetooth/btsockstat/btsockstat.c
@@ -255,8 +255,8 @@ hcirawpr(kvm_t *kvmd, u_long addr)
(unsigned long) pcb.so,
(unsigned long) this,
pcb.flags,
- so.so_rcv.sb_cc,
- so.so_snd.sb_cc,
+ so.so_rcv.sb_ccc,
+ so.so_snd.sb_ccc,
pcb.addr.hci_node);
}
} /* hcirawpr */
@@ -303,8 +303,8 @@ l2caprawpr(kvm_t *kvmd, u_long addr)
"%-8lx %-8lx %6d %6d %-17.17s\n",
(unsigned long) pcb.so,
(unsigned long) this,
- so.so_rcv.sb_cc,
- so.so_snd.sb_cc,
+ so.so_rcv.sb_ccc,
+ so.so_snd.sb_ccc,
bdaddrpr(&pcb.src, NULL, 0));
}
} /* l2caprawpr */
@@ -361,8 +361,8 @@ l2cappr(kvm_t *kvmd, u_long addr)
fprintf(stdout,
"%-8lx %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n",
(unsigned long) this,
- so.so_rcv.sb_cc,
- so.so_snd.sb_cc,
+ so.so_rcv.sb_ccc,
+ so.so_snd.sb_ccc,
bdaddrpr(&pcb.src, local, sizeof(local)),
pcb.psm,
bdaddrpr(&pcb.dst, remote, sizeof(remote)),
@@ -467,8 +467,8 @@ rfcommpr(kvm_t *kvmd, u_long addr)
fprintf(stdout,
"%-8lx %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n",
(unsigned long) this,
- so.so_rcv.sb_cc,
- so.so_snd.sb_cc,
+ so.so_rcv.sb_ccc,
+ so.so_snd.sb_ccc,
bdaddrpr(&pcb.src, local, sizeof(local)),
bdaddrpr(&pcb.dst, remote, sizeof(remote)),
pcb.channel,
OpenPOWER on IntegriCloud