Date: Wed, 2 Jun 2010 18:09:22 -0400 From: George Neville-Neil <gnn@freebsd.org> To: net@freebsd.org Subject: A slight change to tcpip_fillheaders... Message-ID: <0BC7AD09-B627-4F6A-AD93-B7E794A78CA2@freebsd.org>
index | next in thread | raw e-mail
Howdy, A while back another src developer mentioned that he had gotten better performance by changing tcpip_fillheaders() in the following way: Index: tcp_subr.c =================================================================== --- tcp_subr.c (revision 209083) +++ tcp_subr.c (working copy) @@ -392,28 +392,19 @@ struct ip *ip; ip = (struct ip *)ip_ptr; + bzero(ip, sizeof(*ip)); ip->ip_v = IPVERSION; ip->ip_hl = 5; ip->ip_tos = inp->inp_ip_tos; - ip->ip_len = 0; - ip->ip_id = 0; - ip->ip_off = 0; ip->ip_ttl = inp->inp_ip_ttl; - ip->ip_sum = 0; ip->ip_p = IPPROTO_TCP; ip->ip_src = inp->inp_laddr; ip->ip_dst = inp->inp_faddr; } + bzero(th, sizeof(*th)); th->th_sport = inp->inp_lport; th->th_dport = inp->inp_fport; - th->th_seq = 0; - th->th_ack = 0; - th->th_x2 = 0; th->th_off = 5; - th->th_flags = 0; - th->th_win = 0; - th->th_urp = 0; - th->th_sum = 0; /* in_pseudo() is called later for ipv4 */ } /* I have tried this change with NetPIPE (NPtcp -b 100000) on a pair of machines using Intel igb devices and found that it provides no improvement, but I am wondering if other people want to try this and see if it improves throughput at all. I was testing this on a Nehalem class machine, not sure if it might help on other architectures. Best, Georgehelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0BC7AD09-B627-4F6A-AD93-B7E794A78CA2>
