Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Apr 2007 22:20:48 +0200
From:      Andre Oppermann <andre@freebsd.org>
To:        stas.ibragimov@gmail.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Routing
Message-ID:  <46267DA0.6040901@freebsd.org>
In-Reply-To: <46265ec6.4bc81c47.0b0d.ffff97f3@mx.google.com>
References:  <46265ec6.4bc81c47.0b0d.ffff97f3@mx.google.com>

next in thread | previous in thread | raw e-mail | index | archive | help
stas.ibragimov@gmail.com wrote:
> Hi, hackers :) In /usr/src/sys/netinet/tcp_output.c if function tcp_output() there are
> code: error = ip_output(m, tp->t_inpcb->inp_options, NULL, ((so->so_options &
> SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0, tp->t_inpcb); In this function there are only one
> call ip_output function, but struct route is null. I think, that more optimaly is to
> keep the pointer to struct route in tcpcb.And not to search route every time, when
> tcp_output called.

We had what you describe in FreeBSD prior to version 5.2 and it was a mess.
There were routing table pointers and references all over the place and when
routes changed we had to scan all tcpcb's to nuke old references.  Also the
cached host information moved from the routing table to the tcp_hostcache.
While the route loopup per segment send is a very small overhead it outweights
the drawbacks of the previous system quite a bit.  And the code is much nicer.

-- 
Andre




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46267DA0.6040901>