Date: Tue, 20 Oct 2015 18:32:01 -0700 From: hiren panchasara <hiren@strugglingcoder.info> To: transport@FreeBSD.org Cc: rrs@FreeBSD.org Subject: Help me understand this SACK code in tcp_output() Message-ID: <20151021013201.GD28288@strugglingcoder.info>
next in thread | raw e-mail | index | archive | help
--x4pBfXISqBoDm8sr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tcp_output() starts out with following two vars set to zero: sack_rxmit = 0; sack_bytes_rxmt = 0; And if we are in recovery and trying to send from holes, i.e. if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags) && (p = tcp_sack_output(tp, &sack_bytes_rxmt))) { And if we end up with if (len > 0), we set sack_rxmit = 1; A little below is following code which I do not understand: /* If sack_rxmit is true we are retransmitting from the scoreboard * in which case len is already set. */ if (sack_rxmit == 0) { if (sack_bytes_rxmt == 0) ...... else { } } What I do not understand is how can we get into the 'else' part. AFAICT, sack_rxmit: when TRUE, we are retransmitting from the scoreboard sack_bytes_rxmt: number of retransmitted bytes from the scoreboard. Now, if sack_rxmit is false, how can sack_bytes_rxmt be > 0? OR is there something I am missing in the code OR how SACK works? Cheers, Hiren --x4pBfXISqBoDm8sr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJWJusOXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l+3QH/0edSDsmGh1SsXQg/TA6dQdg P0Sj6qMFTWtAwibmiDR0wbjZgxVGkXVXBRisN2eNHRIPeyil65K72cEF2W2Q5LUA PFaV5eQrc7ctGBbouQJcldm2gSS16OzAwwdJGRSy7TfeUsMvCRTHQI0AIN53pBRw Q7I2Tuzlh6txcmvHzkNCeSHbJprugPjHR8pEszOFG3njyHa3mNpkGW7OEvtNOmcO L6VIdu8PSPxMvR+33xhmC90qmHOs1PQoN6FiVdxWWEQKUOgtBvcBQpXUQUEe5l/k TXFFNdVzTHhdzMgAw1s8PQB6NuNdejR5etdPCXO8vo7AA553JIGydbIJG062pUo= =Q6gB -----END PGP SIGNATURE----- --x4pBfXISqBoDm8sr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151021013201.GD28288>