svn commit: r271946 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys

Cui, Cheng Cheng.Cui at netapp.com
Fri Nov 6 20:43:02 UTC 2015


Hello Hans,

This is Cheng Cui. I am reading the CURRENT FreeBSD code in tcp_output.c, and find this question regarding your change in revision 271946.
https://svnweb.freebsd.org/base/head/sys/netinet/tcp_output.c?r1=271946&r2=271945&pathrev=271946

trim data "len" under TSO:

885	                        /*
886	                         * Prevent the last segment from being
887	                         * fractional unless the send sockbuf can be
888	                         * emptied:
889	                         */
890	                        max_len = (tp->t_maxopd - optlen);
891	                        if ((off + len) < sbavail(&so->so_snd)) {    <==
892	                                moff = len % max_len;
893	                                if (moff != 0) {
894	                                        len -= moff;
895	                                        sendalot = 1;
896	                                }
897	                        }

Is there a specific reason that it should skip trimming the data "len" under the condition of "(off + len) == sbavail(&so->so_snd)" in TSO? Because I am wondering if we can trim the data "len" directly without checking the "(off + len)" condition.

Thanks,
--Cheng Cui
NetApp Scale Out Networking



More information about the svn-src-head mailing list